11 Replies Latest reply on Jun 30, 2009 12:43 AM by solstice_pan

    RowKeyVar from rich:orderingList

      Hello,

      can someone explain me, how can I get the actually Row from a rich:orderingList within an Ajax Request.

      <rich:orderingList
       value="#{glasProduktBearbeitenAction.glasList}"
       var="_glas"
       converter="#{orderListConverter}"
       rowKeyVar="rkv"
      >
      
       //and here an ajax request, try to get the Row
       // and the rowkey
       <a4j:support
       id="rowKlick"
       event="onclick"
       requestDelay="500"
       reRender="anyOtherPanel"
       action="#{doSomeActionAndGetTheRowKey}"
      </rich:orderingList>
      


        • 1. Re: RowKeyVar from rich:orderingList
          nbelaevski

          Hi,

          You should attach a4j:support not to the whole component, but to each row element (i.e. to column components).

          • 2. Re: RowKeyVar from rich:orderingList

            thanx for your reply.
            Can I get then the rowkeyvar via FacesContext, RequestContextMap ?

            • 3. Re: RowKeyVar from rich:orderingList
              nbelaevski
              • 4. Re: RowKeyVar from rich:orderingList

                you are right. What I mean is where can I get the value from

                getRequestMap
                getRequestParameterMap
                getRequestParameterValuesMap

                • 5. Re: RowKeyVar from rich:orderingList
                  nbelaevski

                  Yes.

                  • 6. Re: RowKeyVar from rich:orderingList

                    Dear Nick,

                    today I tried this.

                    <rich:orderingList
                     value="#{glasProduktBearbeitenAction.glasList}"
                     var="_glas"
                     id="orderIdTabelle"
                     rowKeyVar="rkv"
                     immediate="true"
                     converter="#{orderListConverter}"
                     listHeight="200"
                     listWidth="650"
                     rendered="#{_glasList.size > 0}"
                     selection="#{glasProduktBearbeitenAction.selectedRow}"
                     activeItem="#{glasProduktBearbeitenAction.activeItem}"
                     bottomControlLabel="nach ganz Unten"
                     downControlLabel="nach Unten schieben"
                     topControlLabel="an die Erste Stelle"
                     upControlLabel="nach Oben"
                    >
                    
                     <rich:column width="100">
                     <f:facet name="header">
                     Bezeichnung
                     </f:facet>
                     #{_glas.produktBezeichnung.bezeichnung}
                     </rich:column>
                    
                     <a4j:support
                     id="clicksupport"
                     event="onclick"
                     reRender="auswahlpanel"
                     action="#{glasProduktBearbeitenAction.ausgabe}"
                     />
                    
                    </rich:orderingList>
                    
                    


                    and in my BackingBean

                    Map<String, String> values =_externalContext.getRequestParameterMap();
                     for(Map.Entry<String, String> e : values.entrySet()){
                     log.info("Parameter - Key:[{0}], Value:[{1}]", e.getKey() , e.getValue() );
                     }
                    
                     Map<String,Object> requestMap = _externalContext.getRequestMap();
                     for(Map.Entry<String, Object> e : requestMap.entrySet()){
                     log.info("Request Parameter [{0}],[{1}]", e.getKey(), e.getValue());
                     }
                    
                     Map<String,String[]> requestValueMap = _externalContext.getRequestParameterValuesMap();
                     for(Map.Entry<String, String[]> e : requestValueMap.entrySet()){
                     for(int i = 0 ; i < e.getValue().length;i++){
                     log.info("Values Map [{0}],[{1}]", e.getKey(),e.getValue() [ i ] );
                     }
                     }
                    


                    and try to get the rowkeyVar, because i want to know which row was clicked. But i have not the rowkeyVar Parameter in the Request.

                    I also have for Test in the
                    <rich:column>
                     <f:facet name="header">
                     rowKeyVar Parameter
                     </f:facet>
                     <h:outputText value="#{rkv}" />
                    </rich:column>
                    


                    in this column i get the actually row number.

                    Do you have any hint for me ??

                    thanx
                    Peter

                    • 7. Re: RowKeyVar from rich:orderingList
                      nbelaevski

                      Hi Peter,

                      The only hint for now :)

                      "nbelaevski" wrote:
                      Hi,

                      You should attach a4j:support not to the whole component, but to each row element (i.e. to column components).


                      • 8. Re: RowKeyVar from rich:orderingList

                        i get crazy...

                        do you mean

                        
                        <a4j:support
                         event="onclick"
                         reRender="auswahlpanel"
                         action="bean.method">
                         <rich:column>
                         <f:facet name="header">
                         Bezeichnung
                         </f:facet>
                         #{backingBean.method}
                         </rich:column>
                        </a4j:support>
                        
                        
                        


                        but i also get no rkv

                        • 9. Re: RowKeyVar from rich:orderingList
                          nbelaevski

                          Try this:

                           <rich:column>
                           <f:facet name="header">
                           Bezeichnung
                           </f:facet>
                           <a4j:outputPanel>
                          
                           <a4j:support
                           event="onclick"
                           reRender="auswahlpanel"
                           action="bean.method" />
                          
                           #{backingBean.method}
                          
                           </a4j:outputPanel>
                          </rich:column>


                          • 10. Re: RowKeyVar from rich:orderingList

                            thanx a lot, it works

                            • 11. Re: RowKeyVar from rich:orderingList

                              thanx a lot, it works.

                              But I get another problem.. :-(

                              when i have 2 or more entries in the list and i click the button upControllLabel to change the order, the rownumber is not updated.
                              So for example


                              product | description | rownumber
                              java | programming language | 0
                              something | something description | 1


                              now when i click the controll label to put the entry "something" on top of the list , the rownumber is still 1 :-(

                              do you have an idea ? :-)