This topic is locked

Changing Drop downs items offered

11/21/2007 7:54:29 AM
PHPRunner General questions
W
WhoFlungDung author

Hi Guys
I apologise if this has been asked before but I did search the forum and found no results
What I would like to do is selectively offer items in a dropdown list generated by the Lookup wizard
I have MySQL database with function names in it and I only want to offer the ones pertinent to a selected (web)page by number (1,2,3,4,5,etc)
I can get the dropdown to display all functions but when I try to limit which ones I hit synax probs which prevent the page from displaying at all
I am trying to use the WHERE box and the FIND_IN_SET function - all to no avail - any constructive ideas anyone ?
PS rapidly losing hair over this one <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=6874&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />

Alexey admin 11/22/2007

Hi,
make sure you enclosed WHERE clause in quotes in the Lookup wizard dialog.

Show me your WHERE box contents.

W
WhoFlungDung author 11/22/2007

Hi
Where clause was like this
" FIND_IN_SET(" PageNum ",Page)>=1"
Pagenum is the Fieldname on the edit page and Page is the filedname from the database holding valid page numbers like 1,2,3,4 etc
hope you can help this is driving me crazy now

Alexey admin 11/22/2007

Hi,

  1. There is a syntax error in your expression.

    The correct one should look like this:
    "FIND_IN_SET( PageNum ,Page)>=1"


2. I suppose this WHERE expresion won't help you anyway.

You need to use Dependent dropdowns instead.

Look at this tutorial to see how you can set them up:

http://www.xlinesoft.com/phprunner/flash/new_depen1.htm

W
WhoFlungDung author 11/22/2007

its close but not quite what's required
I have this form
Page - entered by user

Desc - entered by user

Case_id - entered by user

Description -entered by user

FunctionCall - selected from dropdown dependent on what was entered in Page
the functionCall table has a field ValidPage which is comma seperated list ie a function maybe valid on more than one page
having entered the Page in the edit I want only those funtionCalls to drop down which are valid on that page
hope this clarifies

Alexey admin 11/22/2007

Hi,
I see what you saying.

This won't work with PHPRunner.
You can achieve this by setting up dependent dropdowns and then modifying generated pages.

  1. You'll need to create Pages table if you don't have any. Page control should be a Lookup wizard.
  2. Set the FunctionCall to be dependent on Page. Use ValidPage field as a category field.
  3. Build the pages.
  4. Find all occurencies of "ValidPage" in the files generated and make the SQL expressions look like "FIND_IN_SET( PageNum ,ValidPage)>=1" instead of "PageNum=ValidPage"
    It's not a trivial task, however this should work.

W
WhoFlungDung author 11/23/2007

Thanks for the reply
Being a new user it may take me a while to understand exactly how to impliment your solution
I will keep trying