• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts and java script

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic