This is more of an architectural question. I am trying to build a filter function similar to what Salesforce has whereby I click an Add filter button and this displays a drop down. Based on the choice of the first drop down, I dynamically add the second(operator values) and third (third value for my query) drop down with related values. Once the user clicks OK button, the filter executes.
My initial solution: I started off using Javascript to build the dependent picklist as well as grabbing the user selected data and built it into one string for use as part of my query at the back end. Using hidden input field and actionfunction, I was able to retrieve the string in my apex code and then using dynamic soql I was able to query and filter.
For scalability and optimization reasons I believe a pure visualforce and apex way of doing this will be a better way for me to go. However I am not quite sure how. Could anyone provide a suggestion? Thanks