List with pre-defined search active [message #506] |
Wed, 27 December 2006 18:28 ![Go to next message Go to next message](/theme/default/images/down.png) |
David Lee
Messages: 44 Registered: June 2006
|
Member |
|
|
What is the best way to list a table (list1, from menu) with a search condition active, defined as the default search condition in the class for that table?
Is it easy to have buttons that display that table with different search conditions active?
I expect there are multiple ways in which these can be achieved, and that various applications would require such functionality!
Thanks
David Lee
|
|
|
Re: List with pre-defined search active [message #508 is a reply to message #506] |
Thu, 28 December 2006 05:53 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
If you look at http://www.tonymarston.net/php-mysql/menuguide/mnu_task(upd) .html you will see are two ways of defining search criteria for a transaction using either 'Selection (fixed)' or 'Selection (temporary)'.
It is also possible to invoke pre-defined selection criteria using navigation buttons. In the 'Miscellaneous Tasks' subsystem there are 3 examples of tasks which change the selection criteria regarding start_date and end_date. If you go into the Product prototype and in the 'List Product' screen press the 'Feature Applicability' button you will see two navigation buttons labelled 'Current' and 'Historic'. These will filter the current display based on active dates. You can use this mechanism to set whatever selection criteria you want.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: List with pre-defined search active [message #513 is a reply to message #512] |
Fri, 29 December 2006 07:04 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
David Lee
Messages: 44 Registered: June 2006
|
Member |
|
|
Thanks Tony
However, could you add a little more to FAQ72. I have no problem creating the PHP file, but it appears that to add it to the system, that file must first be added as a procedure (with fields Task, Description, Button Text, Pattern, Subsystem, Script ID), before it can then be added as a button function. Is this correct, and, if so, what Pattern should be selected?
I am also currently not getting the selection criteria within 'Selection (temporary)' field of the Update Task screen to affect my display, but am still working on that. So far, I have only looked at the SQL dump, and noted that it is not generating a "Where" clause. Probably something else I have done somewhere!
Regards
David Lee
|
|
|
Re: List with pre-defined search active [message #514 is a reply to message #513] |
Fri, 29 December 2006 07:23 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Yes, you have to create it as a task on the MNU_TASK table, but as there is no pattern for it you will have to do it manually. A pattern is for tasks which have a model, view and controller, and this little task has none of those.
If the value you have input into 'Selection (temporary)' is being ignored perhaps you can step through with your debugger to see what is happening to it.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
Re: List with pre-defined search active [message #529 is a reply to message #528] |
Wed, 10 January 2007 13:09 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
AJM
Messages: 2361 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
When the previous screen is reactivated the search criteria are passed to the object in the line
if (isset($search)) {
$dbobject->setSqlSearch($search);
} // if
The contents of $this->sql_search are then processed by the _sqlAssembleWhere() method which is called in $object->getData() just before the database is accessed. You will need to step through this with your debugger to see what is happening to the string that you loaded.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|