Tags:
create new tag
view all tags

SID-00857: Filter table not filtering correctly

Status: Answered Answered TWiki version: 4.2.4 Perl version:
Category: CategorySearch Server OS: Linux Last update: 15 years ago

I am trying to filter the results returned by a seach that searches a table. The filter works by letting the user pass URLPARAMS through a form and then searching for those specific values in the table(which is its own topic). When I seach for the URLPARAMS, I perform a regular expression AND by using the ";" character between parameters. The problem is when the code executes, it seems to give priority to the farthest right URLPARAM in the AND statement and ignore all other parameters. For example, in the search code below if %URLPARAM{"qPh"}% was equal to "1" and %URLPARAM{"qMile"}% was equal to "review" the search result should include all table entries with both "1" and "review" in them. However, it actually returns all results with "review" in them, regardless if they include the number "1" or not.

Code:

%CALC{"$PROPERSPACE(%TOPIC%)"}%

<form action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%">
| *Filter:* | *Phase:* | *Major Milestone:* | *Deliverable:* | *Completed:* | *ECD:* |
| *<input type="submit" value="Filter" />* | *<select name="qPh" size="1"> <option>%URLPARAM{"qPh"}%</option><option></option> <option>1</option><option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> </select>* | *<select name="qMile" size="1"> <option>%URLPARAM{"qMile"}%</option><option></option> <option>DOS Review</option> <option>Design Review</option> <option>Product Plans</option><option>Tapeout Complete</option> <option>1st Silicon Out</option> <option>Characterization</option><option>Release to Production</option><option>Final Product Review</option></select>* | *<input type="text" name="qDel" value="%URLPARAM{"qDel"}%" size="10" />* | *<select name="qComp" size="1"> <option>%URLPARAM{"qComp"}%</option><option></option> <option>Y</option><option>N</option> <option>N/A</option> </select>* | |

%SEARCH{ search=" %URLPARAM{"qPh"}%;%URLPARAM{"qMile"}%;%URLPARAM{"qDel"}%" topic ="TestTopicFilteredEditTable" type = "regex" multiple = "on" scope = "text" nofinalnewline = "on" nosearch = "on" noheader = "on" nototal = "on" format = "$text" header = "| *Phase* | *Major Milestone* | *Deliverable* | *Completed* | *ECD* |" format =  "$text" }% </form>

-- ChrisSporck - 2010-06-03

Discussion and Answer

You are searching for string "1" anywhere in a page, it is quite likely that there is a "1" such as in the time stamp in the topic meta data. If you do a QuerySearch compare the form field value to your URLPARAM value. If you use a RegularExpression search you need to identify the form field meta data, such as META:FIELD.*name=.Phase.*value=.%URLPARAM{"qPh"}%

Also, make sure to encode URLPARAM values properly, see VarURLPARAM.

-- PeterThoeny - 2010-06-03

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- PeterThoeny - 2010-08-02

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Filter table not filtering correctly
SupportCategory CategorySearch
TWiki version 4.2.4
Server OS Linux
Web server Apache
Perl version

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2010-08-02 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.