How to use javascript to access item VALUES on a portal form

Hi,
I want to pick up VALUE of an item on a portal form from the on click event of the save button. I know there is a way to acces the item name and assign a value to that item. For example,
setItemValue(this.form,'UNIT_NAME', this.value)
If I use this line of code then I get the value of the save button because I put this line of code in the on click event of the save button. Please help.
Monique

You can get hold of any field on your form as follows:
document.forms[0].elements['<form>.DEFAULT.<field>.01']
So for example to get (or set) a value in my form I have:
document.forms[0].elements['REQUESTFRMEU.DEFAULT.BUS_OBJ.01'].value
Note that setting a value of a field with Javascript on the Insert button's onclick event will not result in the new value being sent to the DB. I think it has to do with the values being set into a session object of sort and the DB gets updated from these values and when you update the field with JS it does not update thesee session values. If you set the value somewhere else (e.g. another event handler before the Insert button is clicked) you should be OK.
Cheers.
Anton.

Similar Messages

  • How to use JavaScript to supply a value for a MessageTextInput field

    With the text attribute you can supply a deafult value for text field. Is it possible to supply this field with a default value determined by javascript ?
    <messageTextInput name="startDate" text="..." ...

    Marcel,
    If you want to dynamically set a value for a text field, there are two approaches you can use:
    1. use javascript (the browser language) and then for your <body> element's onload handler, invoke a javascript method that sets your form value.
    2. use java (the compiled language) and databind the "text" attribute of messageTextInput to a dataobject that gives the current date. If all you're looking to do is bind to the current date, I'd recommend this approach.
    Hope this helps,
    Ryan

  • How to Use JavaScript in Controller Class...

    Hi All,
    Can any one tell me how to use JavaScript in Controller Class.
    Requirement is:
    I have
    Radio Group(RG1),
    Two Radio Buttons(RB1,RB2),
    Two messageTextInput(MTI1,MTI2),
    if i click RB1 i should Prompt to the end user to "Enter value for MTI1" or
    If i click RB2 i should prompt "Enter value for MTI2" while submitting page.
    Please let me know the steps to use JavaScript and the above client validation...
    Regards
    Alem...

    Using javascript is against the standard. I can tell you a workaround instead of you setting the javascript, check if that would be acceptable.
    You can use PPR and set the required property on the messageTextInput on clicking of the radio button. By doing this you will let UIX generate the javascript for you to handle the client side validation. But the validation will happen only on click of the submit button. The visual indicator is good enough to tell that the value has to be entered to the item.

  • Using JavaScript to access Database

    Hi all,
    I am using JSP and Tomcat for my web application.
    Now i need to use Javascript to access the MS Access database. Can anyone please tell me the class and command for accessing database from javascript.
    Please give me an example and that will help me. I know it is not good to access database using JavaScript. But in this situation i have to use it anyhow.
    Thatnks

    Hi all,
    Thanks very much for your help. Now some of you said that it is not possible in JSP to access database using JavaScript, some of you said yes it is possible but not secure, I understand the both concepts.
    Now my problem is last year i built a web application for my company and the scenario is like this:
    The staff records their working time in that application. Now when they click a button it creates a drop down list of all clients they have and that list is in HTML as SELECT TAG. So the select tag includes 100+ client name.
    Now they can add as many client as they want for example if i have worked with 10 clients i will create 10 drop down list by pressing button called ADD CLIENT and will record their hours.
    Now from the description above you guys can understand that an OnClick Javascript event in involved to create multiple dropdown list.
    Now what i want is that i want those 100+ client list to come from database rather than typing them in the SELECT TAG. and please remember the SELECT tag is implemented in Javascript using innerHTML event.
    Now for those of you who suggested that it is not possible to use Javascript in accessing database, can you please tell me how can i implement Onclick event using JSP/Serverlet and can create dynamic drop downlist?
    Thanks for your time to read this long message.

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

  • How to use Javascript to load random pages?

    I wonder if anyone knows how to use Javascript to load a list
    of links stored in the text file.
    Every address will take a line, and the Javascript will
    randomly select one of the addresses to load.
    The user will click the button "random" and access the page
    randomly selected by the script.

    Addition note:
    I forgot to say this because my computer froze......(how
    lame)
    I got the code for random accessing the links.
    But now the problem is, is there anyway to parse a text file
    into the array in Javascript?

  • How to use JavaScript in Web bean generated JSP

    I want to do some simple JavaScript validations (for example, checking if a particular field is empty) in the JSP page rendered by the data web bean. Because the HTML is rendered by the bean, I'm not able to refer to the HTML controls in the JSP page. I'm not even able to refer to the form with the following standard piece of JavaScript code - "document.forms[0].control_name".
    Is anybody aware of how to use JavaScript with these rendered JSP pages?

    You just have to add it like and applet , including this line in your JSP or JSF
    <script src="http://dl.javafx.com/dtfx.js"></script>Then add the applet
    <script>
        javafx(
                  archive: "./resources/jar/Draw.jar",
                  width: 400,
                  height: 200,
                  code: "Draw",
                  name: "Draw"
    </script>./resources/jar/Draw.jar - is the path and the name of the jar

  • How to use Javascript in OBIEE?

    Hi all,
    can any one tell how to use javascript in OBIEE. i.e steps to follow to insert the javascript in OBIEE 11g or 10g

    If you are trying to display total number of pages in a report, Add the below formula in the column of the report and hide that column in the report.
    FX = sum(count(1))/25
    You can then reference the column in the narrative view like this: "Total pages in the report are @5" and out put may be "Total Pages in the report are 30".
    Or
    You can also use something like the below:
    To calculate them use fi:
    CEILING(CAST(RCOUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the page number
    CEILING(CAST(COUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the total pages
    Put the above formula in the column and reference it in the narrative view like I mentioned in the previous example.
    If you are report view is pivot, then please refer to this link: http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/
    Hope this helps.
    Thanks,
    -Amith.

  • How to use JAPI to Access Essbase 6.5

    Do anyone knows How to use JAPI to Access Essbase 6.5?
    I was told to install Enterprise Services 7.3.1.10.
    But when I test eds samples, I can connect Essbase but can not get data from Essbase.
    Need to change another Enterprise Services(I was told 7.3.1.10 is the latest version), or do some config in 7.3.1.10.
    Thanks a lot in advance

    Gee is correct. You will need to use EAS 7.x to add an analytic server. You will also have to do a few other tasks such as synch'ing security, etc.
    Further, as you are not accessing the exact same version of Essbase as your version of EDS, there is a property setting you will have to change to be successful. In eds\7.1.3\bin, open essbase.properties and modify the server.olap.direct setting to set it to false. What this setting does is forces EDS to use it's own private set of C API files and to use them for all calls to Essbase. Otherwise, EDS will attempt to use pure Java calls to the server. Unfortunately, the pure Java calls were implemented in an 'evolutionary' manner so every Essbase version got more calls until sometime in the System 9 timeframe. By the time 9.3 shipped (and maybe before, I would have to check), all calls the server are pure Java and that property setting is no longer available.
    Tim Tow
    Oracle ACE
    Applied OLAP, Inc

  • How to use "Context Menu" web item in WAD 7.0 ?

    Hi Experts,
    Kindly tell me How to use "Context Menu" Web item in SAP WAD 7.0 ?
    How to attach this Web item to my Graph/Chart ?
    Plz provide some documents on this.
    Full points will be given.
    Thanks.
    -Jay Jay
    Edited by: jayaprakash j on Oct 10, 2008 1:47 PM

    Hi Jay
    Web items and HTML elements (for example, tables, texts, and images) that you insert into a Web template, as well as the Web template itself, have a context menu. This context menu has context-sensitive menu entries that you can use to call various Web Application Designer functions. You can, for example, use the context menu to save a Web item (for which you have specified properties by using the parameters) as a reusable Web item, call the properties dialog box for this Web item, copy the Web item and paste it into another Web template, or delete the Web item from the Web template.
    for more info go to following link:
    http://help.sap.com/saphelp_nw70/helpdata/EN/2f/776b3d32390968e10000000a114084/frameset.htm
    Regards
    Vivek

  • How to use dynamically column_name and column_name value in plsql procedure

    hi,
    how to use dynamically column_name and column_name value in plsql procedure.
    for example, i have one table with column col1.i want write plsql code with dynamically execute the insert one schema to another schema.
    by
    siva

    DECLARE
    CURSOR C
    IS
    SELECT cc_cd
    FROM TEMP1 WHERE s_flg ='A' AND b_num IN('826114');--,'709537','715484');
    CURSOR D
    IS
    SELECT * FROM cONSTRAINTS_test ORDER BY SRL_NUM;
    STMT VARCHAR2(4000);
    p_target_schema VARCHAR2(30):='schema1';
    p_source_schema VARCHAR2(30):='schema2';
    BEGIN
    FOR REC IN C
    LOOP
    FOR REC1 IN D
    LOOP
    STMT := 'INSERT INTO '||p_target_schema||''||'.'||''||REC1.CHILD_TABLE||' SELECT * FROM '||p_source_schema||''||'.'||''||REC1.CHILD_TABLE||' where '||REC1.COLUMN_NAME||'='||REC.cntrct_cd||'';
    Dbms_Output.Put_Line('THE VALUE STMT:'||STMT);
    END LOOP;
    END LOOP;
    END;
    cc_cd='434se22442ss3433';
    cc_t_ms is parent table-----------------------pk_cc_cd is primary key
    cc_cd is column name
    CONSTRAINTS_test table
    CHILD_TABLE NOT NULL VARCHAR2(30)
    CONSTRAINT_NAME NOT NULL VARCHAR2(30)
    COLUMN_NAME NOT NULL VARCHAR2(400)
    R_CONSTRAINT_NAME VARCHAR2(30)
    CONSTRAINT_TYPE VARCHAR2(1)
    PARENT_TABLE NOT NULL VARCHAR2(30)
    SRL_NUM NUMBER(4)
    CHILD_TABLE     CONSTRAINT_NAME     COLUMN_NAME     R_CONSTRAINT_NAME     CONSTRAINT_TYPE     PARENT_TABLE     SRL_NUM
    a aaa cc_CD     pk_cc_CD     R     cc_t_MS     1
    bb     bbb      Cc_CD     PK_CC_CD     R     cc_t_MS     2
    bb_v     bb_vsr     S_NUM     PK_S_NUM      R     bb_v      3
    cC_HS_MS     cc_hs_CD     cc_CD     PK_CC_CD     R     cc_t_MS     4
    cC_HS_LNK cc_HIS_LNK_CD     H_CD     PK_HS_HCD     R     cC_hs_ms 5
    cC_D_EMP     cc_d_EMP     Cc_CD     PK_CC_CD      R     cc_t_MS     6
    i want insert schema1 to schema2 with run time of column_name and column value.the column_name and values should dynamically generated
    with refential integrity.is it possible?
    can any please quick solution.its urgent
    by
    siva

  • How to use JavaScript Zoom in on the layer

    How to use JavaScript Zoom in on the layer

    yeah, i talking about zooming in on a 3D object,do you have a solution

  • How do i set an image item to null on a form?

    How do i set an image item to null on a form?

    clear_item, wont work.
    this is what i actually need:
    theres is form which executes the execute_query to insert into the database and theres an image item on it as well which is also a database item and after insertion it doesnt clear up, it still retains the image and i want it to clear up.
    Hope you understand.
    Thanks

  • How to use javascript variable in BSP/ABAP and vice versa

    Hello Experts,
    In IC WEBCLIENT, there is a view.In the view.htm i want to fetch  the screen resolution and as per the resolution i want set the width of that view.
    1, I wrote the below  javascript to fetch the screen resolution.
       Can i use a notmal ABAP variable inside the javascript? and   If i use can i access that variable after the javascript.?
       Can i assign a javascript variable to a nrmal abap variable??
       The code sample  is like :
    Start of javascript
       if (screen,width == 1024 )
         lv_width = 500  "lv_width is an ABAP variable.
      else
        lv_width = 700
    **END OF JAVASCRIPT
       **Now i want to use lv_width  to assign to a table view attribute(Width)
    <crmc: tableview..
                    width = <%= lv_width >
    the code is not giving any error. But the problem is that lv_width is not giving the correct value, its getting initialized to initial value...
    Requesting the experts to please provide some suggestions/solution for the above issue.
    Thanks and Regards
    Sudhansu

    Hello Sudhansu,
    First of all there was a little mistake at my previous answer:
    you got lw_width = 700
    because at Server Side you have following code:
    lw_width = 500.
    lw_width = 700.
    but if you were writing your code like this:
    <%=lw_width %> = 700.
    then you will get the result that I was talking about : 0 = 700
    Sorry for the mistake
    Now for your question:
    if you want to get a value from the server and assign it to JScript variable you should write like this :
    var aaa;
    aaa = <%=lw_width %>;
    this code assign the server variable lw_width value into aaa  JScript varible.
    I'm not sure what exactly you want to do but look at this link:
    http://www.pageresource.com/jscript/jscreen.htm
    to get the idea how to get and use Screen Resolution variables at your JScript code.
    Good luck
    Eli Steklov
    Please Reward Points if it Helped

  • How to use javascript and sql

    Hi,
    I am new to HTML DB. I am trying to populate some textfields once a a drop down menu is selected .
    But my information to populate need to be obtained by querying my dabase how do i do that? using javascript
    or is there another way of doing that without using javascript?

    I understand you don't want to actually "submit" the page. Undsertand that with the web, you either:
    1. bring all of the values from the server to the page with you
    2. go back to the server to get values based on the value of the lov, or
    3. do partial-page refresh and get the new values from the server in the background with some VERY challenging javascript.
    2 is the solution I am suggesting. Do not insert the values yet, just let HTML DB save them in your session state. As soon as you change the LOV the page will be submitted and return with the correct values in the related items. If you want to get fancy, you can choose not to show the related items until the user has selected a value from the LOV.
    To see an example of this (kind of), go to the SQL Workshop and click on the "Tables" Icon. Now you should see a list of the tables in your schema. Change the "Type" LOV from table to index. Notice the page refreshed and the report changed? I'm suggesting the same concept, but just changing the value of some items, not a report.
    Tyler

Maybe you are looking for

  • Issue in deleting an app installed in IOS 7

    I'm facing issue in deleting an app which was installed in IOS 7 in both iPhone & iPad. Installed the app from the hosted server, Installation is complete. But the app remain in the grayed out state. When I try to delete the app, it is not getting de

  • Oim 9.1.0.2 migration to 11.1.1.5

    hi friends, I am looking to migrate oim 9.1.0.2 to 11.1.1.5 can any post me the links regarding this migration task. Thanks & Regards srikanth

  • How do I copy the string portion of an enum into the string portion of a cluster?

    I want to do this for the an entire array of clusters.  I'm trying to use a for loop.  Can't figure out how to parse the string portion of the enum into the string portion of the cluster. Alternatively, I'd be happy if I could figure out some way to

  • Registry settings are missing

    The following is the message I am getting when I start Itunes. I have remove and reinstall itunes to no avail please help daughter got new ipod and wants to play with it. "The registry settings used by itunes fot importing and burning cds and DVD are

  • VAT Registration number in FB60

    Hello SAP experts, May any body advise me how can I get Vat registration numger in FB60 automatic from Vendor Master(I hope it should) I am not seeing Vat registration number(field is in display mode) in FB60 while doing invoice for the vendors where