4 Replies Latest reply on Apr 9, 2008 1:46 PM by sergeysmirnov

    AJAX - Dont REFRESH the HTML code!!!! Help!!! :(

    peerless

      I did a modify in my datatable to has ajax support, but the "edit" button dont works after i delete or add a new item via ajax! Why? Because the HTML code that the edit button get as base dont are UPDATED!!!!!

      How i can make to the AJAX (a4j) update my html too ??

      Help!!!!

      thanks :/

        • 1. Re: AJAX - Dont REFRESH the HTML code!!!! Help!!! :(

          Show the code, please.

          P.S. most common problems cause by missing the id of the form components defined explicitly.

          • 2. Re: AJAX - Dont REFRESH the HTML code!!!! Help!!! :(
            peerless

            OK, sorry, my code:

            I have a datatable:

            <t:dataTable id="data" ..


            at my datatable exists a button to delete a line using AJAX:

            <a4j:commandButton styleClass="BotaoExcluir" action="#{cronograma.excluirAtividade}" immediate="true">
             <t:updateActionListener value="#{index}" property="#{cronograma.bean.indexLinha}"/>
             <a4j:support event="onclick" reRender="data" onsubmit="if(!confirm('Excluir?'))
             {form.reset(); return false;}" />
             </a4j:commandButton>


            Its work, BUT.. for example:

            Was deleted the item with ID: 8
            In my datatable him hide, ok.. deleted! BUT... if i open the html code... HIM LIVE!!! him show in html code o_O ...

            Ajax4jsf do not be sincronism with the html code!!

            any idea??

            :(



            • 3. Re: AJAX - Dont REFRESH the HTML code!!!! Help!!! :(
              ilya_shaikovsky

              1) View Source - browser command will display the same results as before ajax and there is nothing about ajax - just browser questuion ;) . Valid result could be checked using IE dev toolbar or fireBug
              2) do not include support in a4j:command* components!

              • 4. Re: AJAX - Dont REFRESH the HTML code!!!! Help!!! :(

                BWT, a4j:commandButton does not require additional ajax support (a4j:support), as soon as a4j:commandButton is already a Ajax component by definition