Accessing an Object's Methods

Discussion in 'Javascript' started by mikelsmith@hotmail.com, Sep 8, 2005.

  1. Guest

    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!
     
    , Sep 8, 2005
    #1
    1. Advertising

  2. wrote:
    > <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
     
    Janwillem Borleffs, Sep 8, 2005
    #2
    1. Advertising

  3. 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
    > 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.
    >



    document.getElementById("theString").tagName

    > Thanks for any help!
    >



    --
    Gérard
    --
    remove blah to email me
     
    Gérard Talbot, Sep 8, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    107
  2. Ishan Bhalla

    Accessing generic methods throug a proxy object

    Ishan Bhalla, Aug 22, 2008, in forum: ASP .Net Web Services
    Replies:
    4
    Views:
    252
    John Saunders
    Aug 26, 2008
  3. Nikita Petrov
    Replies:
    2
    Views:
    114
    Gary Wright
    Apr 6, 2008
  4. Kenneth McDonald
    Replies:
    5
    Views:
    326
    Kenneth McDonald
    Sep 26, 2008
  5. Replies:
    0
    Views:
    110
Loading...

Share This Page