14 Replies Latest reply on Sep 22, 2007 1:11 PM by maksimkaszynski

    Everything I do I do it wrong...

    ratoo

      Hello!

      I'm almost gave up trying to make something work... :-(

      It looks like nothing works inside repeat tag.
      Being not able to make simpleTogglePanel work I switched to togglePanel and again no luck. It works with switchType="client" but I want AJAX!!! :-)

      P.S. Congrats with 3.1

      <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
      
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
      
      <html>
       <f:view>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>Test</title>
       </head>
       <body>
       <h:form enctype="multipart/form-data">
      
       <a4j:outputPanel id="repeater">
       <table id="table" cellspacing="0" cellpadding="0" style="width: 100%; padding: 4px 4px 4px 4px; border: 0px solid transparent">
       <a4j:repeat
       value="#{TestBean.rows}"
       var="row">
      
       <tr style="width: 100%">
       <td>
       <rich:togglePanel
       id="tgl"
       initialState="closed"
       switchType="ajax"
       stateOrder="closed, opened">
      
       <f:facet name="closed">
       <rich:toggleControl>
       <h:outputText value="blah blah"/>
       </rich:toggleControl>
       </f:facet>
      
       <f:facet name="opened">
       <a4j:outputPanel id="multy_table">
      
       <rich:toggleControl>
       <h:outputText value="close"/>
       </rich:toggleControl>
      
       <h:outputText value="oops!!!"/>
       </a4j:outputPanel>
      
       </f:facet>
       </rich:togglePanel>
      
       </td>
       </tr>
       </a4j:repeat>
       </table>
       <a4j:log hotkey="M" />
       <h:messages/>
       </a4j:outputPanel>
       </h:form>
       <body>
       </f:view>
      </html>
      


        • 1. Re: Everything I do I do it wrong...

          Oh. Ok, I see. I can agree with the subject.
          First, move <a4j:log> down, outside of the a4j:outputPanel you are going to re-render in the future.

          What the jsf implementation you use? It should be JSF 1.2 or, at least, facelets to have some code.

          • 2. Re: Everything I do I do it wrong...
            ratoo

            Hi!
            God! Someone alive (and not full with vodka after 3.1 :-))

            Yes I use JBoss 4.2 JSF 1.2
            Log I put after all to see what happens...

            By the way even "client" works the tables I put inside are synchronized... :-(

            All I wanna do is to have a repeater with something "shrinkable" better with ajax, because inside I could have a table with 1000 elements I don't want to get it all at a time, only descriptions... may be I do it wrong in a first place - I'm still thinking in a usual gui manner (with all those threads and asynchrony).

            I tried to look into the code, but got crazy with all those id you calculate dynamically... :-(

            Cheers. (and happy programmers' day :-))

            • 3. Re: Everything I do I do it wrong...
              ratoo

              Yeah!
              I just got the joke.
              You agree with the subject of post, but not with the idea that some components inside <a4j:repeat> doesn't work properly... ;-)
              May it be because I use html and not xhtml and tidy got grazy?

              Spasibo.

              • 4. Re: Everything I do I do it wrong...
                nbelaevski

                Hello!

                Thank you for reporting this issue and extra thanks for the good wishes :)! We'll check: http://jira.jboss.com/jira/browse/RF-935

                • 5. Re: Everything I do I do it wrong...
                  pete.b.

                  Hi!

                  I have a related problem:
                  <a4j:commandButton>-AJAX-requests also fail within <a4j:repeat> (and even within <ui:repeat> and <rich:dataGrid>). Only the repeater component itsself gets refresht (i.e. the collection within the value attribute gets reloaded).

                  • 6. Re: Everything I do I do it wrong...

                    did you look at richfaces-demo's samples where the form element inside the iteration components are shown?

                    • 7. Re: Everything I do I do it wrong...
                      pete.b.

                      Yes, and mine <h:form>s also stay outside <ui:repeat>.

                      This does function:

                      <h:form>
                       <a4j:commandButton styleClass="cartbutton"
                       action="#{cart.add}"
                       reRender="cartAmount,cartTotal" />
                       </h:form>


                      And those do not function:
                      <h:form>
                       <ui:repeat value="#{products}" var="item">
                       <a4j:commandButton styleClass="cartbutton"
                       action="#{cart.add}"
                       reRender="cartAmount,cartTotal" />
                       </ui:repeat>
                       </h:form>


                      <h:form>
                       <a4j:repeat value="#{products}" var="item">
                       <a4j:commandButton styleClass="cartbutton"
                       action="#{cart.add}"
                       reRender="cartAmount,cartTotal" />
                       </a4j:repeat>
                       </h:form>


                      <h:form>
                       <rich:dataGrid value="#{products}" var="item">
                       <a4j:commandButton styleClass="cartbutton"
                       action="#{cart.add}"
                       reRender="cartAmount,cartTotal" />
                       </rich:dataGrid>
                       </h:form>


                      Putting the form tags inside the accordant iteration tags does not change the situation.

                      • 8. Re: Everything I do I do it wrong...

                        let's understand where is "do not function" starts. When you use <a4j:log /> what it says about re-rendered areas?

                        • 9. Re: Everything I do I do it wrong...
                          pete.b.

                          My #{cart.add} method gets not called and the AJAX4JSF logger spits out:

                          debug[23:40:52,671]: Have Event [object Object] with properties: target: [object HTMLInputElement], srcElement: undefined, type: click
                          debug[23:40:52,671]: NEW AJAX REQUEST !!! with form :j_id54
                          debug[23:40:52,671]: Append hidden control j_id54 with value [j_id54] and value attribute [j_id54]
                          debug[23:40:52,671]: Append hidden control javax.faces.ViewState with value [H4...=] and value attribute [H4...=]
                          debug[23:40:52,671]: parameter j_id54:j_id55:0:j_id56 with value j_id54:j_id55:0:j_id56
                          debug[23:40:52,671]: Start XmlHttpRequest
                          debug[23:40:52,671]: Reqest state : 1
                          debug[23:40:52,671]: QueryString: AJAXREQUEST=_viewRoot&j_id54=j_id54&javax.faces.ViewState=H4...
                          debug[23:40:52,671]: Reqest state : 1
                          debug[23:40:53,359]: Reqest state : 2
                          debug[23:40:53,359]: Reqest state : 3
                          debug[23:40:53,359]: Reqest state : 3
                          debug[23:40:53,359]: Reqest state : 4
                          debug[23:40:53,359]: Reqest end with state 4
                          debug[23:40:53,359]: Response with content-type: text/xml;charset=UTF-8
                          debug[23:40:53,359]: Full response content: <?xml version="1.0"?>

                          <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link type="text/css" rel="stylesheet" href="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/css/dragIndicator.xcss/DATB/eAELvfwiAQAGAQJx.seam" /><link type="text/css" rel="stylesheet" href="/xcitesoft-webshop/a4j_3_1_0css/tree.xcss/DATB/eAELvfwiAQAGAQJx.seam" /><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org.ajax4jsf.javascript.PrototypeScript.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/json/json-mini.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org.ajax4jsf.javascript.DnDScript.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/utils.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/json/json-dom.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/dnd/dnd-common.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org.ajax4jsf.javascript.AjaxScript.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/ajax4jsf/javascript/scripts/form.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/form.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/events.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/tree.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/tree-selection.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/tree-item.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/tree-item-dnd.js.seam">

                          </script><script type="text/javascript" src="/xcitesoft-webshop/a4j_3_1_0org/richfaces/renderkit/html/scripts/drag-indicator.js.seam">

                          </script></head><body><div xmlns:rich="http://richfaces.ajax4jsf.org/rich"></div><meta name="Ajax-Update-Ids" content="" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="H4sIAAAAAAAAANVafWwcxRWfu8TOp4MhKHICoRs7BIKSO5/v7Ltz+IhNSHLkbNLYJG2omuztzt1tvLe77M7a50RBQEWRSlWoWlBVRQK1kapK6T9U/QSpFLeqhESrIlWq+IuiSlWrfkgIiULVj3mzH7N73nN8W3IR94e9uzNv5r3fe/Pemzdz5W+oxzLRuG7WUuI5sZk7Z1VTomGoiiQSRddSE/TjDBEJnhI1sYbN3bMmxjPEtIlt4mldxk8++49vLFVv/+ZmhJrGeYTWIjQUGk3SG4auYY2wsU4qeOGErhO04cy89+j8bkU7gO5cRbeslIXFRspWUkdJQy0r2hzqOXdGkUfcrgm095w4LzZTVVHCVmCGOu3OaB6yiWGTWdwkDmUWeb+rTjIae5Kx1U9SiD1JcVWT9ELXTCbOLA7pSAfT5OJPM+pP0zFpfvUcjsQyHId0dZbj9I1lOg7p6mzH6RvLeBzSDqwnG9d6mBOg9B2YUDa+CWXjm1A2H5s0x81i6Cqkh3Wz4RJx+7gdEDEVqd6WDPysSzbGwVkVGbhllzTPSTuVsBAbnNGRGOCMchMYoh1Tlq0xMhWTIOXDpRPYwKI3E0c00ybo+FNB9LlfbzRETZ60CdE1dwi+8trFLTYEkJf1mksU33JGi3FIN0qiSSYauq2ROOQbgHxWJ6Iam+98xie96nLOZxF1AskrcW0vn+tgrsDq6HSaDkJIvhh7msLw6qcpxI9UhQ4iVSF+pCp0EKkK8SNVoYNIVYyf5xR9V9W0TbT1kTLQp1RRq6UeqpzDEjnw3K8/82K/tVdNQn5L+yXtR9F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nS7ys4Co2ba0GWWjaqisGzUEJbZWxqsxjc7EblXdH0hw/ZMqzjPT9CEUMvP5KG/67qJMsP+/LQ5aV+HdMnQwcXbpsV5UaeGiCVZVg4bAp1tgB08Z0VXy0e+hn+SlrHqJhcl0E+r0U/cMTn+4m1iP8aDsPQTDZHxNrOB6u4QacZQtHsCXVly5XiVXBkHtS+3ExF2uV7mGe4fcJCsMg2442mE8cmewm5sP8QKcAe9bkUEzMNx2iG3iNYm2T83CDI22YyjxN/LsHcbXKRQH3mdwfAfEWCnGQ0y5CHbhnVoCdZnIsJtQb6FYENiV2gwGt0DdFI90DGvNktQAyJA9GAA3n05zPLsIcuHhWgDJQshQT5r5TiiksvVphmbMFIqXFim53EWipwkVhDnEmAuitFOilS8AlLyV1E2+JH1cXIalKfi4m3mNHxQrdjVgKFjRdqrvh8T44fadbHWiaUdjuR5ChmXr3Kt2v7GJrQNJpJiN1UTUir6kVmd+sRqhmI1XNMeBsjkRp5H84SKXF6TwAAA==" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
                          debug[23:40:53,359]: Header Ajax-Expired not found, search in <meta>
                          debug[23:40:53,359]: search for elements by name 'meta' in element #document
                          debug[23:40:53,359]: getElementsByTagName found 2
                          debug[23:40:53,359]: Find <meta name='Ajax-Update-Ids' content=''>
                          debug[23:40:53,359]: Find <meta name='Ajax-Response' content='true'>
                          debug[23:40:53,359]: Header Ajax-Update-Ids not found, search in <meta>
                          debug[23:40:53,359]: search for elements by name 'meta' in element #document
                          debug[23:40:53,359]: getElementsByTagName found 2
                          debug[23:40:53,375]: Find <meta name='Ajax-Update-Ids' content=''>
                          warn[23:40:53,375]: No information in response about elements to replace
                          debug[23:40:53,375]: call getElementById for id= ajax-view-state
                          debug[23:40:53,375]: Hidden JSF state fields: [object HTMLSpanElement]
                          debug[23:40:53,375]: Namespace for hidden view-state input fields is undefined
                          debug[23:40:53,375]: search for elements by name 'input' in element span
                          debug[23:40:53,375]: getElementsByTagName found 1
                          debug[23:40:53,375]: Replace value for inputs: 24 by new values: 1
                          debug[23:40:53,375]: Input in response: javax.faces.ViewState
                          debug[23:40:53,375]: Found same input on page with type: hidden
                          debug[23:40:53,375]: Found same input on page with type: hidden
                          debug[23:40:53,375]: search for elements by name 'INPUT' in element span
                          debug[23:40:53,375]: getElementsByTagName found 0
                          debug[23:40:53,375]: Replace value for inputs: 24 by new values: 0
                          debug[23:40:53,375]: call getElementById for id= _A4J.AJAX.focus
                          debug[23:40:53,375]: No focus information in response
                          debug[23:40:53,375]: call getElementById for id= org.ajax4jsf.oncomplete


                          • 10. Re: Everything I do I do it wrong...
                            ilya_shaikovsky

                            Lets choose a simpliest way. Reduce your code to minimal non working one. And put there all the snippets (do not cut nothing). Also provide precise environment info. So, we'll be able to create an example.

                            Thanks.

                            • 11. Re: Everything I do I do it wrong...
                              pete.b.

                              Ok, three days later and i've got it: Using the org.jboss.seam.annotations.datamodel.DataModel annotation for the iteration model (in my case an java.util.List object) causes a suppression of the action method call! I don't know why. I simply replaced the @DataModel with the @Out annotation within the seam component class providing the collection.

                              May i post the example i've created including all xml descriptors, jar files, classes and pages?

                              • 12. Re: Everything I do I do it wrong...
                                maksimkaszynski

                                Of course!

                                • 13. Re: Everything I do I do it wrong...
                                  pete.b.

                                  Hi,

                                  after all the problem was not the DataModel annotation i have blamed at first. It was the scope of the component containing the action method.

                                  Here is my (deficient) code:

                                  home.xhtml

                                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                  <html xmlns="http://www.w3.org/1999/xhtml"
                                   xmlns:h="http://java.sun.com/jsf/html"
                                   xmlns:f="http://java.sun.com/jsf/core"
                                   xmlns:ui="http://java.sun.com/jsf/facelets"
                                   xmlns:s="http://jboss.com/products/seam/taglib"
                                   xmlns:rich="http://richfaces.ajax4jsf.org/rich"
                                   xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
                                  <head>
                                   <title>Iteration Example</title>
                                   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
                                  </head>
                                  
                                  <body>
                                   <h:form>
                                   <ui:repeat value="#{list}" var="item">
                                   <a4j:commandButton action="#{bean.increaseNumber}"
                                   value="Increase Number"
                                   reRender="number" />
                                   </ui:repeat>
                                   </h:form>
                                   <h:outputText id="number" value="Number: #{bean.number}" />
                                  </body>
                                  </html>


                                  Action component
                                  package org.domain.IterationExample;
                                  
                                  import java.util.ArrayList;
                                  import java.util.List;
                                  
                                  import org.jboss.seam.ScopeType;
                                  import org.jboss.seam.annotations.Name;
                                  import org.jboss.seam.annotations.Out;
                                  import org.jboss.seam.annotations.Scope;
                                  import org.jboss.seam.annotations.datamodel.DataModel;
                                  
                                  @Scope(ScopeType.CONVERSATION)
                                  @Name("bean")
                                  public class IEBean
                                  {
                                   Integer number;
                                  
                                   @DataModel List<String> list;
                                  
                                   public IEBean()
                                   {
                                   number = 0;
                                   list = new ArrayList<String>();
                                   list.add("");
                                   list.add("");
                                   list.add("");
                                   }
                                  
                                   public void increaseNumber()
                                   {
                                   number += 1;
                                   }
                                  
                                   public Integer getNumber()
                                   {
                                   return number;
                                   }
                                  
                                   public void setNumber(Integer number)
                                   {
                                   this.number = number;
                                   }
                                  }


                                  So if you switch the scope of the IEBean to SESSION the list gets displayed and you can use the buttons. Otherwise not.

                                  Regards,
                                  Pete


                                  • 14. Re: Everything I do I do it wrong...
                                    maksimkaszynski

                                    I don't think that repeat component, or a4j:command button know anything about the scope. Nor do they care about difference between session and conversation. I'll look into it.