4 Replies Latest reply on Jan 9, 2010 4:49 PM by bashan

    commandLink inside a dataList not working

    bashan

      Hi,


      I am trying to do a very simple thing with not luck:
      This is a loop showing some table of comments. Each comment can be deleted:


        <a4j:outputPanel id="listComments">
                <rich:dataList value="#{photoShow.comments}" var="thisComment">
                          <a4j:commandLink onclick="if (!confirm('Really delete comment?')) { return false; }"
                               action="#{photoShow.deleteComment(thisComment.commentId)}" rendered="#{user.userId == thisComment.user.userId}"
                                  reRender="listComments" ajaxSingle="true" >
                            <h:graphicImage value="/images/trash.png" styleClass="trash" />
                          </a4j:commandLink>
                </rich:dataList>
               </a4j:outputPanel>



      When pressing the selete, the comment is deleted, but the list is not refreshed.


      Anyone has an idea?

        • 1. Re: commandLink inside a dataList not working
          kapitanpetko

          Remove ajaxSingle.

          • 2. Re: commandLink inside a dataList not working
            bashan

            the ajaxSingle was one of my tryings...  it is not working without it either...

            • 3. Re: commandLink inside a dataList not working
              amitev

              Put a4j:log to see what exactly happens.

              • 4. Re: commandLink inside a dataList not working
                bashan

                Hi,


                I add a a4j:log. Frankly, I don't understand much of the mess that is going there... from what I saw it all seems to be fine. can you pls have a look and tell me if you see something wrong (I copied only what seems to be relevant...):



                debug[17:40:49,281]: Header Ajax-Expired not found, search in <meta>
                debug[17:40:49,281]: search for elements by name 'meta' in element #document
                debug[17:40:49,281]: Find <meta name='Ajax-Update-Ids' content='formShow:listComments'>
                debug[17:40:49,282]: Find <meta name='Ajax-Response' content='true'>
                debug[17:40:49,282]: Header Ajax-Update-Ids not found, search in <meta>
                debug[17:40:49,282]: search for elements by name 'meta' in element #document
                debug[17:40:49,282]: Find <meta name='Ajax-Update-Ids' content='formShow:listComments'>
                debug[17:40:49,282]: Update page by list of rendered areas from response formShow:listComments
                debug[17:40:49,282]: search for elements by name 'script' in element #document
                debug[17:40:49,282]: <script> in response with src=/a4j/g/3_3_2.SR1org.ajax4jsf.javascript.AjaxScript
                debug[17:40:49,283]: Such element exist in document
                debug[17:40:49,283]: <script> in response with src=/a4j/g/3_3_2.SR1org/ajax4jsf/javascript/scripts/form.js
                debug[17:40:49,283]: Such element exist in document
                debug[17:40:49,283]: search for elements by name 'link' in element #document
                debug[17:40:49,284]: call getElementById for id= org.ajax4jsf.queue_script
                debug[17:40:49,284]: Update page part from call parameter for ID formShow:listComments
                debug[17:40:49,284]: call getElementById for id= formShow:listComments
                debug[17:40:49,302]: Replace content of node by replaceChild()
                debug[17:40:49,303]: search for elements by name 'script' in element span
                debug[17:40:49,304]: Scripts in updated part count : 0
                debug[17:40:49,304]: call getElementById for id= org.ajax4jsf.oncomplete
                debug[17:40:49,304]: Processing updates finished, no oncomplete function to call
                debug[17:40:49,304]: Update part of page for Id: formShow:listComments successful
                debug[17:40:49,304]: call getElementById for id= ajax-view-state
                debug[17:40:49,304]: Hidden JSF state fields: [object HTMLSpanElement]
                debug[17:40:49,304]: Namespace for hidden view-state input fields is undefined
                debug[17:40:49,305]: search for elements by name 'input' in element span
                debug[17:40:49,305]: Replace value for inputs: 23 by new values: 1
                debug[17:40:49,305]: Input in response: javax.faces.ViewState
                debug[17:40:49,305]: Found same input on page with type: hidden
                debug[17:40:49,305]: Found same input on page with type: hidden
                debug[17:40:49,305]: Found same input on page with type: hidden
                debug[17:40:49,306]: Found same input on page with type: hidden
                debug[17:40:49,306]: Found same input on page with type: hidden
                debug[17:40:49,306]: Found same input on page with type: hidden
                debug[17:40:49,306]: search for elements by name 'INPUT' in element span
                debug[17:40:49,306]: Replace value for inputs: 23 by new values: 0
                debug[17:40:49,306]: call getElementById for id= _A4J.AJAX.focus
                debug[17:40:49,307]: No focus information in response