1 2 Previous Next 26 Replies Latest reply on Jun 9, 2010 6:59 AM by zsom Go to original post
      • 15. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
        bpons

         

        "SergeySmirnov" wrote:
        <h:form>
         <h:inputText value="#{2==2}" />
        </h:form>



        Well sure this works... just like
        <h:inputText value="${2==2}" />
        


        I must be missing something...
        what's the point?


        • 16. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
          opr

          @Sergej

          I understand this issue, but if I use an expression to write into - a session scoped value - it does not maintain the expanded value

          • 17. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
            opr

            and btw

            expanded = "true"

            works. Only if I use EL expression something goes wrong.

            • 18. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from

               

              "sintaxeror" wrote:

              Well sure this works... just like
              <h:inputText value="${2==2}" />
              


              I must be missing something...
              what's the point?


              This was exactly the point; To check how the standard component with read/write attribute works with EL.

              Result.
              The deferral EL like "#{2==2}" are failed.
              The immediate EL like "${2==2}" works

              So, reopen the issue with note that it should work with immediate EL. Refer to this forum post.

              • 19. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
                bpons

                 

                "SergeySmirnov" wrote:
                "sintaxeror" wrote:

                Well sure this works... just like
                <h:inputText value="${2==2}" />
                


                I must be missing something...
                what's the point?


                This was exactly the point; To check how the standard component with read/write attribute works with EL.

                Result.
                The deferral EL like "#{2==2}" are failed.
                The immediate EL like "${2==2}" works

                So, reopen the issue with note that it should work with immediate EL. Refer to this forum post.


                Sergey,

                I'm not quite sure i understand, since both fails for me with the expanded attribute of the panelMenuGroup, and both works for me with <h:inputText>,
                anyway, i'll reopen the issue as you said...

                • 20. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
                  bpons

                  BTW,

                  I wonder if all would not be simpler if you just assume that when selectedChild attribute of the panelMenu is set, then the developper certainly wish that the corresponding panelMenuGroup (and his possible parents) is/are expanded....

                  • 21. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
                    opr

                    Finally I created the following workarround:

                    1) Store the expand/collapse information for every PanelMenuGroup in a session scoped bean

                    2) Patch org.richfaces.component.UIPanelMenuGroup.java by reimplementing the setter and getter for the "expanded"-Attribute in the following way:

                    public boolean isExpanded(){
                     SessionBean sb = (SessionBean)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("sessionBean");
                     return sb.getExpansionMap().get(this.getId()).booleanValue();
                     }
                    
                    public void setExpanded(boolean expanded){
                     SessionBean sb = (SessionBean)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("sessionBean");
                     setValue(sb.getExpansionMap().get(this.getId()).booleanValue());
                     }
                    
                    


                    My Session Bean contains

                    private HashMap<String, Boolean> expansionMap = new HashMap<String, Boolean>();
                    
                     public SessionBean()
                     {
                     expansionMap.put("pg1", new Boolean(false));
                     expansionMap.put("pg2", new Boolean(false));
                     expansionMap.put("pg3", new Boolean(false));
                     expansionMap.put("pg4", new Boolean(false));
                     expansionMap.put("pg5", new Boolean(false));
                     expansionMap.put("pg6", new Boolean(false));
                     expansionMap.put("pg7", new Boolean(false));
                     expansionMap.put("pg8", new Boolean(false));
                     expansionMap.put("pg9", new Boolean(false));
                     expansionMap.put("pg10", new Boolean(false));
                     expansionMap.put("pg11", new Boolean(false));
                    
                     }
                    


                    In the action method the boolean values are toggled in the following way:

                    
                     public void menuAction(ActionEvent ae)
                     {
                     if (ae.getComponent().getId().equals("pg1"))
                     expansionMap.put("pg1", new Boolean(!expansionMap.get("pg1").booleanValue()));
                     if (ae.getComponent().getId().equals("pg2"))
                     expansionMap.put("pg2", new Boolean(!expansionMap.get("pg2").booleanValue()));
                     if (ae.getComponent().getId().equals("pg3"))
                     expansionMap.put("pg3", new Boolean(!expansionMap.get("pg3").booleanValue()));
                     if (ae.getComponent().getId().equals("pg4"))
                     expansionMap.put("pg4", new Boolean(!expansionMap.get("pg4").booleanValue()));
                     if (ae.getComponent().getId().equals("pg5"))
                     expansionMap.put("pg5", new Boolean(!expansionMap.get("pg5").booleanValue()));
                     if (ae.getComponent().getId().equals("pg6"))
                     expansionMap.put("pg6", new Boolean(!expansionMap.get("pg6").booleanValue()));
                     if (ae.getComponent().getId().equals("pg7"))
                     expansionMap.put("pg7", new Boolean(!expansionMap.get("pg7").booleanValue()));
                     if (ae.getComponent().getId().equals("pg8"))
                     expansionMap.put("pg8", new Boolean(!expansionMap.get("pg8").booleanValue()));
                     if (ae.getComponent().getId().equals("pg9"))
                     expansionMap.put("pg9", new Boolean(!expansionMap.get("pg9").booleanValue()));
                     if (ae.getComponent().getId().equals("pg10"))
                     expansionMap.put("pg10", new Boolean(!expansionMap.get("pg10").booleanValue()));
                     if (ae.getComponent().getId().equals("pg11"))
                     expansionMap.put("pg11", new Boolean(!expansionMap.get("pg11").booleanValue()));
                     }
                    


                    Dirty, but works....

                    • 22. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
                      nbelaevski

                      Hello,

                      I've created RFC: http://jira.jboss.com/jira/browse/RF-2957 for autoexpansion attribute.

                      BTW, I've tried

                      <h:inputText value="${2 == 2}" />
                      and got:
                      03.04.2008 17:04:38 javax.faces.component.UIInput updateModel
                      SEVERE: /pages/test1.xhtml @14,36 value="${2 == 2}": Illegal Syntax for Set Operation
                      03.04.2008 17:04:38 com.sun.faces.lifecycle.RenderResponsePhase execute
                      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
                      sourceId=j_id0:j_id1[severity=(ERROR 2), summary=(/pages/test1.xhtml @14,36 value="${2 == 2}": Illegal Syntax for Set Operation), detail=(/pages/test1.xhtml @14,36 value="${2 == 2}": Illegal Syntax for Set Operation)]
                      so that still doesn't work well. Submit form to see the messages



                      • 23. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from
                        bpons

                        Thx about the feature request, that's pretty cool.

                        • 24. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from 3.1.

                          Hi!

                           

                          Can anyone confirm that this issue is now working properly? I ran into it using version 3.3.3.FINAL, but the issue on jira has been closed.

                          • 25. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from 3.1.
                            ilya_shaikovsky
                            • 26. Re: seam 2.0 - problem upgrading to richfaces 3.2.0 GA from 3.1.

                              Oh sorry that's not what I meant. I'm still having problems with EL expressions in the expanded property of the menugroup. The error message is the same as the one in the OP.

                              1 2 Previous Next