struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: Submitting a form with ajax submit inside the form
Date Sun, 24 Jun 2007 23:43:08 GMT
Probably because the HTML being generated was invalid; isn't that why you were trying to customize
the form tag templates?

----- Original Message ----
From: Mansour <mansour77@yahoo.com>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Sunday, June 24, 2007 7:37:34 PM
Subject: Re: Submitting a form with ajax submit inside the form

Yes. You did it ! You isolated the issue. It's working without any table 
tags. This works fine and send the request as expected:

<s:iterator value="taskList" status="stat" id="row">
            <s:form action="updateTask" id="form_${row.id}"
                method="post" theme="ajax">
            <s:textfield value="${id}" name="task.id" />
            <s:submit  id="submit_${row.id}" />
            </s:form>
        </s:iterator>


The first generated element will not work if I surround the previous 
code with <table> tags !
I don't understand why, at least now I know where's the problem.
Do you have any idea ?



Dave Newton wrote:
> So... is it the same?
>
> The first thing I'd try is generated well-formed HTML by using the S2 tags outside of
your own table: use the <s:form.../> etc. tags on a plain page w/o your extra table
markup.
>
> ----- Original Message ----
> From: Mansour <mansour77@yahoo.com>
> To: Struts Users Mailing List <user@struts.apache.org>
> Sent: Sunday, June 24, 2007 7:02:31 PM
> Subject: Re: Submitting a form with ajax submit inside the form
>
> Dave Newton wrote:
>   
>> --- Mansour <mansour77@yahoo.com> wrote:
>>   
>>     
>>> <s:if test="#stat.odd == true">
>>>   <tr class="odd">
>>> </s:if>
>>> <s:else>
>>>   <tr class="even">
>>> </s:else>
>>>     
>>>       
>> Btw, I would change this to (minus whatever syntax /
>> attribute name errors I'm about to make):
>>
>> <s:set name="foo" value="${#stat.odd ? 'odd' :
>> 'even'"/>
>> <tr class="${foo}">
>>   ...
>>
>> Cleaner, shorter, and better-formed JSP.
>>
>> d.
>>
>>   
>>     
> I agree with you. But Now I am gonna remove this totally just until I 
> get this working.
> This is the HTML generated by IE (on linux):
>
>
> <table id="row">
>     <thead>
>         <tr>
>             <th>Task Id</th>
>             <th>Service Name</th>
>             <th>Save</th>
>         </tr>
>     </thead>
>     <tbody>
>        
>        
>             <div id="DIV_1">
>             <form namespace="/" id="form_1" name="updateTask" 
> action="/fe/updateTask.action" method="post"
>  >
> <table class="wwFormTable">
>             <tr>
>             <td><tr>
>     <td class="tdLabel"></td>
>     <td
>  ><input type="text" name="task.id" value="1" id="form_1_task_id"/>
> </td>
> </tr>
> </td>
>             <td><tr>
>     <td colspan="2"><div align="right">    <input type="submit" 
> dojoType="struts:Bind" event="onclick"     value="Submit" 
>       id="submit_1"  />
>
> </div></td>
> </tr>
> </td>
>             </tr>
>            
>
> <!-- javascript that is needed for tooltips -->
> <script 
> type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
>
> </table>
> </form>
>
>             </div>
>            
>        
>        
>             <div id="DIV_3">
>             <form namespace="/" id="form_3" name="updateTask" 
> action="/fe/updateTask.action" method="post"
>  >
> <table class="wwFormTable">
>             <tr>
>             <td><tr>
>     <td class="tdLabel"></td>
>     <td
>  ><input type="text" name="task.id" value="3" id="form_3_task_id"/>
> </td>
> </tr>
> </td>
>             <td><tr>
>     <td colspan="2"><div align="right">    <input type="submit" 
> dojoType="struts:Bind" event="onclick"     value="Submit" 
>       id="submit_3"  />
>
> </div></td>
> </tr>
> </td>
>             </tr>
>            
>
> <!-- javascript that is needed for tooltips -->
> <script 
> type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
>
> </table>
> </form>
>
>             </div>
>            
>        
>        
>             <div id="DIV_2">
>             <form namespace="/" id="form_2" name="updateTask" 
> action="/fe/updateTask.action" method="post"
>  >
> <table class="wwFormTable">
>             <tr>
>             <td><tr>
>     <td class="tdLabel"></td>
>     <td
>  ><input type="text" name="task.id" value="2" id="form_2_task_id"/>
> </td>
> </tr>
> </td>
>             <td><tr>
>     <td colspan="2"><div align="right">    <input type="submit" 
> dojoType="struts:Bind" event="onclick"     value="Submit" 
>       id="submit_2"  />
>
> </div></td>
> </tr>
> </td>
>             </tr>
>            
>
> <!-- javascript that is needed for tooltips -->
> <script 
> type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
>
> </table>
> </form>
>
>             </div>
>            
>        
>     </tbody>
> </table>
>
>
>
>
>
>
> ########################################################################
> This is from FF:
>
>
> <table id="row">
>     <thead>
>         <tr>
>             <th>Task Id</th>
>
>             <th>Service Name</th>
>             <th>Save</th>
>         </tr>
>     </thead>
>     <tbody>
>        
>        
>             <div id="DIV_1">
>             <form namespace="/" id="form_1" name="updateTask" 
> action="/fe/updateTask.action" method="post"
>  >
> <table class="wwFormTable">
>
>             <tr>
>             <td><tr>
>     <td class="tdLabel"></td>
>     <td
>  ><input type="text" name="task.id" value="1" id="form_1_task_id"/>
> </td>
> </tr>
> </td>
>             <td><tr>
>     <td colspan="2"><div align="right">    <input type="submit" 
> dojoType="struts:Bind" event="onclick"     value="Submit" 
>       id="submit_1"  />
>
> </div></td>
> </tr>
> </td>
>             </tr>
>            
>
> <!-- javascript that is needed for tooltips -->
> <script 
> type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
>
> </table>
> </form>
>
>             </div>
>            
>        
>        
>             <div id="DIV_3">
>
>             <form namespace="/" id="form_3" name="updateTask" 
> action="/fe/updateTask.action" method="post"
>  >
> <table class="wwFormTable">
>             <tr>
>             <td><tr>
>     <td class="tdLabel"></td>
>     <td
>  ><input type="text" name="task.id" value="3" id="form_3_task_id"/>
> </td>
> </tr>
> </td>
>             <td><tr>
>     <td colspan="2"><div align="right">    <input type="submit" 
> dojoType="struts:Bind" event="onclick"     value="Submit" 
>       id="submit_3"  />
>
> </div></td>
> </tr>
> </td>
>             </tr>
>            
>
> <!-- javascript that is needed for tooltips -->
> <script 
> type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
>
> </table>
> </form>
>
>             </div>
>            
>        
>        
>             <div id="DIV_2">
>
>             <form namespace="/" id="form_2" name="updateTask" 
> action="/fe/updateTask.action" method="post"
>  >
> <table class="wwFormTable">
>             <tr>
>             <td><tr>
>     <td class="tdLabel"></td>
>     <td
>  ><input type="text" name="task.id" value="2" id="form_2_task_id"/>
> </td>
> </tr>
> </td>
>             <td><tr>
>     <td colspan="2"><div align="right">    <input type="submit" 
> dojoType="struts:Bind" event="onclick"     value="Submit" 
>       id="submit_2"  />
>
> </div></td>
> </tr>
> </td>
>             </tr>
>            
>
> <!-- javascript that is needed for tooltips -->
> <script 
> type="text/javascript">dojo.require("dojo.widget.Tooltip");dojo.require("dojo.fx.html");</script>
>
> </table>
> </form>
>
>             </div>
>            
>        
>     </tbody>
>
> </table>
>
> ####################################################################
>
> And this is the source JSP:
>
>
>
> <table id="row">
>     <thead>
>         <tr>
>             <th>Task Id</th>
>             <th>Service Name</th>
>             <th>Save</th>
>         </tr>
>     </thead>
>     <tbody>
>         <s:iterator value="taskList" status="stat" id="row">
>        
>             <div id="DIV_${row.id}">
>             <s:form action="updateTask" id="form_${row.id}"
>                 method="post" theme="ajax">
>             <tr>
>             <td><s:textfield value="${id}" name="task.id" /></td>
>             <td><s:submit  id="submit_${row.id}" /></td>
>             </tr>
>             </s:form>
>             </div>
>            
>         </s:iterator>
>     </tbody>
> </table>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>   
>>        
>> ____________________________________________________________________________________
>> Got a little couch potato? 
>> Check out fun summer activities for kids.
>> http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz

>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
>  
> ____________________________________________________________________________________
> Don't get soaked.  Take a quick peak at the forecast
> with the Yahoo! Search weather shortcut.
> http://tools.search.yahoo.com/shortcuts/#loc_weather
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org






       
____________________________________________________________________________________
Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message