1 2 Previous Next 15 Replies Latest reply on Mar 26, 2010 5:00 PM by shadowcreeper

    Rich Columns and ajaxKeys

    Matt Choate Newbie

      Hello,

       

      We have a rich datatable that uses the rich:columns tag to create a table with a dynamic column set. Inside of the dynamic columns we would like to have controls that will cause a single row to be rerendered. To accomplish this we are using the ajaxKeys attribute on the datatable and setting appropriately on the actions handlers. Everything seems to be hooked up properly but our rows don't re-render.  My questionis are there any known issues for using ajaxKeys in a table that contains dynamic columns? We are using 3.3.2CR1. Oh and if I move the control out of a dynamic column then the row re-renderd as expected.

       

      -matt

        • 1. Re: Rich Columns and ajaxKeys
          Nick Belaevski Master

          Hi Matt,

           

          Can you please post page code?

           

          BTW, why use CR1 when SR1 has already been released?

           

          Message was edited by: Nick Belaevski

          • 2. Re: Rich Columns and ajaxKeys
            Matt Choate Newbie

            Hello Nick.

             

            Actually I am seeing something pretty strange. Here is a stripped down code snipped from our code:

             

            {code}

            <rich:columns var="displaycolumn" value="#{myListCriteriaController.myListResultColumns}">



            <f:facet name="header">
               <h:outputText value="#{displaycolumn.columnHeader}"/>
            </f:facet>


            <%-- String Value --%>


            <h:panelGroup rendered="#{row.cells[displaycolumn.columnIndex].isBasicStringFormat || row.cells[displaycolumn.columnIndex].isEmailStringFormat >


                <h:inputText id="textEditControl" value="#{row.cells[displaycolumn.columnIndex].value}" />


                <h:outputText value="#{rich:findComponent('textEditControl').value}"></h:outputText>


            </h:panelGroup>

             

            </rich:columns>

            {code}

             

            Basically this code will create 1 to N columns with a text box in the column. Then I added an outputText field just to dump back out the text value for that column. What I am seeing is that the outputText always outputs the text for the first column even though the input text is correct for that column.  Is there an issue with using rich:findComponent or rich:clientId in a rich:columns tag?

             

            -matt

            • 3. Re: Rich Columns and ajaxKeys
              Ilya Shaikovsky Master
              actually rich:* functions looks through all the viewRoot and returns the first component found with passed client id. So it will be always the first component for this case (many inputs in iteration component with the same id.)
              • 4. Re: Rich Columns and ajaxKeys
                Matt Choate Newbie

                Are there any options to accomplish what  I was trying to do with the rich:* functions?

                 

                -matt

                • 5. Re: Rich Columns and ajaxKeys
                  v c Newbie

                  instead of using generic names like this:

                   

                  id="textEditControl"

                   

                  try individualizing them:

                  id="textEditControl#{rowIndex}-#{columnIndex}"

                   

                  -v

                  • 6. Re: Rich Columns and ajaxKeys
                    Matt Choate Newbie

                    I don't think id's can have an expression in them. Thanks for the suggestion though.

                     

                    -matt

                    • 7. Re: Rich Columns and ajaxKeys
                      v c Newbie
                      it works for me... thx for not even trying >_<
                      • 8. Re: Rich Columns and ajaxKeys
                        Matt Choate Newbie

                        I did try and got an exception saying expression are not allowed in the id attribute. Here is the code I tested:

                         

                            <h:inputText id="textEditContro#{rowIndex}" value="#{bean.value}" />

                         

                        If you have a working example pass it along.

                         

                        -matt

                        • 9. Re: Rich Columns and ajaxKeys
                          v c Newbie

                          this works fine for me:

                           

                          <h:inputText id="helloField-#{1}" value="hello" />
                          

                           

                          generates this HTML:

                           

                          <input type="text" value="hello" name="j_id19:helloField-1" id="j_id19:helloField-1"/>
                          

                           

                          i'm using 3.3.2.SR1, what version do you have?

                          • 10. Re: Rich Columns and ajaxKeys
                            Matt Choate Newbie

                            I am on the same. My page declares like this:

                             

                            <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
                            <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
                            <%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
                            <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

                             

                            Do you see anything wrong with that?

                            • 11. Re: Rich Columns and ajaxKeys
                              v c Newbie
                              please post your exception stacktrace saying "expression not allowed in id attribute"...
                              • 12. Re: Rich Columns and ajaxKeys
                                Matt Choate Newbie
                                org.apache.jasper.JasperException: /test-create.jsp(1066,1) According to TLD or attribute directive in tag file, attribute id does not accept any expressions
                                    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
                                    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
                                    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
                                    at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1120)
                                    at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:820)
                                    at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
                                    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2359)
                                    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2409)
                                    at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:839)
                                    at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
                                    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2359)
                                    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2409)
                                    at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:839)
                                    at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
                                    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2359)
                                    at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2409)
                                    at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2415)
                                    at org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
                                    at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2359)
                                    at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1735)
                                    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:184)
                                    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
                                    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
                                    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
                                    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
                                    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
                                    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
                                    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
                                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
                                    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
                                    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
                                    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
                                    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
                                    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
                                    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
                                    at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
                                    at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
                                    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
                                    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                                    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                                    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                                    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
                                    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at com.salesgene.common.filters.UserSessionFilter.doProcessing(UserSessionFilter.java:382)
                                    at com.salesgene.common.filters.UserSessionFilter.doFilter(UserSessionFilter.java:188)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at com.salesgene.common.filters.LandslideContextFilter.doFilter(LandslideContextFilter.java:91)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
                                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                                    at java.lang.Thread.run(Unknown Source)
                                • 13. Re: Rich Columns and ajaxKeys
                                  shadowcreeper Apprentice
                                  Using Facelets, EL is valid (almost) everywhere. Using only plain JSF, it is illegal to put EL in some attributes ("id" is one of those attributes).
                                  • 14. Re: Rich Columns and ajaxKeys
                                    Eugene Bessel Newbie

                                    hello shadow,

                                     

                                    I also have the same problem.

                                     

                                    I use JSF 1.2 and Richfaces 3.3.2 CR1.

                                     

                                    my code is like this:

                                    <rich:extendedDataTable value="#{searchModul.columnData}" var="data" width="500px" height="100px" sortMode="single" selectionMode="multi" >
                                                 <f:facet name="header">
                                                     <h:outputText value="#{searchModul.tableHeader}"></h:outputText>
                                                 </f:facet>
                                                <rich:columns id="#{data[ind]}" value="#{searchModul.columns}" var="col" index="ind" sortBy="#{data[ind]}">
                                                 <f:facet name="header"> 
                                                     <h:outputText value="#{col}"/> 
                                                 </f:facet> 
                                                 <h:outputText value="#{data[ind]}"></h:outputText>
                                                </rich:columns>
                                           
                                                </rich:extendedDataTable>

                                    what should I use, that the Exception doesn't occurs???

                                    sorry, but I didnt understand your answer.

                                    1 2 Previous Next