3 Replies Latest reply on Jul 30, 2008 11:49 AM by Nicklas Karlsson

    Caused by: javax.el.PropertyNotWritableException: ui.xhtml @262,42 binding="bean.grid": Illegal Syntax for Set Operation

    nimo stephan Master

      I have this:



      ...
      @Name("grid")
      @Scope(EVENT)
      public class Grid
      {
          private HtmlPanelGrid htmlPanelGrid;
          private HtmlOutputLabel outputLabel;
          private HtmlSelectBooleanCheckbox selectBooleanCheckbox;
      
         // getter/setter for all components
        ....
      
      public Grid() { }
      
      public Grid(HtmlPanelGrid htmlPanelGrid, HtmlOutputLabel outputLabel, HtmlSelectBooleanCheckbox selectBooleanCheckbox) {
                      super();
                      this.htmlPanelGrid = htmlPanelGrid;
                      this.outputLabel = outputLabel;
                      this.selectBooleanCheckbox = selectBooleanCheckbox;
      
                      List<UIComponent> children = htmlPanelGrid.getChildren();
      
                      Application application = FacesContext.getCurrentInstance().getApplication();
      
                       for (int count = 0; count < 10; count++)
                        {
      
                        outputLabel = (HtmlOutputLabel) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
                        selectBooleanCheckbox = (HtmlSelectBooleanCheckbox) application.createComponent(HtmlSelectBooleanCheckbox.COMPONENT_TYPE);
                        outputLabel.setValue(" " + count + " ");
                        outputLabel.setStyle("color: blue");
                        selectBooleanCheckbox.setId("hallo"+count);
                        selectBooleanCheckbox.setLabel("hallo"+count);
      
                        children.add(outputLabel);
                        children.add(selectBooleanCheckbox);
      
              }
              }



      and this:



      @Stateful
      @Name("bean")
      @Scope(CONVERSATION)
      public class Bean implements BeanLocal {
      
      @In(required=false) @Out(required=false)
        private Grid grid;
       public void setGrid(Grid grid) {
              this.grid = grid;
        }
        public Grid getGrid() {
              return grid;
        }
      @Factory("setup") @Begin(join = true)
        public void setup()
        {
                grid = new Grid();
      ...
      
        }
      ...



      In my View, I referenced it via the binding-Attribute:



      <h:panelGrid binding="bean.grid"/>




      I get the following error:




      Caused by: javax.el.PropertyNotWritableException: /ui.xhtml @262,42 binding="bean.grid": Illegal Syntax for Set Operation
              at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:98)
              at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:237)
              ... 75 more



      I have to use the bindind to generate the UI dynamically..How can I solve that?