Re: Knop package updated

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Knop package updated

Jolle Carlestam-2
My usual corral implementation is to have a template with regions.
For example:
        headerLeft
        headerRight
        pageLeft
        pageMain
        PageRight
        footer

In some solutions these are divided into even more regions.

In the template each region usually only have this code:

        <div id="footerAlpha">
                [Protect][Include:$footerAlpha][/Protect]
        </div><!-- /footerAlpha -->

I find this useful since it gives me freedom to populate each region  
independently. And it also makes AJAX functions easy to integrate.

But I don't know or understand how to use Knops:
[/* Show page contents */
$nav -> (include: 'content')]

in the same way since it assumes that there's only one object to  
handle on the main page area.

Pageblocks have a way to handle this by looking for files with  
certain keywords in the filename and use them to populate the  
different regions. I'm not saying that's the best way to do it, just  
that Greg foreseen this need and offers a way to enable it.

It also possible that I just don't understand how to use Knop properly.

HDB
Jolle

28 mar 2007 kl. 14.45 skrev Ric Lewis:

> Jolle
>
> I'm also trying to get a handle on how best to construct corral  
> style pages using this framework.
>
> Could you not treat the index.lasso as the main corral page  
> template, and add in sections for headers, footers, sidebars etc?  
> (via includes or otherwise). Since the config, library etc for the  
> page are loaded before the nav object does its stuff, any required  
> pre-processing can be done there.
>
> Adding a basic header and footer etc was pretty straightforward,  
> but I haven't yet anything more complex - please explain what you  
> are want to achieve.
>
> Cheers,
>
> Ric
>
>
> On 16 Mar 2007, at 21:34, [hidden email] wrote:
>
>> One thing I discovered in trying to get the css to act as I want  
>> it is that Knop doesn't fit to well with a corral template  
>> thinking. Since the nav object calls the entire page content at  
>> once it's harder to build a template. Or did I miss something in  
>> the instructions.
>


#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Reply | Threaded
Open this post in threaded view
|

Re: Knop package updated

Johan Solve-2
At 15.24 +0200 2007-03-28, [hidden email] wrote:
>But I don't know or understand how to use Knops:
>[/* Show page contents */
>$nav -> (include: 'content')]
>
>in the same way since it assumes that there's only one object to handle on the main page area.
>
>Pageblocks have a way to handle this by looking for files with certain keywords in the filename and use them to populate the different regions. I'm not saying that's the best way to do it, just that Greg foreseen this need and offers a way to enable it.

Are those specific regions (keywords) predefined by Pageblocks, or by your own configurations?

How do you determine what region file to use for a specific page? Is your logic working that out?

Nothing prevents you from doing regular includes either around the $nav -> (include: 'content'), or even within the content file itself. But it would of course be nice to have a way to handle this more transparently within the framework. I'm not sure how though. Suggestions are welcome.

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop

Reply | Threaded
Open this post in threaded view
|

Custom SQL queries for mt_grid

Ric Lewis-3
Feeding a custom SQL query into mt_grid (ie joining two tables)  
succeeds in displaying data from both tables, but it breaks the  
functionality of the listing, ie buttons for next record group etc.

I'm just specifying the SQL and using the -Inlinename parameter on  
the [$list -> renderhtml], but perhaps there is more to it.

Or is mt_grid not designed to be used in this way?



#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop


Reply | Threaded
Open this post in threaded view
|

Re: Custom SQL queries for mt_grid

Johan Solve-2
At 12.11 +0100 2007-03-29, Ric Lewis wrote:
>Feeding a custom SQL query into mt_grid (ie joining two tables) succeeds in displaying data from both tables, but it breaks the functionality of the listing, ie buttons for next record group etc.
>
>I'm just specifying the SQL and using the -Inlinename parameter on the [$list -> renderhtml], but perhaps there is more to it.
>
>Or is mt_grid not designed to be used in this way?

That should work excellent.

Are you feeding a skiprecords value into your query properly?

Real example where using a query with LIMIT:
        $skiprecords = $grid_customer -> (page_skiprecords: $maxrecords);

        // build search params
        var: 'searchparams'=(array: -maxrecords=$maxrecords, -skiprecords=0),
                'sql'='SELECT p.firstname, p.lastname, CONCAT(p.firstname, " ", p.lastname) AS fullname,
                        p.email,
                        i.area, i.keyfield, i.id AS id_ipr
                        FROM interpreter i
                        LEFT JOIN person p ON i.id_person_main=p.id';
        $sql += ($grid_customer -> (sortparams: -sql))
                + ' LIMIT ' + $skiprecords + ',' + $maxrecords;


Real example where using a query with no LIMIT but Lasso skiprecords:
        $skiprecords = $grid_customer -> (page_skiprecords: $maxrecords);

        // build search params
        var: 'searchparams'=(array: -maxrecords=$maxrecords, -skiprecords=$skiprecords),
                'sql'='SELECT p.firstname, p.lastname, CONCAT(p.firstname, " ", p.lastname) AS fullname,
                        p.email,
                        i.area, i.keyfield, i.id AS id_ipr
                        FROM interpreter i
                        LEFT JOIN person p ON i.id_person_main=p.id';
        $sql += ($grid_customer -> (sortparams: -sql));


The database ctype relies on the same code as http://tagswap.net/found_rows to get the total number of found records from any given query that uses LIMIT, but it is possible that there can be cases with complex queries where it doesn't return the proper result. That could cause problems for grid.

You can try [found_rows] on itself with your query if you are using LIMIT.


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop

Reply | Threaded
Open this post in threaded view
|

Re: Custom SQL queries for mt_grid

Johan Solve-2
In reply to this post by Ric Lewis-3
At 13.24 +0100 2007-03-29, Ric Lewis wrote:
>OK - thanks - that works perfectly - all navigation and found_counts etc now fine.
>
>The quicksearch produces the correct number of results, but doesn't show the right records, just the first 'x' records of the custom SQL query.
>
>I realize it would need to combine the quicksearch parameters with the custom SQL query, so that may not be so easy.

On the contrary, very easy... I actually edited that part out of my previous post...

        // build search params
        var: 'searchparams'=(array: -maxrecords=$maxrecords, -skiprecords=0),
                'sql'='SELECT p.firstname, p.lastname, CONCAT(p.firstname, " ", p.lastname) AS fullname,
                        p.email,
                        i.area, i.keyfield, i.id AS id_ipr
                        FROM interpreter i
                        LEFT JOIN person p ON i.id_person_main=p.id';
        if: $grid_customer -> quicksearch -> size;
                $sql += ' WHERE ' + ($grid_customer -> (quicksearch: -sql));
        /if;
        $sql += ($grid_customer -> (sortparams: -sql))
                + ' LIMIT ' + $skiprecords + ',' + $maxrecords;

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lists.montania.se/Lists/knop/
(log in with your email and ConfirmationID as password, send message to
<[hidden email]> to get that ID)
Project homepage http://montania.se/projects/knop/
AIM chatroom knop aim:gochat?roomname=knop