3 Replies Latest reply on Jun 4, 2008 8:00 AM by ilya_shaikovsky

    OrderingList : move control button in another panel

    fguillermin

      I want to use button or call orderinglist button event outsite the orderinglist panel.

      Example :

      <h:panelGrid columns="2"">
      <h:panelGroup layout="block" >
      <h:commandButton value="UP" onclick="fireupevent();"/>
      <h:commandButton value="DOWN" onclick="firedownevent();" />
      </h:panelGroup>
      <h:panelGroup layout="block">
      <rich:orderingList id="myId" value="#{bean.values}" var="item" controlsType="none">
      <rich:column>
      <f:facet name="header">
      <h:outputText value="Value1" />
      </f:facet>
      <h:outputText value="#{item.val1"/>
      </rich:column>
      </rich:orderingList>
      </h:panelGroup>
      </h:panelGrid>

      The developer guide talk about javascript API with function like up, down, ...

      How can i call this function outside this orderinglist ?

      Thanks for your response

        • 1. Re: OrderingList : move control button in another panel
          ilya_shaikovsky

          next code (modified from livedemo) works for me ;)


          <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:a4j="http://richfaces.org/a4j"
           xmlns:rich="http://richfaces.org/rich">
           <style>
          .cent {
           text-align: center;
          }
          </style>
           <h:panelGrid columns="1">
           <h:panelGroup layout="block">
           <h:commandButton type="button" value="first" onclick="#{rich:component('ol')}.top(event)"/>
           <h:commandButton type="button" value="UP" onclick="#{rich:component('ol')}.up(event)" />
           <h:commandButton type="button" value="DOWN" onclick="#{rich:component('ol')}.down(event)" />
           <h:commandButton type="button" value="last" onclick="#{rich:component('ol')}.bottom(event)" />
           </h:panelGroup>
           <rich:orderingList value="#{library.libraryAsList}" var="lib"
           listHeight="300" listWidth="350" controlsType="none" id="ol">
           <rich:column width="180">
           <f:facet name="header">
           <h:outputText value="Song Name" />
           </f:facet>
           <h:outputText value="#{lib.title}"></h:outputText>
           </rich:column>
           <rich:column>
           <f:facet name="header">
           <h:outputText value="Artist Name" />
           </f:facet>
           <h:outputText value="#{lib.album.artist.name}"></h:outputText>
           </rich:column>
           </rich:orderingList>
           </h:panelGrid>
          </ui:composition>
          


          • 2. Re: OrderingList : move control button in another panel
            fguillermin

            Perfect, it work as espected ...
            I never see anything about this rich:component. Do you have any resource about it ?


            • 3. Re: OrderingList : move control button in another panel
              ilya_shaikovsky

              look through developer guide.