0 Replies Latest reply on Sep 21, 2013 11:14 AM by Max Weinhart

    JSF Message disappears using a4j:support

    Max Weinhart Newbie

      Hello,

       

      I am unsing JSF 1.2 with the richfaces implementation.

      What I am trying to do is to enable a selectOneRadio when a selectBooleanCheckbox is checked.

      It works so far. But there is a strange effect:

      Consider following situation:

      Field selectA shows an error-Message in its rich:message tag.

      After checking myCheckbox selectOneRadio selectToReRender is enabled but the error message in all rich-message tags on the page disappear.

       

      Thanks for your Help.

       

      Regards,

      Max

       

      <!-- Field which shows error-Message if vlaue was not entered -->
      <h:selectOneRadio id="selectA"
        
      value ="#{controller.entity.valueA}"
        
      required="true"
        
      label="#{text['selectA.label']}"
        
      layout="pageDirection">
        
      <f:selectItem itemValue="#{true}" itemLabel="Yes" />
        
      <f:selectItem itemValue="#{false}" itemLabel="No"/>
      </h:selectOneRadio>

      <rich:message for="selectA"/>



      <!-- Field which enables selectOneRadio selectToReRender if it is checked -->
      <h:selectBooleanCheckbox id="myCheckbox"
        
      label="#{text['myCheckbox.label']}"
        
      value="#{controller.entity.valueB}"
        
      required="false">
        
      <a4j:support event="onclick" ajaxSingle="true" reRender="selectToReRender"/>
      </h:selectBooleanCheckbox>
      <rich:message for="myCheckbox"/>

      <!-- Field which is disabled until myCheckbox is checked.
        Function getSelectToReRenderDisabled() of controller checks the boolean value of controller.entity.valueB -->

      <h:selectOneRadio id="selectToReRender"
        
      value="#{controller.entity.valueC}"
        
      label="#{text['selectToReRender.label']}"
        
      layout="pageDirection"
        
      required="true"
        
      disabled="#{controller.selectToReRenderDisabled}">
        
      <f:selectItems value="#{MySelectItems.myEntitySelectItems}"
        
      var="" />
      </h:selectOneRadio>
      <rich:message for="selectToReRender"/>