Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes struts and java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts and java script" Watch "struts and java script" New topic
Author

struts and java script

vidya mahavadi
Ranch Hand

Joined: Nov 24, 2004
Posts: 34
Hi,

I have a jsp where I am displaying a table with some transactions and next to each transaction I have a checkbox. I got my jsp working.. But I also need to add a small java script to add the amount in that transaction row to a text feild (another form field). Here is the code snippet..

public class PolicyTrnsDisplayObject implements Serializable{

private PolicyTrns policyTrns;
private boolean checked;

//getters and setters are also included
}

public class AdjustmentRequestActionForm extends ActionForm {
private List policyTransactions = new ArrayList();
//list of displayObjects.

//getters and setters are also included
}

in jsp,


< html:text name="adjustmentRequestForm" property="amount" />


< logic:iterate id="policyTrnsDisplayObject" name="adjustmentRequestForm" property="policyTransactions" type="PolicyTrnsDisplayObject" indexId="ctr" />

...transaction parameters included here

< html:text name="policyTrnsDisplayObject" property="policyTrns.amount" />


< html:checkbox property='< %= "policyTrnsDisplayObject[" + ctr + "].checked"% >' on/click="" /<

< logic:iterate />

What I need to do is, pass the amount in that row to the javascript! I appriciate any idea to get to work..

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts and java script
 
Similar Threads
how to use indexid of logic:iterate tag in struts
using indexId
struts and java script
Generate Radio Buttons
Indexed Properties with List of Strings