-
1. Re: Calendar with required attribute problems
ilya_shaikovsky Jul 22, 2010 4:38 AM (in response to hwoarang)Or this is known bug?
Not a bug but just works as it should. The same you will see if will just use inputText. Component value can't be empty with required set to true(only on initial loading.) Add rich:messages - you will see the message about it.
-
2. Re: Calendar with required attribute problems
hwoarang Jul 23, 2010 1:10 AM (in response to ilya_shaikovsky)Hello Ilya! Thank you, again.
Now, my problem is installed.
In my form I have another calendar that depends on the first calendar's value to be validated. Something like this:
<r:calendar value="#{MyBean.attribute}" required="#{not empty r:findComponent('someInputText').value}" id="calTest"/> <r:calendar value="#{MyBean.anotherAttribute}" required="#{not empty r:findComponent('calTest').value}" id="anotherCalendar"/>
The first calendar is required if someInputText is not empty.
So, the second calendar value is required if the first one is not empty, but as I said (and you confirmed that is not a bug), if I use the clean buttom in the first calendar, the second will be considered valid as the first value wasn't reseted.
Do you have any suggestion how to achive this? As we can't have 'onclean' event to do something, can I force null value somehow?
Thank you !
Flávio Henrique
-
3. Re: Calendar with required attribute problems
ilya_shaikovsky Jul 23, 2010 4:27 AM (in response to hwoarang)add a4j:support's to the components which should influence another ones (use onchanged even or calendar's). So when any value change occurs, including clearing - update dependent controls to keeps all of them in sync.
-
4. Re: Calendar with required attribute problems
hwoarang Jul 23, 2010 1:09 PM (in response to ilya_shaikovsky)Hello Ilya, thank you.
I dont know what I was doing wrong, but I tried that already and was'nt worked.
Now I can validade the fields as expected.
Thank you.