1 Reply Latest reply on Mar 14, 2007 11:53 AM by amitev

    Some questions about Ajax4Jsf components

    rodison

      Hi people,

      I'm confusing about some components and their attributes involving h:dataTable and a4j:repeat. This is a list of questions:

      1 - For a4j:form, what exactly is the ajaxSubmit attribute? I've seen the example in documentation that say that I need a reRender attribute together with the ajaxSubmit, right?

      Just when I have a h:dataTable or a a4j:repeat inside a form, need I to use the ajaxSubmit? Or can I use it always?

      And, if my code is this:

      <a4j:form id="helloForm" ajaxSubmit="true" reRender="myTable">
      <htm:table id="myTable">
      <htm:tbody>
      <htm:tr>
      <htm:td><t:outputText value="My Header" /></htm:td>
      </htm:tr>
      <a4j:repeat id="myRepeat" var="myRow" value="#{myBBean.data}">
      <htm:tr>
      <htm:td><t:outputText value="#{row.name}" /></htm:td>
      </htm:tr>
      </a4j:repeat>
      </htm:body>
      </htm:table>
      </a4j:form>

      Can I use in reRender attribute the value "myTable" or have I to use the value "myRepeat"?


      2 - For a4j:repeat component, what is the varState, ajaxKeys and rowKey attributes?

      Are there some code examples about the correct use of this attributes?

      In documentation there is an example of ajaxKeys component but it's hard to understand it. There are no code example of the backing bean used, just the jsps code.

      In documentation, in the "Note" section, the documentation talks about "rowKeys", "ajaxRowSet" and "ajaxKeys" but it doesn't explain them and it doesn't show how to used them in backing bean.

      Well, this is my questions, hehehe :)

      This questions is because I'm doing some tests using t:dataTables and a4j:repeat inside forms.

      Thanks for the attention.

      Best Regards,

        • 1. Re: Some questions about Ajax4Jsf components
          amitev

          Hi!

          1.
          When ajaxSubmit is true, the form is submitted with ajax request. That is useful when you submit the form with javascript code. However it's better to use the other ajax components like a4j:commandLink/commandButton or a4j:support.

          2. ajaxKeys attribute is list with the row number that will be updated from the ajax response. There is a sample project [1] with a4j:repeat where you can see the usage of ajaxKeys attribut and the source code is also there.

          [1] http://labs.jboss.com/portal/jbossajax4jsf/demo/index.html