Need to hide the field with readonly condition

40 views
Skip to first unread message

rajes...@gmail.com

unread,
Oct 6, 2016, 6:16:12 AM10/6/16
to izpack-user
Hi,

I have one combo select option one is tomcat and the other is tomee.  and its related home directly fields.

eg: combo box: tomee/tomcat

      fields :Tomee home dir: xxxx
                tomcat home dir: xxxxx

when the user selects the combo(tomee/tomcat) the other field(i.e home dir field) should be hidden and it should be read only. I did not find any related condition in the documentation. Can you please help on this?

Regards,
Rajesh

René Krell

unread,
Oct 6, 2016, 11:26:32 AM10/6/16
to izpack-user
Dne čtvrtek 6. října 2016 12:16:12 UTC+2 rajesh120t napsal(a):
Should the "other field" be hidden or should it be read-only?
That's different. 

rajes...@gmail.com

unread,
Oct 7, 2016, 2:13:00 AM10/7/16
to izpack-user
The other field should be hidden and the codition in it should be read only

René Krell

unread,
Oct 7, 2016, 3:52:42 AM10/7/16
to izpack-user
Dne pátek 7. října 2016 8:13:00 UTC+2 rajesh120t napsal(a):
If a field is hidden you cannot change its value, thus it is automatically read-only, except you override it in the dynamic variables section during refreshing.
A dynamic variable defined on a UserInputPanel along with a field is automatically blocked from being changed anywhere else than at the panel itself as soon as the field is visible, independently of whether it is read-only or editable.
This is maybe better explained here.

The solution is quite simple:
You can work with conditions. In install.xml, just define variable conditions for the field variable other fields should depend on.
Than you can use the <field conditionid="" /> attribute to refer to such a condition, see https://izpack.atlassian.net/wiki/x/ZIAH.
Reply all
Reply to author
Forward
0 new messages