GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes problem with <logic:iterate> and with onload function in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with <logic:iterate> and with onload function in javascript" Watch "problem with <logic:iterate> and with onload function in javascript" New topic
Author

problem with <logic:iterate> and with onload function in javascript

Harsha Gedala
Ranch Hand

Joined: Jun 04, 2008
Posts: 41

I have a problem in using the logic iterate text field and the onblur java script function.

when i am using the logic iterate test field
<td>$ <html:text name="paymentRecoveryDetailsFVO" property="toBeRecovered" styleId="paymentRecoveryDetailsFVO" indexed="true"/></td>


when i am iterating the text field i have to load the values in the onload function including the values present in the second table where i have already used on load function.
But the problem is i have to load the function even with the text field present in the loop.

for eg: if the index of the loop is 4 then onload final value will be
paymentRecoveryDetailsFVO[0].toBeRecovered=10
paymentRecoveryDetailsFVO[1].toBeRecovered=11
paymentRecoveryDetailsFVO[2].toBeRecovered=12
paymentRecoveryDetailsFVO[3].toBeRecovered=13
Salvage : 14
DMV/Registration Refund (Total Loss) : 15
Out of Pocket RENTAL CAR: 16
Insured Deductable : 17
--------------------------------------------------
Total to be Recovered : 10+11+12+13+14+15+16+17 = 119
---------------------------------------------------
so finally i should get 119 as the answer.




I am using this code in jsp and using the following struts tags

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

thanks for the response in advance
 
GeeCON Prague 2014
 
subject: problem with <logic:iterate> and with onload function in javascript