2 Replies Latest reply on Mar 19, 2007 12:32 PM by lectrix

    reRendered outputpanel with input fields does not submit val

    lectrix

      hello everybody,
      i just signed in here and i'm quite new to a4j but actually i thaught i understood the basics (i rtfm).

      so here is my problem i can't get solved by myself:

      i am using a outputpanel with some inpuText fields that are only rendered under a certain condition (boolean customerNoteEntryBean.reminder). This condition is toggled by a checkbox on change. so this is the workflow:
      1. click on the checkbox
      2. call an action which sets the new condition (customerNoteEntryBean.reminderChanged)
      3. rerender the outputpanel "ReminderPanel" and display/hide the input fields according to the condition.

      so far so good. displaying and hiding the input fields works fine! But when the fields are displayed and i fill them in and submit the whole form, the values are not populated to the corresponding managed bean. they are left empty. All other field (e.g. the inputTextarea above, that is always displayed) are submitted correctly.

      also, if i do not use the ajax rerendering at all, the values are sent as expected.

      Here is the code. Thanks for any help in advance!

      stefan.

      <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a"%>
      
      <%@ taglib uri="HWTagLib" prefix="hw" %>
      
      <%@ page import="at.symbion.i18n.LocaleLang" %>
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      .
      .
      .
      <f:view>
      ...
      <h:form id="customer" enctype="multipart/form-data">
      ...
      
      <h:panelGrid columns="1">
      
       <h:inputTextarea value="#{customerNoteEntryBean.noteText}" rows="2" cols="80">
       </h:inputTextarea>
      
       <h:panelGroup>
       <t:commandButton value="#{localeLang.langEnt['TP_0028']}" action="#{customerNoteEntryBean.commitNote}"/>
      
       <h:selectBooleanCheckbox id="isReminder" value="#{customerNoteEntryBean.reminder}">
       <a:support event="onchange" action="#{customerNoteEntryBean.reminderChanged}" reRender="ReminderPanel" />
       </h:selectBooleanCheckbox>
      
       <h:message for="isReminder"/>
      
       <a:outputPanel ajaxRendered="true" id="ReminderPanel">
       <h:inputText id="reminderEmail" value="#{customerNoteEntryBean.remindEmail}" rendered="#{customerNoteEntryBean.reminder}" />
      
       <t:inputText id="remindDateStr" value="#{customerNoteEntryBean.remindDateStr}" rendered="#{customerNoteEntryBean.reminder}" />
      
       <h:message for="remindDateStr"/>
      
       <t:inputText id="dummy" value="#{customerBean.dummy}" rendered="#{customerNoteEntryBean.reminder}"/>
       </a:outputPanel>
      
       <t:inputHidden id="customerId" value="#{customerBean.id}"/>
       </h:panelGroup>
      
       </h:panelGrid>
      .
      .
      .
      </h:form>
      ...
      </f:view>
      ...
      </html>