[ tkojemile @ 01.06.2011. 13:54 ] @
Hi!

Sorry što je na engleskom, ali postao sam na još jedan forum :D
Al tko zna, zna :D


I'm trying to create dependence between checkbox & textbox. If checkbox is selected textbox should be required to fill. If not it can be empty.

I created xhtml like this:

<tr:inputText id="email"
labelAndAccessKey="#{msg['subscriber.package.email']}"
value="#{createBean.subscriber.email}"
contentStyle="width: 200px;" maximumLength=""
validator="#{Validator.validateEmail}"
required="#{createBean.mobileAccessWeb}"
renderer="#{createBean.isMobileAccessWeb}"
partialTriggers="mobileAccessWeb">
<tr:selectBooleanCheckbox
labelAndAccessKey="#{msg['msg.webAccess']}:"
id="mobileAccessWeb" immediate="true" autoSubmit="true"
valueChangeListener="#{createBean.onChangeMobileAccessWeb}"
value="#{createBean.mobileAccessWeb}" />

But if I dont use checkbox (it is false) after loading and click save - it is possible. If I select checkbox and enter data in email field and click save - it is possible. If I select checkbox and deselect it - I got message: E-Mail - You must enter a value.

Tried on google, but with no success.

Thanks for answer!

Regards, Mile
[ stevan_nk @ 01.06.2011. 15:49 ] @
Vala si se mogao toliko potrudit da prevedeš
[ branecns @ 02.06.2011. 21:24 ] @
Citat:
tkojemile: Hi!

But if I dont use checkbox (it is false) after loading and click save - it is possible. If I select checkbox and enter data in email field and click save - it is possible. If I select checkbox and deselect it - I got message: E-Mail - You must enter a value.

Tried on google, but with no success.

Thanks for answer!

Regards, Mile


Jel si probao i na inputText da stavis immediate = true, ili sa selectBooleanCheckbox da ga skines?
[ tkojemile @ 05.06.2011. 21:26 ] @
jesam :)
neće govance... sutra moram uhvatiti se u koštac skroz na skroz s time pa kad riješim postam ovdje rješenje
[ branecns @ 06.06.2011. 08:11 ] @
Citat:
tkojemile: jesam :)
neće govance... sutra moram uhvatiti se u koštac skroz na skroz s time pa kad riješim postam ovdje rješenje


Onda bi trebalo probati skinuti i autoSubmit="true". Da se ne okine procesiranje forme vec na cekiranje checkboxa, nego tek kada se klikne na save.