Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2594

Facelets state saving doesn't handle well programmatic component manipulation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.0.0-beta-3
    • None
    • General
    • None
    • myfaces trunk

    Description

      Simple tests (code pasted below) outputs following results:

      1) JSP: switchs colums at every click with no problem

      2) Facelets with javax.faces.PARTIAL_STATE_SAVING=false - no visual switch

      3) Facelets with javax.faces.PARTIAL_STATE_SAVING=true switchs colums at every click with no problem

      Common code from test.jspx and test.xhtml
      ... jsp: or facelets stuff here ...
      <h:form id="form">
      <h:commandButton value="Switch columns">
      <f:actionListener binding="#

      {testBean}

      " />
      </h:commandButton>

      <h:dataTable id="table">
      <h:column>
      <f:facet name="header">
      <h:outputText value="firstName" />
      </f:facet>
      </h:column>
      <h:column>
      <f:facet name="header">
      <h:outputText value="surname" />
      </f:facet>
      </h:column>
      </h:dataTable>
      </h:form>

      @ManagedBean
      @RequestScoped
      public class TestBean implements ActionListener {
      public void processAction(ActionEvent event) throws AbortProcessingException

      { FacesContext context = FacesContext.getCurrentInstance(); UIComponent table = context.getViewRoot().findComponent("form:table"); UIComponent column1 = table.getChildren().get(0); UIComponent column2 = table.getChildren().get(1); table.getChildren().clear(); table.getChildren().add(column2); table.getChildren().add(column1); }

      }

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            markoc50 Martin Kočí
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: