<!x-stuff-for-pete base="" src="" id="0" charset=""><html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Thanks everyone for the help so far!</div><div><br></div><div>I've had some time to re-read the Knop paper and look over the files in some of the examples and demo, which of course brings up a host of questions, but here are 3 :)</div><div><br></div><div>right now I'm concentrating on the form and nav portions.</div><div><br></div><div>I'm working on creating some test pages, and starting with a simple sign in page.</div><div>I've got the cfg_lang.inv file written, so far seems pretty self explanatory. </div><div><br></div><div>1. I have my index.lasso page that sets up the nav objects and all. I haven't quit figured out how to call the page any of the links go to. For example, I'm looking at the "3-nav" page. The links are displaying, but I'm not sure where to go from there in terms of writing the next page (example, how do I call and display a page: "Latest News").</div><div>I'm used to sending a link with the include page name so I know what page to call into my index.lasso page in projects I do now. I know this is a lame question, but hey, what can I say :)</div><div>--------------------------</div><div><br></div><div>2. I'm trying to get the nav objects set up, and have a question regarding actionpath.</div><div><br></div><div> In the examples, the "form action" is written out on the page. I'd like to use the nav to decide the form actions, rather than writing them out (as Jolle sugested below if not using the nav objects). In the example below, I'm not sure where "-formaction = ($nav -> url( 'advanced'))," is coming from.</div><div><br></div><div>I know there is a nav object called advanced, but not sure on the "$nav -> url" part.</div></div><div><br></div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Regarding the nav object. It's more intertwined with the form object, but not necessary.</div><div><br></div><div>This is my original example:</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>var('fDemo' = knop_form(<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-formaction = ($nav -> url( 'advanced')),<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-method = 'post',<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-database = $dDemo,<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-actionpath = 'advanced/edit',<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-legend = $lang_ui -> editcustomer<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>));<br></div><div>Change it to:</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>var('fDemo' = knop_form(<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-formaction = '/where/to/go',<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-method = 'post',<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-database = $dDemo,<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-actionpath = '/where/you/came/from',<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>-legend = 'My cool form'<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>));<br></div><div><br></div><div>In the presented form it will look like this:</div><div><pre><span class="Apple-style-span" style="white-space: normal; "><form action="/where/to/go" method="post"></span></pre><pre><span class="Apple-style-span" style="white-space: normal;"><input type="hidden" name="-action" value="/where/you/came/from"></span></pre><pre></pre>When you submit the form on the other hand the usefulness of the nav object becomes clearer. Using it you have a ready made line of action to handle the form on the server side. I have not used the form object in situations where I didn't have a nav object. Something I realise now when trying to describe it for you. But use of Knop_nav also means adopting the Knop file structure to master the nav objects full potential. Once you have the file structure in place Knop_nav will find where you are, include all necessary files and glue them together for you in a usable and presentable way.</div><div><br></div><div>In the common case of a form you probably have two items in a nav object. A list view presenting the found records of a search and a detail view for editing a record. Here's a slightly modified example from the demo package:</div><div><br></div><div><div><div>// create main navigation object</div><div>var('nav'=knop_nav( </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-default='customer', // this turns the customer nav object into the default page of the site</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-root='/', </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-navmethod='path'); // can be path or param. Path is used in a onefile system using the optional AtBegin handler</div><div><br></div><div>var('subnav_temp'=null);</div><div><br></div><div>// create nav object for children items</div><div>// you start with the child objects so that you later on can add them to their mother</div><div>$subnav_temp = knop_nav;</div><div>$subnav_temp -> insert( </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-key='list', </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-label='A list');</div><div>$subnav_temp -> insert( </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-key='edit', </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-label='Edit');</div><div><br></div><div>// add nav item with children items</div><div>$nav -> insert( </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-key='customer', </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-label='Customer', </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-children=$subnav_temp, // adding the children previously created</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>-default='list'); // this turns the list page into the default when navigating to /customer. And since customer is the default for the entire nav object you'll get to the list view using just /</div><div><br></div></div></div></div></blockquote>---------------------------</div><div>3. Next, If someone wouldn't mind explaining these includes, I'd greatly appreciate it (taken from the "demo" index.lasso file- never mind the "library/lib_global.inc" one):</div><div><br></div><div><div>// First load the configuration for the action path</div><div>$nav -> (include: 'actionconfig');</div><div>// Now execute the application logics for the action path</div><div>$nav -> (include: 'action');</div><div><br></div><div><br></div><div>// PART 2 - Prepare the output for the page we are showing, specified by the path. </div><div><br></div><div>// First load the configuration for the path.</div><div>// It will not be loaded again if it has already been loaded as action config, to avoid overriding the result of the action. </div><div>$nav -> (include: 'config'); // config is a special keyword for -> include</div><div><br></div><div>// Run some code that is common for all pages and that needs to be run after the action. </div><div>$nav -> (include: '_library/lib__global.inc'); // -> include is called with a specific filename</div><div><br></div><div>// Run page logics to prepare what will be displayed for the current path.</div><div>$nav -> (include: 'library');</div></div><div><br></div><div><br></div><div>Thanks again all.</div><div>The more I look at the files, the more I know this is exactly where I want to go!</div><div><br></div><div>Thanks so much for all the work put into this project Johan and others!</div><div><br></div><div>James</div><div><br></div><br></body></html>
Mar 12
James Sheffer Re: actionpath questions
Mar 12, 2009; 18:16
James Sheffer
Re: actionpath questions
Mar 12
James Sheffer Re: actionpath questions
Mar 12, 2009; 18:50
James Sheffer
Re: actionpath questions
Mar 12
Johan Solve Re: actionpath questions
Mar 12, 2009; 22:41
Johan Solve
Re: actionpath questions
Mar 12
Jolle Carlestam Re: actionpath questions
Mar 12, 2009; 22:51
Jolle Carlestam
Re: actionpath questions
Mar 13
Jolle Carlestam Re: actionpath questions
Mar 13, 2009; 07:01
Jolle Carlestam
Re: actionpath questions
Mar 13
James Sheffer Re: actionpath questions
Mar 13, 2009; 11:33
James Sheffer
Re: actionpath questions
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!