I am using Struts 1.2.8, Tomcat 5.5, AJAX DOJO. It will later be enclosed as
a portlet using Struts Bridge for deployment on Jetspeed 2 Portal.

I have a table that is populated dynamically from a database (MySQL).

In this table - each table element includes an In Line Edit widget for
real-time editing of table fields.

When you click on any widget - it starts the DOJO widget - you can edit the
value to your preference and press save. This save button calls an onSave JS
Handler.

Now here is the problem. Each of the table fields is enclosed by a form. I
need to pass an ID (Column 1 of the table) when teh form is submitted into
the bean. The saveHandler() has a method signature with the new value - that
would also need to be submitted. The combination of the ID field and the new
value getting passed into the bean would allow me to make appropriate
changes in the database.

I hope all that makes sense...

I will post a snippet below:

                       <html:form action="/TIDEdit.do" method="post" >

                       <td align="center">
                             <h5 id="<%=count%><%=col%>"
dojoType="inlineEditBox"> <%= rapvalue %> </h5>

                       </td>
                       </html:form>




   function saveHandler(newValue, oldValue) {
       //alert("a");
       //dojo.debug("New Value: " + newValue + " Old Value: " + oldValue);
               document.getElementById('MyTIDEditBean').submit();
   }



With this form I would liek to submit a java variable <%=id%> and "newValue"
from the saveHandler().

Thanks for all your help,

Akshay




On 7/13/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:

On 7/13/06, Akshay Ahooja <[EMAIL PROTECTED]> wrote:
> I tried using <html:form action="actionname.do?id=<%=variable%>" but it
does
> not work out....

1. While Struts html:form tag will properly parse out the query
parameter out of "action" attribute, it is not a recommended way to
pass data from a submitted form. You might want to use a hidden field
instead (unless you use GET instead of POST).

2. If I am not mistaken, if you use POST to submit a form, the query
parameter is not guaranteed to be sent by browser and is not
guaranteed to be processed by server. Like I said, for POST requests
using hidden fields is recommended.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to