1 Reply Latest reply on Oct 20, 2011 9:43 AM by Michael G

    How to get attributes from ui components?

    Michael G Novice

      Hello,

       

      I just started using richfaces and was wonder how i can get the attributes of a component in my bean.

       

      I have this:

       

      <rich:panelMenu styleClass="panelMenu-custom" itemMode="ajax" groupMode="ajax"
                      groupExpandedLeftIcon="triangleUp"
                      groupCollapsedLeftIcon="triangleDown"
                      topGroupExpandedRightIcon="chevronUp"
                      topGroupCollapsedRightIcon="chevronDown" itemLeftIcon="disc">
                      <rich:panelMenuGroup label="Pojects" expanded="true">
                          <rich:panelMenuItem id="proj1" label="Project 1" name="1TP445_MMSP" style="background:#D80000;color:white"/>                    
                          <rich:panelMenuGroup label="Project 2" id="proj_2">
                              <rich:panelMenuItem label="Total Tasks 145" name="task1"/>
                              <rich:panelMenuItem label="Complete    125" name="task2"/>
                              <rich:panelMenuItem label="Open        15" name="task3"/>
                              <rich:panelMenuItem label="Invalid    5" name="task4"/>                                                                                            
                          </rich:panelMenuGroup>
                          <rich:panelMenuItem id="proj3" label="Project 3" name="Proj2" style="background:green;color:white;"/>
                      </rich:panelMenuGroup>
                  </rich:panelMenu>
      

       

       

      I want to be able to pull the id and label out when i select the menu item.  I know i haven't included the actionlistener but i have one and that gets called fine.

       

      Thanks for the info.