3 Replies Latest reply on Nov 3, 2008 6:32 PM by nbelaevski

    skip validation but apply values to model?

    deanhiller

      I am using a:commandButton and a table of fields. Each time you hit the button, it adds a new row with new fields to fill in. When I write text into the fields and then click the button, all my text dissappears. The button I am using is this...

      <a:commandButton id="addField" value="Add an Input Field"
       action="#{editScript.addVariable()}" reRender="variables"
       ajaxSingle="true" bypassUpdates="false" />
      


      None of my values in the table are applied. I see them being fetched though, and I see the server going through all the phases including update model values!!!...
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE RESTORE_VIEW 1
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER RESTORE_VIEW 1
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE APPLY_REQUEST_VALUES 2
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER APPLY_REQUEST_VALUES 2
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE PROCESS_VALIDATIONS 3
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER PROCESS_VALIDATIONS 3
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE UPDATE_MODEL_VALUES 4
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER UPDATE_MODEL_VALUES 4
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE INVOKE_APPLICATION 5
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER INVOKE_APPLICATION 5
      Nov 3, 2008 10:38:22 AM org.exadel.jsf.PhaseTracker beforePhase
      INFO: BEFORE RENDER_RESPONSE 6
      Nov 3, 2008 10:38:55 AM org.exadel.jsf.PhaseTracker afterPhase
      INFO: AFTER RENDER_RESPONSE 6


      Here is my table....

      <s:div id="variables">
      
       <s:div rendered="#{node.variables.size==0}">
       Currently, this question has no input fields.<br/>
       Please click Add an Input Field to add one.
       </s:div>
       <h:dataTable id="variablesTable" border="1" value="#{node.variables}"
       var="field" rendered="#{node.variables.size>0}">
       <h:column>
       <f:facet name="header">Label</f:facet>
       <!-- we should dcorate this to add error messages??? -->
       <h:inputText id="label" value="#{field.label}" required="true">
       </h:inputText>
       </h:column>
       <h:column>
       <f:facet name="header">Stored as</f:facet>
       <!-- we should dcorate this to add error messages??? -->
       <h:inputText id="name" value="#{field.name}" required="true">
       </h:inputText>
       </h:column>
       <h:column>
       <f:facet name="header">Actions</f:facet>
       <a:commandButton id="removeField" value="Remove"
       action="#{editScript.removeVariable(field)}" reRender="variables"
       ajaxSingle="true" bypassUpdates="true" />
       </h:column>
       </h:dataTable>
      </s:div>
      



      The getLabel and getName are called exactly for how many rows I have in the table but setLabel and setName are not called at all...why is this?
      thanks,
      Dean

        • 1. Re: skip validation but apply values to model?
          deanhiller

          well, I am not even sure how I fixed it. It had something to do with the a:region and I don't really understand how, but I got the values to stick

          Now if only my remove button worked(I changed it to byPassUpdates=false)
          but now when I remove from a list of aaa, bbb, ccc and remove bbb, it
          does not work. bbbb is removed from the list of beans but in the GUI
          it displays aaa and ccc even though I see seam framework reading out
          the values of aaa and ccc from the list, not sure what is going on here.

          • 2. Re: skip validation but apply values to model?
            deanhiller

            I have no clue why but I needed ajaxSingle=false

            Man, I feel like I am shooting in the dark here on fixing this stuff.
            I just don't understand it well enough.

            • 3. Re: skip validation but apply values to model?
              nbelaevski

              Hello,

              Try to use process attribute. It should point to the list of ids of components (data formats are the same as reRender accepts) that should be handled together with that ajaxSingle component.