I have a data table component and seven multiple selectors related to it. And i want to reset all selectors to default value with a reset button. My data source is SQL database, so i don't have a select "All" option in these selector. Is there any way to make it happen?
相关问题
- h:selectOneMenu in p:dataTable doesn't submit
- Pass code to a method as an argument
- Can I parameterize labels and properties on CREATE
- JasperReports Server parameter dependency
- Questions about Lists and other stuff in Clojure
相关文章
- System.OutOfMemoryException:“数组维度超过了支持的范围。”
- How can I convert a PHP function's parameter l
- Using UNREFERENCED_PARAMETER macro
- Is there a simple way to pass specific *named* Pow
- Selecting all visible rows after a search using
- how to disable show entries property in jquery dat
- PowerShell Pass Named parameters to ArgumentList
- [removed] Which parameters are there for the onerr
There are two issues you need to solve:
For 1 I would go for something like this:
Set the SQL query for the selectors datasource like this:
SELECT '%' FROM [ANY TABLE] UNION [YOUR EXISTING QUERY]
This way you will also have the value
%
as a possible option. This will be your default value, but your DataTable query will have to useLIKE ${YOUR_PARAMETER}
in theWHERE
clause for it to work.Now for 2 you need some preparation to make things work:
Make your select components listen to the same parameter they are setting. This way changing a parameter will also trigger the update of the select UI.
Add a Script component so you can write the function to reset the parameters in it. This way, you can call this function on the event of a button press.
The final trick is just to add a button which will trigger this function. You can use plain old HTML+JS syntax.
The function + HTML button would be something like this:
I haven't tried but it should do the trick!