Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Dear Support,
1.How can i use extra filter condition in form builder?
2. What is the return value when i making a beanshell script in select box, beacuse i use this code : http://dev.joget.org/community/display/KB/Form+Variables
Something changed in v3 scriptting? Because when we were using 2.0.3 it was working.
Thx.
14 Comments
Miklos Daru
If somebody make an application whice is using Extra Filter Condition, please share at this forum site.
Thx,
Miklos
Owen Ong
Hi Miklos Daru,
The "Extra Filter Condition" in "Default Form Options Binder" is actually using HQL (Hibernate Query Language) format. It is quite similar to SQL.
Below is an example query:
Let say you want to filter your options to "new" or "rejected" based on a field id called "status", just append the field id with "customProperties." and then write your condition clause.
Regards,
Owen
kienfei
Hi Owen ,
Can i know is it hash variable can use in data list extra filter condition ?
Let say , i want to write condition is list out this user's applications.. So i will need to use HQL like below :
customProperties.submittedBy LIKE '%#currentUser.lastName#%' ? cheers,
kienfei
Owen Ong
Hi kienfei,
Yes, you can do that. It is same with the "Extra Filter Condition" in "Default Form Options Binder".
Regards,
Owen
Ralf Schlosser
Hi,
is it possilble to use a Hash variable there ?
likecustomProperties.id LIKE #form.contacts.name#
?
but for me it looks like it is not possible to use Hash on Application level ?
cheers
Ralf
Hugo
Hi Ralf,
Yes, it is possible. It depends on the scope on where you access it.
For instance, in your case, if you are at the list level, you can't possibly use the form hash variable because there's no pointer set to the form data.
One good example to use hash variable in the JDBC Datalist Binder (Custom SQL Queries) binder in Datalist would be on storing the DB access parameter (JDBC path, username, etc) as Application level environment Hash Variable (See Hash Variables).
Hope this helps.
Ralf Schlosser
Hi Hugo,
I tried it on form level, not list.
Edit Select Box > Choose Options Binder > Select Form > Choose Validator > Workflow Variables
Extra Filter Condition : likecustomProperties.id LIKE #form.contacts.name#
also if I try to use #form.contacts.name# in a form it doesen't give a value back... it shows #form.contacts.name#
any idea what I do wrong ?
cheers
Ralf
Hugo
Hi Ralf,
I think the form hash does not work inside the Options Binder. As a workaround, try Dynamic Cascading Drop-Down List. Hope this helps!
Ralf Schlosser
but I think it is not in the release yet or ?
but in the form itself it should work ?
Hugo
Hi Ralf,
This feature is implemented in revision 338 and above. You may need to build it yourself as there's no new version release yet. Thanks.
Dinx
how can i put two extra filter condition? example: customProperties.department_id IN ('ICT') and
customProperties.field4 IN ('approved')
marimo
I have the same question. No reply?
Owen Ong
Hi Dinx and marimo,
Dinx had the right answer. You can using "and" or "or" to add more filter condition just like normal query.
Example:
Hope this is help :)
Dinx
Thanks Owen Ong, its really help.. Really thanks for you reply.