Accessing an Object's Methods

M

mikelsmith

I have a javascript function that needs to access methods of a java
object(localTag). In my JSP I'm trying to include hidden fields for
the Strings returned from the getter method calls of the object like
so:

<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagName()" %>' />
<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagValue()" %>' />

If I can do something like this, what is the correct syntax and how do
I access this property in my javascript? When I have a hidden field
that is just a String, I access it in the javascript like
"document.getElementById("theString").value" and it works fine, but I
can't seem to find how to access the String value of a method call.

Thanks for any help!
 
J

Janwillem Borleffs

<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagName()" %>' />
<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagValue()" %>' />

What happens when you omit the double quotes?

<html:hidden name="FrmCustomerHolding"
property='<%= localTag.getTagName() %>' />


JW
 
G

Gérard Talbot

(e-mail address removed) a écrit :
I have a javascript function that needs to access methods of a java
object(localTag). In my JSP I'm trying to include hidden fields for
the Strings returned from the getter method calls of the object like
so:

<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagName()" %>' />
<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagValue()" %>' />

If I can do something like this, what is the correct syntax and how do
I access this property in my javascript?



elementReference.tagName


DOM 2 Core:
http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-104682815
The return value will be uppercased in HTML (not sure about XHTML but I
think it should be lowercase).

DOM 3 Core:
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-104682815
The return value will be uppercased in HTML (not sure about XHTML but I
think it should be lowercase).



When I have a hidden field
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top