Getting the value of Applet Label using JavaScript

hi,
i tried this:
alert(document.all.Applet1);
and got a description of applet characteristics. But
alert(document.all.Applet1.labelName);
returns undefined, whereas
alert(document.all.Applet1.labelName.value);
returns "null or not an object".
Thank you in advance for any suggestions,
Reshat.

The question basically is the browsers' DOModel for Applets, if it exists.Not that I am aware of. If your applet is done in Java 1.1, there is no need for you to fool around with the <OBJECT> and <EMBED> tags wich are only needed if your applet requires a Java plugin. As it stands, your applet should work fine with the browser's native JVM which is 1.1.5 for both IE and NN4+ (it will probably work on NN6+ via a plugin -- NN6+ doesn't have a native JVM).
The way you should do it is to code a public getter method inside of your applet to return the label that you need. Here is an example Java class:
public class testClass extends Applet {
   String myLabel;
   public void init() {
      myLabel="test string";  // or whatever/however you assign the value
   public String getString() {
      return myLabel;
}To access the value of myLabel from JavaScript, you would do this (assuming that you named the applet in the <APPLET> tag as myApplet):
var str=document.myApplet.getString();
V.V.

Similar Messages

  • How to get the values of an Array using JSP Tags

    Hey guys,
    I need some help. I've splited a String using
    fn:split(String, delim) where String = "1,2,3,4" and delim is ,
    This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
    Any help would be highly appreciated
    Thanks

    The JSTL forEach tag.
    In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
    <c:set var="list" value="1,2,3,4"/>
    <c:forEach var="num" items="${list}">
      <c:out value="${num}"/>
    </c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string.

  • How to Get the Value in h:inputText to JavaScript?

    I have to use JSF to pop up a window from the parent window. In the popup window, I have to pass the value that is entered in a <h:inputText> back to a text field in the parent window.
    In order to make sure that I know the way to communicate between the parent window and the popup window, I have tried coding it in HTML. And I have done it successfully.
    Then, I try to convert the HTML code to JSF. I have searched the internet and I have tried different specifications myself. I am stuck. This is the line that I have been struggling with:
    window.opener.document.forms[0].form["dataManagement:textField"].value = document.forms[0].form["externalFile:inputField"].value;If textField is in HTML parent window <input name=textField .... /> and the inputField is in HTML popup window <input name=inputField .... />, the JavaScript can recognize (No problem! the datum is passed.):
    window.opener.document.forms[0].textField.value = document.forms[0].inputField.value;Now, the dataManagement is the "id" attribute in my JSF parent <h:form> tag. The externalFile is the "id" attribute in my JSF popup <h:form> tag.
    The textField is in the JSF parent window as both the "id" attribute and a "property" name (i.e. value="#{dataManagementBean.textField}" )in the <h:inputText> tag.
    The inputField is in the JSF popup window as both the "id" attribute and a "property" name (i.e. value="#{accessExternalFileBean.inputField}" ) in the <h:inputText> tag.
    No matter how I experiment with different specifications, I cannot get the textField and inputField in the JavaScript. I got that "it is null or not an object" JavaScript error. Please advise if you have done it successfully.

    You could bind your h:inputText to a UIInput on the managed bean. Then when you are outputting your text for your javascript you could generate the clientId by placing a <h:outputText value="#{bean.textField.clientId}"/> into the javascript. And for getting the correct field you might use:
    document.forms[0].elements['<h:outputText value="#{bean.textField.clientId}"/>'].valueI have not used it for popups, but I have used it for setting other values and it seems to work well.
    Hope this helps.
    Tom

  • Getting the values of a form (JSP, JavaScript involved)

    Hi, basically I want to read the values from one page to another one, but I have found that when call the jsp from a javascript function it does not work!!! ... if I call the page "getValues.jsp" directly from the <form action>, everything works perfectly ...
    ... does anyone know how to read the values without putting the jsp directly into the <form action>?
    In asp i used to get the values from the form with a "Request.Form('fieldName')" method, and i could call the asp from any javascript function. Does jsp has anything similar to that?
    ----- fillValues.jsp ----
    <script language="JavaScript">
    function doSomething(){
    // do something else
    window.document.location="getValues.jsp";
    </script>
    <html>
    <body>
    <form method="post" action="javascript:doSomething()" name="x">
    <input name="fldSubject" type="text">
    </form>
    </body>
    </html>
    ------- getValues.jsp ---
    <%@ page import="java.lang.*" %>
    <%@ page import="java.util.*" %>
    <jsp:useBean id="_mb" class="MyBean" scope="session"/>
    <%
    _mb.setSubject(request.getParameter("fldSubject"));
    %>
    <html>
    Subject <%= _pr.getSubject() %><br>
    </html>

    I dont know what the problem in your code is but the following works:
    <script>
    function foo()
    document.myForm.action="getValues.jsp";
    </script>
    <form name="myForm>
    <input type="submit" name="submit" onClick="foo()">
    </form>

  • Getting the value of an element using the attribute value

    I have a Document object and I want to get the value from the element that has an attribute value of "college". Does that make sense?
    <TEAM>
         <FIELD name="city">Phoenix</FIELD>
                        <SECTION name="NASH">
                              <FIELD name="college">Santa Clara</FIELD>
                              <FIELD name="grad">1997</FIELD>
                              <FIELD name="years">9</FIELD>
                              <FIELD name="PPG">19.2</FIELD>
                             <FIELD name="AST">10.4</FIELD>
                            <FIELD name="REB">4.2</FIELD>
            </SECTION>
    </TEAM>
    Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I have a Document object and I want to get thevalue
    from the element that has an attribute value of
    "college". Does that make sense?
    <TEAM>
         <FIELD name="city">Phoenix</FIELD>
    <SECTION name="NASH">
    <FIELD name="college">Santa
    FIELD name="college">Santa Clara</FIELD>
    <FIELD
    <FIELD name="grad">1997</FIELD>
    <FIELD
    <FIELD name="years">9</FIELD>
    <FIELD
    <FIELD name="PPG">19.2</FIELD>
    <FIELD
    <FIELD name="AST">10.4</FIELD>
    <FIELD
    <FIELD name="REB">4.2</FIELD>
    </SECTION>
    </TEAM>
    Thanks!
    /TEAM/SECTION/FIELD[@name='college']
    if you just want the text then:
    /TEAM/SECTION/FIELD[@name='college']/text()

  • How to get the value from a function using a select statement

    I have a function(user defined not built in) that returns multiple values(like an array). My question is how do i get those values in a select statement. when i tried to retrieve it,
    select pack.my_members from dual;
    i am getting an error
    ORA-00902: invalid datatype
    I am sure this must be a syntax error with the select statement
    The following is the function that give the array of data
    package pack
    package spec
    Type my_table is table of varchar2(25);
    function the_members
    return pack.my_table;
    pakcage body
    function the_members return pack.my_table
    Remarks: This function returns a table containing names of the
    members
    is
    tm pack.my_table:= pack.my_table('first member','second member','third member','fourth member');
    begin
    return tm;
    end the_members;

    Check this example on Pipelinedfunction

  • How to get the value from a label and store it in an sql database?

    I have tried all kinds of different ways and I always get the error that it is not a member of string or whatever data type I try.
    Try
    scoringlbl.Text.Validate()
    scoreinglbl.Text.HighScoresBindingSource.EndEdit()
    scoringlbl.Text.HighScoresTableAdapter.Update(Me.ScoresDataSet.HighScores)
    MsgBox("Update successful")
    Catch ex As Exception
    MsgBox("Update failed")
    End Try

    I know nothing about data binding, but maybe this works, or at least point you in the right direction:
    Try
    scoringlbl.Validate()
    HighScoresBindingSource.EndEdit()
    HighScoresTableAdapter.Update(ScoresDataSet.HighScores)
    MsgBox("Update successful")
    Catch ex As Exception
    MsgBox("Update failed")
    End Try
    Armin

  • HTTP SERVICE - How to get the value of my params on the server side

    I am new to flex and with the url limitation i was trying to
    do the following ....send a bunch of ids... using params variable
    var myservice:HTTPService = new HTTPService();
    myservice.url = url;
    myservice.method = "POST";
    myservice.resultFormat = "e4x";
    myservice.send(params);
    The question is how do i get the value i passed on using
    params on the server side? can the variable params be a string or
    array or does it have to be object type?
    Any help would be greatly appreciated.

    Most server side languages have a function or an array where
    you extract the variables. in PHP they arrive in global arrays
    called $_POST and $_GET.
    Other languages have methods like request.formvars or
    request.query. Check your serverside language on how that is
    done.

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • Not Able to get to the values from applet while designing from xml

    Hi All,
    I have a new problem, and i am new to this one.
    Like I have an XML file.Where in i am able to design the applet while getting the values from the xml and i am able to store also.
    But the problem comes over here.I have given out a type field in xml.By validating the type field i am able to get Label(),TextField(),etc.,( whatever it is).While displaying i am giving only one single TextField in the init method and i am looping it up.so that i can get the no of text fields ,labels,text areas,etc.,
    so problem comes here.I am not able to get the values from those text fields.(only i am getting the last value.Last value is overwriting the old values.Now i am able to get the last value that i am giving it lastly.)
    So please can anyone give me some idea.As it is urgent to me and i have to submit urgently.
    Please help me out.And Thanks In Advance.

    Here is the sample code while designing the applet:
    String type = (String) typeList.get(j);
                             String option = (String) optionList.get(j);                                   
                             if(type.equals("text")){
                                  txtdisp = new TextField(15);
                                  leadcomp.add(txtdisp);     
    //                              txtdisp.addMouseMotionListener(this);}

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get the values and attributes of Longlived processes by using ProcessID.

    Hi Experts,
    For  every process we creates, LC ES2 creates processID.
    we know that if you creates  a long lived process, all  the  values which are in proces will be stored some where  in DB.
    Here my requirement is by using  processID I need to get all/some values/variables stored in database.
    I am not able to get values using processID. Here I don't have clue on  how to get the values.
    Please tell me  how to get the same by using  Process Management. Link/guide would be helpful
    Thanks
    Praveen.

    Searchable means you can put a filter criteria on it (e.g. where amount > 50000)
    Visible means you can add have this column returned as an output (and therefore you can add it as column in listview and see it in Task Details).
    These two attributes were provided so that queries could be done against the process variables, but the exact contents of the variables are not allowed to be seen.

  • How can we get the value of the key field in a custom data model using governance API?

    Dear Team,
    How can we get the value of the key field in a custom data model, to be used for manipulation of the change request fields using governance API?
    Any kind of help would be sincerely appreciated.
    Thanks & Regards,
    Tushar.

    Hi Michael,
    Thanks for direction. Let me give more context on this as I'm interested to get more details..One of the issue was to read cross entity field values on UI based on user action and set other entity field behaviour...It is similar to what is being posted here.
    For ex: Reading MTART from Basic Data UIBB in MM MDG UI and set the field properties in some other custom entities say ZZETEST. This cannot be done using UI BADI as it only supports single entity at a time and not cross entity. So alternatively we found a solution where we can enhance existing PLMB feederclass cl_mdg_bs_mat_feeder_form by reading the model and the entity as needed as it it proved that it supports cross entity UI field behaviours and so business requirements.
    This is a workaround for now.
    So the question is How do we achive it using governance API for cross entity field behiaviours.?or what is the right way doing this.
    Can we do that using governance API and its' methods?
    In the Governance API doc you provided below has referring to below external model as part of gevernance API.
    The active or inactive data (before or during the derivation or the check) can be read
    with the external data model interface IF_USMD_MODEL_EXT with the method READ_CHAR_VALUE and
    the corresponding READ_MODE parameter. To avoid unnecessary flushes (derivations), the NO_FLUSH
    parameter should b
    e set to ‘X’.
    Thanks
    Praveen

  • How to get the value of h:selectOneMenu in the javascript

    Hi,
    I want to get the value of <h:selectOneMenu> value in the javascript.... i have tried doing this but it returns null. can anyone plz suggest me a soln for this issue.
    My codes:
    JSF codes are:
    <a4j:form>
    <h:messages/>
    <h:panelGrid columns="2" id="chkpanel">
    <h:outputText value="Add a new root domain:" />
    <h:selectOneMenu id="dmnlst" value="#{domainDetails.selectedDomain}"
    onchange="fielddisable()">
    <f:selectItems value="#{domainTree.allDomains}" />
    </h:selectOneMenu>
    <h:outputText value="Name:" />
    <h:inputText value="#{domainDetails.domain.name}"
    required="true" />
    </h:panelGrid>
    </a4j:form>
    Javascript codes
    function fielddisable()
    var c=document.getElementById("dmnlst");
    alert(c); //am getting null values here....
    Thanks in Advance
    Pandiyan S

    Try a Javascript forum. Java != Javascript.

Maybe you are looking for