Don't you just need to set immediate="true" on a4j:support?

Sean
Hi,

I have to show/hide a field only if another field has a certain value.
The problem is that ajax requests fail if the form does not validate (mandatory fields not filled) when the ajax event is triggered.
Has anyone met this before? Any workarounds?


Below is my code; bean.map is a hashMap with values { "Green" => "green", "Red" => "red", "Blue" => "blue" }, the other fields, bean.a and bean.c are simple strings.

<h:form>

  Trigger:
  <h:selectOneRadio id="choose" value="#{bean.a}">
    <f:selectItems value="#{bean.map}" />
    <a4j:support event="onchange" reRender="panel" />
  </h:selectOneRadio><br />

  Show/Hide:
  <a4j:outputPanel id="panel">
<h:inputText name="myLabel" value="label" rendered="#{bean.a == 'blue'}" />
  </a4j:outputPanel>
  <br />

  Mandatory field:
  <h:inputText value="#{bean.c}" required="true" />

</h:form>

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm




--
Dr. Sean Radford MBBS MSc
[EMAIL PROTECTED]
http://www.tacola.com
Distributed Identity & Access Management
Tel: +44 (0) 8700 671 490
Mob: +44 (0) 7802 24 24 86

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to