This topic is locked

initiate custom query from Search Page

1/7/2014 5:04:05 AM
PHPRunner General questions
Y
YCH author


[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"] [size="3"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]

What I am aiming at is this: i[font="Calibri"][size="3"]nstead of running the standard "save button" on the advanced Search page I inserted a New Button in order to fire a 'on click event' and build a custom $strWhereClause to filter the initial _list.php. I know I will need to fetch the multiple values in the 'selectALL' field and the other fields on the page (how do I do this?) in order to build a custom query and filter the initial _list.php.[/size]
Any help much appreciated!
[/size]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]
[font="Times New Roman"]

Sergey Kornilov admin 1/7/2014

Since there is no 'Save' button on Advanced Search page this approach most likely won't work.
My suggestion is to customize one of existing search fields instead of adding a totally custom listbox there. In this case you do not need extra buttons or custom WHERE clause.

Y
YCH author 1/8/2014



Since there is no 'Save' button on Advanced Search page this approach most likely won't work.
My suggestion is to customize one of existing search fields instead of adding a totally custom listbox there. In this case you do not need extra buttons or custom WHERE clause.


Sergey,

Thanks for your reply. Could you help me further ? How should I customize one of the existing search fields to be succesful ? Would that be a dummy field being part of the initial table ? What steps need be taken ? Please help.
Yves

Sergey Kornilov admin 1/8/2014

I don't quite understand what exactly you trying to achieve but yes, this can be a dummy field.
Dummy field can be added to SQL query as follows:

select field1,

field2,

field3,

field3 as dummy

from ...


Just make sure this dummy field doesn't appear on Add/Edit pages as it cannot be updated.

Y
YCH author 1/8/2014

Sergey,
I should have been more clearly at first :

What I am aiming at is this: instead of running the standard "SEARCH button" (was wrongly described as 'save button' in my first post, sorry for this) on the advanced Search page, I want to run a "custom search" through building a "custom query" to filter the initial _list.php. This could be fired from a 'custom button' for example. The custom query would have a WHERE clause reading "..WHERE fieldname1 IN (value1,value2,..) or fieldname2 IN (value1, value2,..) or ...".

The value list (value1,value2,..) will be fetched from the custom field (listbox) on the Search page. I have this listbox populated with the Javascript Onload event. What I do not know is how to build the custom query and how to tranfer the value(s) from the listbox to the custom query. The listbox value(s) read like (zipcode1, cityA, countyB,..) . Can you show me the right code ? Thanks for your help.
Yves

Y
YCH author 1/8/2014

Sergey,
In the mean time I am getting step by step closer to my goal. Could you help me with this one ?

How could I mimick a 'Back to list' functionality by adding code to the 'client After'-event of a custom button on the advanced Search Page?
thank you.

Yves