I just gave it a shot in a very simple way, and it works for me. Here's what I have:
- make sure my database is ft indexed!!
- create a viewPanel with an id = "viewPanel1"
- link viewPanel to a view datasource
create a computed search property for my viewPanel with the following code:
requestScope.get("fts");
create a comboBox (above) the view panel
- bind the combo to my requestScope variable "fts"
- fill the combo's option list with appropriate values
- have the combo's onchange event perform a partial update and link this to my viewPanel (ID: viewPanel1)
In my case I have test documents in my view with a subject field that has values like "sub 1", "sub 2", ... , "sub 6". So I made my combo offer me options "1" ... "6".
If I want to be more specific with my ft search string I can build it like this in the viewPanel's search property (step 4):
if(requestScope.containsKey("fts") && requestScope.get("fts")!=""){
"Sub " + requestScope.get("fts");
}
That's it - works.
If I got your problem wrong let us know. In that case you'd need to be more specific regarding what you are trying to do and what you tried so far.
EDIT:
following your comment I added a listBox to my combo. I see that the listBox itself doesn't do anything bad, but of course I have to take care that the two don't get into each other's way. So here's what I did to resolve that:
- bound my comboBox to a different requestScope var called "ftsCombo"
- bound my listBox accordingly to "ftsList"
- both controls have the same option list (see above; of course you can use different options, I just was to lazy to think of different values...), and they are performing a partial update onchange
- to be able to control the results I created a named panel around my viewPanel (id = "tgtPanel") and changed the partial update rule to target the panel
- inside the panel above the view I created 2 computed fields, each bound to one of my requestScope variables (ftsCombo / ftsList) so that I see what's in the scope after onchange has been triggered
- in both onchange events I also wrote a short snippet of SSJS code to
clear "the other" variable so that the two don't get in each other's
way:
(onchange of combo:)
requestScope.remove("ftsList");
(onchange of list:)
requestScope.remove("ftsCombo");
finally changed the view's computed search property to be like this:
if(requestScope.containsKey("ftsCombo") && requestScope.get("ftsCombo")!=""){
return "Sub " + requestScope.get("ftsCombo");
}
if(requestScope.containsKey("ftsList") && requestScope.get("ftsList")!=""){
return "Sub " + requestScope.get("ftsList");
}
So now I can either use the combo or the list to apply a filter