To access browser values at runtime, use the JavaScript API method or its shorthand $v synonym: Substitution strings are not updated with browser values in real time and therefore cannot be used in this way. P1_BROWSER_TZ has no value at that point (JavaScript does not run on the server), so the alert line becomes: substitution strings is replaced on the server during page show processing. The problem is the alert, not how the value is being set. I tried the below script:function CallDial() First Alert gave America/Los_Angeles and second alert gave blank. So Page is getting loaded twice with this process which looks odd.īharat G wrote:Thanks for your response. The disadvantage of this way is the page is getting submitted immediately when the page is loaded. can you please suggest me what i'm missing here ? When I try to run above inthe same Dynamic Action, it is setting value in the Page Item as required. I tried the same by adding one more line as below: And tried with Alert to see what is the value it is stored and it is returning blank. Used below two ways to set Page Item Value.Īpex.item("P1_BROWSER_TZ").setValue(timezone) ĭocument.getElementById("P1_BROWSER_TZ").value = timezone Īnd called this function ( javascript:CallDial() ) on Page Load Event in Dynamic Action. em("P1_BROWSER_TZ").setValue(timezone) ĭocument.getElementById('P1_BROWSER_TZ').value = timezone Var timezone = tz.name() //'Asia/Kolhata' for Indian Time. Var tz = termine() // Determines the time zone of the browser client Below Function is written in Page Function and Global Variable Declaration Section. If the value us getting set? then the issue is in "timeZone". Now as mentioned in the previous post above the problem might lies on "timezone" how is the value beeing passed into it ?įor testing purposes set the value into the item on page Load with a dummy value with one of the options mentioned above pex.item("P1_BROWSER_TZ").setValue(timezone).I will recommend to use the following code: either: Or add your code on " execute when page Loads" of your page. It is possible either with a dynamic action on page load -> true action execute javascript code-> your code Tested by placing Alerts before and after the below statements and everything working fine except setting value to the ("P1_BROWSER_TZ").setValue(timezone) document.getElementById('P1_BROWSER_TZ').value = timezone Is it possible to set Page Item with a value in Javascript when page load ? And below are the two different types we had used to set Page Item with value. 1.7K Training / Learning / Certificationīharat G schrieb:We are trying to set a Page Item with value on Page Load by running Javascript.165.3K Java EE (Java Enterprise Edition).7.9K Oracle Database Express Edition (XE).3.8K Java and JavaScript in the Database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |