myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Qunming Yuan \(Saul\)" <y...@dataanvil.com>
Subject Re: required=true?
Date Sun, 15 Apr 2007 15:43:04 GMT
Hi,

Just a thought, can you dynamically control the requiredness of your text field base on the
choice of your radio button, something like:

required="${backingBean.radiobuttonValue}"

This way whether the text box is render or required is in sync with the choice of your radio
button.


Saul

  ----- Original Message ----- 
  From: Bjørn T Johansen 
  To: users@myfaces.apache.org 
  Sent: Sunday, April 15, 2007 10:23 AM
  Subject: required=true?


  I have small problem and I was wondering how people get around this...

  I have a radiobutton with yes or no as the two choices that decides if a text field should
be rendered or not (choosing yes or no
  will submit the page)... Also if this text field is rendered, it is a mandatory field and
need some input..

  If I use required = true on the text field, then when the text field is rendered and I choose
the other choice of the
  radiobuttons (that would hide the text field again), I get an error saying that an input
is required in the text field (which is
  normally correct but not this time, because I am just trying to hide the text field again)
  If I use immediate = true, then the value of the radiobutton is not set and the text field
is never rendered...


  I guess this is a normal problem but not sure how to best solve this?


  Regards,

  BTJ

  -- 
  -----------------------------------------------------------------------------------------------
  Bjørn T Johansen

  btj@havleik.no
  -----------------------------------------------------------------------------------------------
  Someone wrote:
  "I understand that if you play a Windows CD backwards you hear strange Satanic messages"
  To which someone replied:
  "It's even worse than that; play it forwards and it installs Windows"
  -----------------------------------------------------------------------------------------------

  --------------------------------
  Spam/Virus scanning by CanIt Pro

  For more information see
  http://www.kgbinternet.com/SpamFilter.htm

  To control your spam filter, log in at
  http://filter.kgbinternet.com




  E-mail message checked by PC Tools Spyware Doctor (5.0.0.179)
  Database version: 5.07080
  http://www.pctools.com/spyware-doctor/



E-mail message checked by PC Tools Spyware Doctor (5.0.0.179)
Database version: 5.07080
http://www.pctools.com/spyware-doctor/

Mime
View raw message