TextInput onChange Event

Hello,
We are new to JDeveloper. Looking for an example on how to set a field value based on another field. Scenario:
An view was dragged as an input form to a UIX page. It has two fields. The fields are set as messageTextInput. The second field value should be a percentage of value entered in the first field. We created an 'onChange' event in the first field. Also created an event handler in the structure. Should we now create a method for calculation. If so, is there a sample code to review?
Any suggestions will be much appreciated!
Thanks, Ali.

If i understood right, you want to do some action in your
main application file when the TextInput (item renderer) throws
some event.
In order to achieve this. In your main application, add a
listener to the application object for the event thrown by your
custom component. In order to find out which object instance of the
custom component invoked the event, send some object with data to
identify the object instance in the event.
Hope this helps.

Similar Messages

  • How to refresh the Expired Login Form on the onChange event of the password

    Hi,
    In the Expired Login Form I have places a custom label. My requirement is that on the onchange event of the password field the label color should change to orange if the entered password meets the password policy else red.
    I am trying the following code :
    Custom label:
    <Field name='Custom Label'>
    <Display class='Label'>
    <Property name='value' value='Custom label 1'/>
    <Property name='noNewRow'>
    <Boolean>true</Boolean>
    </Property>
    <Property name='color'>
    <block>
    <cond>
    <isTrue>
    <invoke name='checkStringQualityPolicy' class='com.waveset.ui.FormUtil'>
    <rule name='EndUserRuleLibrary:getCallerSession'/>
    <s>Default Password Policy</s>
    <invoke name='decryptToString'>
    <ref>resourceAccounts.password</ref>
    </invoke>
    <map/>
    <list/>
    <s>Configurator</s>
    </invoke>
    </isTrue>
    <s>orange</s>
    <s>red</s>
    </cond>
    </block>
    </Property>
    </Display>
    </Field>
    And on the password field i gave following in the onChange event:
    submitCommand(this.form, "Recalculate")
    But the above command is not refreshing the page. Instead on the onChange event its going back to the login.jsp.
    Any idea how to resolve the above issue.
    Thanks.

    I got it working as below but i dont know is this best practices?
    <%
        if(session.getAttribute("afterSet") != null){
             %>
        <div style="visibility:hidden">
          <iframe NAME="iframe1" src="/WebApplication2/TestController?fileDownload=test.pdf" WIDTH="40" HEIGHT="40"></iframe>
        </div>
        <%}       basically first time user visit the jsp page session attribute "afterSet" will be null so it wont create the hidden iframe tag . after it dispatched to the servlet controller and successfully processing the record it will set "afterSet" properties to some value and dispatch to itself
    after that it will popup/dialog box for user to save the pdf.
    this way the page already refreshes itself and wont have problem double clicking thing and so on

  • Have an onchange event in SPD to update a list based on user selection of data view drop down?

    Hoping someone can point me in the right direction: I have a list for Media announcements, each one of these announcements will have various types of documents associated (via look up field in the doc library). I am trying to have a data form web part (dropdown)
    as the selector (as I am not liking the SharePoint list filter feature) to have a user be able to select the Media Title, then it refreshes the three web parts on the page (1 for the announcement, then one for type1 docs and one for type 2 docs.)
    What is the best way to create an onchange event to have the selected option be connected to the first web part (media title on a list view) so that the information on the page can all be filtered?

    Hi,
    Would you mind providing more details about your requirement? Are there one Announcements list and two Document Library in a page?
    Suppose you have one Announcements list and two Document Library in a page, then you want to add a Drop Down Menu(not the OOTB SharePoint List Filter Web Part) to filter the
    three List View Web Part dynamically.
    There will be two workarounds:
    1. Use the OOTB “Connections” feature of the list to “Get Filter Values From” one of the three lists, then there will be a “Select” button in that list, we can click it to filter
    other two lists/libraries. This is a way without code though we may not have the Drop Down Menu;
    2. Add three <iframe> in a page, then add a Drop Down Menu in this page. Now, we will need some JavaScript to listen to the onchange event of this Drop Down Menu. We can
    get the values populated in the Drop Down Menu from one of the column of one of the list, when making a selection in it, we can pass an URL with query strings to the three iframes which will show the three different lists or libraries.
    The second way requires some code to interact with Client Object Model cause we need to get values from a list, some script to handle the onchange event, which seems more suit
    with your need.
    Here are some links might be helpful if you want to take the second way:
    About how to find a specific element on a page using JavaScript:
    http://javascript.info/tutorial/searching-elements-dom
    Handle the onchange event using jQuery.change function:
    http://api.jquery.com/change/
    About query string to filter a list view:
    http://techtrainingnotes.blogspot.com/2012/03/sharepoint-search-filter-or-sort-lists.html
    About change the src attribute of iframe:
    http://stackoverflow.com/questions/3730159/changing-iframe-src-with-javascript
    http://www.w3schools.com/jsref/prop_frame_src.asp
    Best regards
    Patrick Liang
    TechNet Community Support

  • How can I trigger an onchange event for hidden or never displayed item

    hi -- I have an item that I don't want displayed on my page -- more info than the user wants or needs; call it B. It needs to be
    set by an onchange event from a visible item (A); then, the change of B triggers on onchange to set another item (visible) -- C.
    When B is visible on the page, it all works. If I make it hidden or conditionally never displayed, it doesn't work. From the looks of
    it, B never gets changed.
    How can I trigger this onchange event (from B to set C) with B not visible?
    Thanks,
    Carol

    hi Varad -- Probably more info than you want... but here's the whole chain of events.
    Hope it answers your question.
    C
    **** 1
    In A's html form element attributes (simplified; I took out the irrelevant call to jsLookupValue that sets another item).
    onchange='jsLookupValue($v("P142_SITE_ID"),"site_id","P142_OBJECTTYPE_ID","objecttype_id","hdb_site_syn");'
    **** 2
    jsLookupValue is the following.
    The statement that actually sets the value of B is: $s(dest_item_name, jsonobj.row[0].RETURN_VAL);
    function jsLookupValue(source_item_value, source_column_name, dest_item_name, dest_column_name, lookup_table_name){
    // Continue only if there are valid values
    if (valueOf(source_column_name)&&valueOf(dest_item_name)&&valueOf(dest_column_name)&&valueOf(lookup_table_name)){
    //Check to see if the source_item_value is null (either all spaces or empty
    //If it is, set the dest item to null, but only if it's not already --
    //otherwise we get into a loop.
    source_item_value = trim(source_item_value);
    dest_item_value = trim($v(dest_item_name));
    if (source_item_value.length==0) {
    if (dest_item_value.length != 0) {
    $s(dest_item_name, null);
    }else{
    //This is the AJAX call to the Application Process from step 1
    ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=LOOKUP_VALUE',0);
    //Here we are adding that x01 parameter we use in the app process with the value of the objecttype_name field
    ajaxRequest.addParam('x01', source_item_value);
    ajaxRequest.addParam('x02', source_column_name);
    ajaxRequest.addParam('x03', dest_item_name);
    ajaxRequest.addParam('x04', dest_column_name);
    ajaxRequest.addParam('x05', lookup_table_name);
    //Now do the actual AJAX call and put the result in ajaxResponse
    ajaxResponse = ajaxRequest.get();
    //Check if there is a response
    if (ajaxResponse) {
    //We need to format the JSON return string and put it in a JSON object
    // the formatting is done by a function in the external JSON library
    // the jsonobj can be used to retrieve the data returned by the App process
    var jsonobj= ajaxResponse.parseJSON();
    // And finally, we set the DNAME item with the value of the jsonobj.DNAME
    // an array was created in the object with the name row, so that is why you have to include row[0] to retrieve the data
    if (jsonobj.row[0].RETURN_VAL != $v(dest_item_name)) {
    $s(dest_item_name, jsonobj.row[0].RETURN_VAL);
    }else{
    } //not setting
    }else{
    alert('No response from app process');
    } //no response
    } //no source item value
    } //no bad nulls
    } //function
    **** 3
    I won't bore you with app process LOOKUP_VALUE. It just builds an sql query that gets the value for B, aliased to RETURN_VAL.

  • Apex 3.2, How to use an onchange event with Popup Key LOV - it ignores me.

    Hoping there is a simple solution to this.
    Using Apex 3.2 with a simple form with a few fields. When the user selects a value from a Popup Key LOV, I want to fire a javascript onchange event and alter another field on the form.
    Seems simple enough, except that I can't figure out how to make the PopUp respond to onchange events. The default template seems to ignore javascript entered into the attribute fields that work in other form fields. I know this is simple do to for a select list - it works as expected there. A select list is not a good option because of the huge number of possible returned values.
    Even tried a different approach...to register the onchange event using the "addLoadEvent" with this code (this also does not work):
    function setThisUp() {
    var x = document.getElementById('P105_CTR_ID');
    x.onClick = popupLovChanged;
    function popupLovChanged() {
    alert('OMG IT WORKS!');
    addLoadEvent(setThisUp);
    If any of you have some advice on how to make onchange work, it would be greatly appreciated.
    Thanks in advance
    -Rich

    For those still looking for a solution.
    I found that you can overwrite the default javascript function passback(x) in the popup lov's template, just add your function in the After Field Text field of the template
    e.g.
    <script> function passBack(x) {
    opener.document.getElementById('P2_PROGRAMME').value = x;
    opener.document.getElementById('P2_PROGRAMME').focus();
    close();
    } </script>
    this is going to populate the 'P2_PROGRAMME' field with selected value, and focus on it.
    in your case, just add the codes you want to run into the passback function.
    hope this helps

  • Tabular form with Popuv LOV doesn't work with onchange event

    Hi all.
    I have a problem with tabular forms, Popuv LOVs and javascript.
    I have created one tabular form, I want to put a value in "my_field" field when a user selects a new value from other field called "my_list", I have this code:
    <script type="text/javascript">
    function putValue(pThis)
        var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        html_GetElement('f06_'+vRow).value = '0000';
    </script>and this for Element Attributes:
    onchange="putValue(this);"Everything works well when I choose "Display as Text Field", but if I change this option to "Display as Popup KEY LOV" or "Popup LOV" it doesn't work, I mean "my_field" stays without any value.
    I'm using Oracle Application Express Release 4.0 and Oracle 11g
    Please help.
    Regards.

    Hi Peter.
    Thanks, yes, in fact the position of my column changes, but it doesn't work even with the correct element, I have made a lot of proves and it seems that APEX constructs POPUPS LOVS in a different way and that's why "onchange" does not work.
    With this thread: Re: onchange not work on popup lov for a field on collection I have a half solution, It works for existing rows, but it doesn't for added rows.
    I have solved this problem calling a function that set the onchange event to every row when "ADD ROW" button is pressed, now it works without problems.
    Regards.
    Oscar.

  • Passing collection in JSTL html:select onChange event javascript

    I'm trying to pass an object from the form to a javascript function to change text box values when the value of a select field is changed.
    On the jsp page, I have access to the collection called rows.
    I also have an html:select field that I need to use the onChange event to change other fields on the page. I can certainly call a javascript function on the onChange with no problem. But I need to take it one step further. I need to send the javascript function the collection called rows, so I can set other fields' values on the jsp page to the values of the selected row.
    This (or some facimile) is what I want to do:
    <html:select name="currentForm" property="value(id)" onChange="fillUomForm(this.form,this,rows);">
      <c:forEach var="row" items="${rows}">
          <c:choose>
               <c:when test='${row.id == currentForm.stringValues["id"]}'>
                    <option value="<c:out value='${row.id}'/>" selected>
                         <c:out value="${row.id}"/>
                    </option>
               </c:when>
               <c:otherwise>
                     <option value="<c:out value='${row.id}'/>">
                        <c:out value="${row.id}"/>
                     </option>
               </c:otherwise>
           </c:choose>
        </c:forEach>
    </html:select>Of course, rows is not recognized when I try to run this.
    I have tried replacing rows with
    <c:out value='${rows}'/> but that did not work.
    How can I do this?
    thanks,
    Walter

    sigh.
    Another user mixing up JAVA and javaSCRIPT.
    Java runs on the server. It generates an HTML page, and stops running.
    When the client receives the HTML page it can start running javascript.
    The only way java code is run again is if you make another http request. - ie the next time you click a link or submit a form.
    Most of the time that results in reloading a new page.
    You have two options
    1 - Download all the information you might possibly want/need as part of the JSP page. Then the javascript onclick event can retrieve it from javascript memory.
    2 - Make the onchange event submit an HTTP request, and then pick up the response, and do with it what it will. AJAX is a technology that lets you update the page without refreshing it completely.
    Hope this helps,
    evnafets

  • OnChange Event not working when portlet is opened in Page

    The onChange event is working well in a Portlet. When a user selects a value from an LOV it is updating other LOVs. However, when that portlet is brought into the main page, the onChange event only resets the page. Is there a workaround for this?

    Hi Jerry,
    Iam also facing the same problem ....were you able to get solution ..if yes plz share...
    When I Clikced on Add Macros button in Workbook Settings ,i was able to access the buttons ..but once i close and open the workbook iam again getting the same error..
    Iam not able to Save the Workbook settings afte Clicking on ADD Macros...
    Regards,
    Ravi

  • Tabular Form : Select list : onchange event

    I need a method / example to apply an Onchange event to a Select List in Tabular form.
    Whenever an item from the select list is selected, the data from other column of the same or different Table should get displayed,
    in a Textfield of the Tabular form.
    Yogesh

    Hi,
    Here is one example
    http://apex.oracle.com/pls/otn/f?p=31517:176
    Br, Jari

  • JavaScript Async Method call on the OnChange event of a lookup

    Hello,
    I try to fill dynamically a lookup-multi field by selecting a value in a dropdownlist based on a lookup field.
    I recreated the onchange event of my dropdowlist by using this code :
    lookupElement.onchange = function () { OnFormationChanged() };
    When a user select an element in the dropdownlist, "OnFormationChanged" event run an Async method who retrieve elements joined with the selected element in the dropdownlist lookup.
    This part works fine, it automatically refresh the multi lookup field but when i save my custom page I got the error :
    Value does
    not fall within expected range
    When I do alert in the OnFormationChanged, it retrieve me for example '0' in the onChange event and '3' in the Asynch event as you can see in this screenshot :
    I deduced that the save event method take a wrong result.
    For example :
    A : If I select in the lookup dropdownlist an element with no attached result in the multi lookup, I will have '0' in the "OnFormationChanged" method and '0' in the "OnQuerySucceeded" method and the multilookup will be empty.
    B : If NOW I select in the lookup dropdownlist an element with results in the multi lookup, I will have '0' in the "OnFormationChanged" method and '3' in the OnQuerySucceeded" method and the multilookup will be filled.
    But when I save the custom page I will have the error : Value does not fall within expected range as if async result was not recognized by the save button. 
    Something seems not to be set correctly.Could you give me a way to resolve this issue ?
    DkPoo.

    To close this post, I finally redefinied the save event and it works nicelly now !

  • Trying to use set_value in onChange event handler

    Is it acceptable to use p_session.set_value in the onChange event handler?
    I am trying to do a couple of things in this event handler, I am trying to validate a code and if the code is invalid I wish to
    show an alert. If the code is valid I then wish to fill another field with a value from the database. Both fields I am working
    with in the event handler are table columns. I have not been able to track down a specific error message, however, when
    I view source the code for this is blinking. Here is what I am trying, in the onChange event handler.
    declare
    l_acct varchar2(21);
    l_codeid number;
    begin
    l_acct := p_session.get_value
    (p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_CONCATENATED_ACCT',
    p_index => 1);
    if l_acct is not null then
    select code_combination_id
    into l_codeid
    from webapp1.an_code_combinations_v
    where concatenated_acct = l_acct;
    if sql%found then
    p_session.set_value
    (p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_CODE_COMBINATION_ID',
    p_index => 1,
    p_value => l_codeid);
    else
    --- how can I display an alert?????
    end if;
    end if;
    end;
    Any suggestions on how to show an alert, and how to display values into fields would be very helpful.

    I think you are trying to use PL/SQL in the JAVASCRIPT onChange event handler. What you need to do is use JAVASCRIPT.
    Put the following function on the (... before displaying the page) option on the Additional PL/SQL page.
    Javascript function that loop through all fields on a form.
    Set value Example:
    htp.p('<script language = "JavaScript1.3">
    function setCommValue(form,target,value)
    var itemname;
    for(var i = 0; i < form.length; i++)
    itemname = form.elements.name.split(".");
    if (itemname[2] == target)
    form.elements[i].value = value;
    </script>');
    You can call the above code from a Javascript Event Handler for a Form item. Example: (an item's OnChange Event)
    setCommValue(this.form,'SITE_ID',this.value);
    Good Luck and let us know if you experience in Lessons Learned.
    Thanks,
    Linda Gowen

  • SQL dependency OnChange event constantly when using a specific database on SQL server

    Hello
    I did some prototype dev using a new db I created on our dev SQL server instance and OnChange events only when the underlying data was changed. I tried the same thing with another database on the same server which is a replica of our live database. With
    this it just kept firing the event regardless of what activity there was in the table. I even created a totally empty table and used that for the query and it still fired on an empty table.
    Is there anything obvious that I need to do to this database to stop this? I'm pretty sure my c#is ok just confused by this
    Thanks,
    Dave.

    On the db where it works the properties in the SqlNotificationEventArgs are different to the one that does not work:
    So it looks as though for some reason it never gets to subscribe to this event.
    I tried using ssbdiagnose but to be honest I don't know what the From Service and To Service parameters are in my case.
    Here's what I got anyway:
    C:\Program Files\Microsoft SQL Server\100\Tools\Binn>ssbdiagnose -E -d BMC_Ecomm
    erce CONFIGURATION FROM SERVICE /test/initiator TO SERVICE /test/target
    Microsoft SQL Server 10.50.1600.1
    Service Broker Diagnostic Utility
    D  29997 W28SDEV05       Transport       Service Broker GUID is identical to tha
    t of database DynamicRouting on server W28SDEV05
    D  29997 W28SDEV05       Transport-TempRename Service Broker GUID is identical t
    o that of database DynamicRouting on server W28SDEV05
    D  29912 W28SDEV05       BMC_Ecommerce   Service /test/initiator was not found
    D  29912 W28SDEV05       BMC_Ecommerce   Service /test/target was not found
    D  29931 W28SDEV05       BMC_Ecommerce   There is no route for service /test/tar
    get
    D  29931 W28SDEV05       BMC_Ecommerce   There is no route for service /test/ini
    tiator and broker instance BB64B7AA-5C39-404B-B7A9-81D3756A4C60
    D  29964 W28SDEV05       BMC_Ecommerce   The master key was not found
    7 Errors, 0 Warnings
    Worth noting that the one that worked gets the same results with ssbdiagnose 
    SELECT service_broker_guid
    FROM sys.databases
    WHERE database_id = DB_ID(); 
    ran in DynamicRouting gives : 4AC2C25B-E612-44B2-BC43-687F918ABD16
    SELECT service_broker_guid
    FROM sys.databases
    WHERE database_id = DB_ID(); 
    ran in BMC_Ecommerce gives : BB64B7AA-5C39-404B-B7A9-81D3756A4C60

  • New jsp to be included on onChange event

    Hi,
    I have a dropdown box in JSP... Based on the selection I make in it, a new jsp is to be included in the same page.How do i do that with an onChange event?
    Any help is appreciated.
    Thanks in advance

    reload ur page on each change event

  • What is exact differernce of at new and at onchange events?

    hello,
    what is exact differernce of at new and at onchange events?
    paramesh.kalluri

    Hi,
    Usually beofoer processing any internal table,
    we use the conrtrol events (AT NEW, AT FIRST, ON CHANGE OF etc) for better formatting options.
    When ever we go for these events, its better to sort the table by key fields .
    AT NEW-
    1) Only opne field can be given.
    2) It is a event that is used only with in a internal tabel (LOOP and ENDLOOP) processing.
    for ex:
    Assume internal table has these fields-
    spfli- carrid, connid, fldate.
    loop ..
    at new connid.
    endat.
    endloop.
    case 1.
    at new connid.
    On every new value, ie the comobination of both carrid,connid is checked here. For every new combination of both, the control jumps to next statement.
    case 2.
    at new carrid.
    here for every new carrid the event is triggered.
    AT NEW <field>- here the position of this field is important in table. based on this postiion it will check the proir feilds aslo
    into consideration for trigeerring the event.
    ON CHANGE OF <field1> field2>...
    1) here we can give any number if fields.
    2) the position of the field1 is not considered in the internal table.
    3) Its usually used in support projects.
    4) If we use this, then its a performance issue because,
    internally the field1 is stored in the other filed and this is used to compare for change in value. This rechacking is done internally. Hence it is not used mostly except in support projects.
    For ex: on change of connid.
    here only for every change in only connid is considered not the prior field ie carrid included. here the position of connid in internal table is not considered.
    On change of connid fldate.
    here exclusively both are cheked the combination is not considered. separately connid and fldate are cheked. for every new value the evvent is trigggered.
    Reward if useful.
    Chandralekha

  • Webdynpro abap onChange event for input

    Hello,
    I wanted to know if "onChange" event for input field is somehow possible in wd abap or if it is planned for next ehp releases
    of ECC6.
    (Like in Developer studio 7.11)
    thanks.

    Hi Thomas,
    Opening in on a Very old post, but i kind of need an onChange event functionality in one of my Web App. Basically we are dealing with a input field which is populated using a barcode scanner and the user wishes to be able to pull all the information related to the material number read by the scanner in an Input Field Element and display the related info in other fields "Without having to hit ENTER". Sounds a bit lazy but thts wht they need.
    I was wondering if its possible to modify the SuggestValue functionality to implement such an event. Any pointers to documents which explain how the SuggestValue works? I am just looking for code blocks (even if they are AJAX/Javascripts) tht i can somehow modify to make this thing work.
    P.S. Also if there is any other functionality already introduced by SAP since the last comment on this thread to help solve this will be helpful too
    Thanks,
    Parth

Maybe you are looking for