3 Replies Latest reply on Jan 30, 2009 2:06 PM by Roger Abelenda

    Post Datatable data

    Roger Abelenda Newbie

      Hi, I have an aplication with Richfaces that has a form with a datatable, the datatable contains all the fields for a form that need to POST (with the HTTP Post method, and containing all the data of the datatable) to an url of a servlet (the axis2 one) in my tomcat server. I have created a commandLink that executes an action that makes a sendRedirect. This way it works, but I need to do a POST. Any ideas?

        • 1. Re: Post Datatable data
          Roger Abelenda Newbie

          Is there any way to add a java script code to the page from the backing bean?

          • 2. Re: Post Datatable data
            Nick Belaevski Master


            Sure, use this:

            <script type="text/javascript">#{bean.javascriptCode}</script>

            • 3. Re: Post Datatable data
              Roger Abelenda Newbie

              thanks I solved the problem, in some way. I created an outputText with escape="false", value="#{bean.myscript}" and rendered=#{bean.myscript!=null}". The script is auto generated when I click on the submit button of the form and using all the data of the datatable. The script creates a new form with method="post" and action="external Url" that does the post in a new window. I had to put the invocation of the script function in the onload method of the body of the html. The problem that I'm facing now is that I have a tree control with dynamic data load in it, after clicking the button (that invocates the actionListener) the tree control resets partially, it resets the values dinamically loaded but the structure (nodes) and some static text are kept, any ideas of what is happening? The backing bean isn't reseting the treeNode used as value of the tree control.