Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:button - onclick - substitution of jsp expression doesn't happen

 
Scott Britton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can somebody please show me the syntax needed to substitute values for jsp expressions when those expressions are embedded in a Struts html tag as follows:

<html:button value="Submit" property="whatever"
onKlick="javascript oSubmit('<%=vendorName%>')">
Submit
</html:button>

What happens is the Javascript function receives the literal value <%=vendorName%> instead of the actual value. This works fine with <input type="submit"> so I'm assuming this is a Struts tag issue.

Thanks!

Scott
 
Scott Britton
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind, I found the answer searching the archive. I did it as follows:

I then needed to get my parameters passed into javascript, done as follows:

<html:button value='Value'
property='yo'
onklick='<%= "return doSubmit(\'" + vendorName +
"\',\'" + contractNumber +
"\',\'" + doNumber +
"\',\'" + partNumber +
"\',\'" + deliveryId +
"\',\'" + itemId +
"\',\'" + delQuantityDue +
"\',\'" + delQtyToShip + "\');"%>'>
Save
</html:button>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic