Populate text field based on the lov selected value

Hi,
based on the value selected in lov, i want to populate another text field. Below is the code I have written
In PFR:
if(pageContext.isLovEvent())
String lovInputSourceId = pageContext.getParameter(SOURCE_PARAM);
if ("lovCategory".equals(lovInputSourceId))
java.util.Hashtable lovResults = pageContext.getLovResultsFromSession(lovInputSourceId);
if(lovResults!=null)
String value =(String)lovResults.get("lovCategory");
amobj.categorycode(value);
AMImpl code:
public void categorycode(String code) {
sundryCodeVOImpl vobj = getsundryCodeVO1();
vobj.setWhereClause( "lookup_code = "+"'"+code+"'");
vobj.reset();
vobj.executeQuery();
String desc = vobj.first().getAttribute("Description").toString();
String attr = vobj.first().getAttribute("Attribute1").toString();
testEOViewImpl vobj1 = gettestEOView1();
vobj1.getCurrentRow().setAttribute("CodeDescription",desc);
vobj1.getCurrentRow().setAttribute("PurchasingCategoryCd",attr);
vobj1.executeQuery();
With this code, the updated values for the attributes CodeDescription, PurchasingCategoryCd are getting inserted into the database table but they are now showing up in the text fields when a value is selected in lov.
Please tell me what is the mistake I'm doing.
Thanks
Sunny

I'm using Lov Map to populate the lov field say field A. But I need to populate another field say field B based on the value selected in field A.
to give an example of my requirement. Consider a view object having attributes col1,col2,col3 and having following data.
col1--col2--col3
1-----a-------x
2-----b------y
3-----c------z
I 'll populate the lov of field A with values in col1. when user selects value 1 in field A. automatically field B should show value 'a'. If user selects value 2 in field A, field B should show value 'b' so on.
Thanks
Sunny

Similar Messages

  • How to create a form that can auto-populate all fields based on a specific selection?

    We have created a template for each type of package used in our business.  The template is the same but depending on the package selected, the fields would be populated differently.  How can we create a template to load the fields based on the specific package selected?  We use Adobe Acrobat Pro in creating the templates.

    This forum is for the Adobe FormsCentral (http://formscentral.adobe.com) which is a service that allows you to create, collect and analyze data using an online web form. You should ask Acrobat/PDF related form questions in the Acrobat forums:http://forums.adobe.com/community/acrobat/acrobat_windows
    I'll move your post to that forum so you don't need to retype it. They can help you out...
    Randy

  • Automatically update text field depending on the in select list value

    I have got 2 tables. Table A (Employee Personal Detail), Table B (Employee Academic detail). Employee no is common field between two tables).
    I have created interactive report with form on table b using in-built templates. I have added text box on form to display employee name which is stored in table A. I want to automatically display employee name depending upon value in employee no field on form. I know I can write query to get value in employee name field. It gives me error when employee no is blank. How to handle error?

    Sagar,
    For the employee name value to change according to the emp_no, your page needs to get submitted. can you use a select list with submit for emp_no? And then use the PL/SQL mentioned above to run on page submit?
    I'm not sure but I guess you can also achieve this in Ajax. May be someone expert in that could help.

  • Validating text field based on the combination of alphabets and special characters

    Hi Everyone,
    I am Using Oracle Apex 4.2 Version . I want to do validation for a textbox where it should accept all alphabets,numbers and special characters (abc12#$ , zbc, 123, nd12, 23_6!, @%77).
    But it should NOT accept all special characters only.(@#$#!)
    Pelase do help if any knows this.
    Thanks in advance,
    Nikhil.

    Hi Nikhil,
    Here is one way that could work.
    CREATE TABLE t (x VARCHAR2 (30));
    INSERT ALL
    INTO t
    VALUES ('XYZ123')
    INTO t
    VALUES ('XYZ 123')
    INTO t
    VALUES ('xyz 123')
    INTO t
    VALUES ('X1Y2Z3')
    INTO t
    VALUES ('123123')
    INTO t
    VALUES ('abc12#$')
    INTO t
    VALUES ('@%77')
    INTO t
    VALUES ('!@#$')
    INTO t
    VALUES ('~%^&*()_+')
    INTO t
    VALUES ('23_6!')
    INTO t
    VALUES ('zbc')
    INTO t
    VALUES ('123*456')
    SELECT * FROM DUAL;
    SELECT x
    FROM   t
    WHERE  ( Regexp_like (x, '[[:alpha:]]') -- include alpha characters
              OR Regexp_like (x, '[[:digit:]]') -- include numbers
              OR Regexp_like (x, '[[:punct:]]') ) -- include special character
           AND ( Regexp_like (x, '^[^%]*$');
                 AND Regexp_like (x, '^[^*]*$') ) -- exlude special characters % and *
    Jeff

  • Limit the amount of characters of a text field based on first digit

    Hello and thanks in advance for your help!
    I would like to limit the amount of characters of the text field based on the first digit of the number (the text field is only limited to a number format...no decimals, no commas).
    For example, if the number begins with a 3, I would like to limit the text field to allow only ten characters. I have three scenarios but if I could get started with some code and what is the best place to add it (keystroke or validation?) I can take it from there. Thanks again for your help!!

    I've written this code for you that does that. Use it as the field's custom Keystroke code:
    // Validate that only digits are entered
    if (event.change) {
        event.rc = /^\d+$/.test(event.change);
    // Validate string length if it starts with 3
    if (/^3/.test(AFMergeChange(event))) {
        event.rc = AFMergeChange(event).length <= 10;
        if (!event.rc) app.alert("If the number starts with \"3\" it may not be longer than 10 digits.",1); // optional error message
    You can duplicate the second part of it for additional conditions, but keep in mind that this code won't even let you remove the first character in the field if the result is an invalid one.
    For example, if you enter "234567890123456" then you can't remove the "2" at the start because that would result in an invalid number. You can remove any of the other digits, though, and when it's 10 digits or less then you could remove the starting "2" as well.

  • Using JavaScript to auto populate a field based on numeric value of a separate drop down field

    Hello, I am trying to set up a simple, I hope, javascript which will enable to me auto populate one field based on the numberic value of another field using Acrobat Pro XI.
    Essentially I have 2 drop down fields (we'll call them DD1 and DD2).
    DD1 is the sum of 8 preceding drop down values. That sum can be anywhere from 0 - 40. Whatever that sum falls within a range which identifies a rating. The ratings and ranges are below:
    0-8: Non-Performer  
    9-16: Low Performer  
    17-24: Performer  
    25-32: High Performer  
    33-40: Exceptional Performer
    DD2 is where the rating ("non-performer", "low performer", etc.) will be captured. Instead of requiring the user to look at DD1, determine the value, and then identify and input the rating manually, I would like DD2 to auto populate the rating based on the value (sum) in DD1.
    For example, if DD1 shows a value of 27 then DD2 would auto populate "High Performer". So how do I write this code or execute this? In excel I would use an if, then statement. Is there something similar in Acrobat Pro XI.
    Any help is greatly appreciated. Thank you in advance.

    If you use a text field, the custom calculation script could be:
    // Custom calculation script for text field
    (function () {
        var s = getField("DD1").valueAsString;
        // Blank this field if input is blank
        if (!s) {
            event.value = "";
            return;
        // Convert string to number
        var v = +s;
        // Set this field's value based on the input
        if (v <= 40 && v >= 33) {
            event.value = "Exceptional Performer";
            return;
        if (v < 33 && v >= 25) {
            event.value = "High Performer";
            return;
        if (v < 25 && v >= 17) {
            event.value = "Performer";
            return;
        if (v < 17 && v >= 9) {
            event.value = "Low Performer";
            return;
        if (v < 9 && v >= 0) {
            event.value = "Non-Performer";
            return;
        // If none of the above fit, blank this field
        event.value = "";

  • Populate a field based on a drop down or multiple choice

    Would it be possible to add a feature that allows users to populate a field based on the value of another field?
    I'm trying to setup a form where a technician selects their name from a drop down list, and then have the form populate their e-mail address based on their name. I would prefer to avoid forcing them to type in their e-mail address every single time so that they can get a copy of their form responses when they submit a form.
    Thanks!

    Hi,
    Thank you for your feedback. You can vote fo the calculations feature using this form:
    https://adobeformscentral.com/?f=XnF-KJVCovcEVQz9tZHYPQ
    Regards,
    Brian

  • How to auto populate a field based on drop down list unless specific item is selected

    Hi all,
    Apologies if I have posted this in the wrong area but I am new to Adobe LiveCycle, JavaScript and these forums.
    I am trying to build an Acrobat form using LiveCycle but am having trouble with the drop down lists.
    Inititaly I simply wanted to populate fields in one table based on the selection of a corresponding drop down list in another table.
    I used the following code and it worked fine:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1");
    for (var i=0; i <= fFrom.length-1; i++) {
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
    The problem is that now I want the above code to work UNLESS one of the items in the dropdown list is specifically selected in which case I want the text box in the other table to display a message such as "Enter details in the field below".
    I have tried to create an If Else statement using the following code:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1"); 
    for (var i=0; i <= fFrom.length-1; i++) {
         if (fFrom.item(i).rawvalue = "Option 3"){
         fTo.item(i).rawValue = "Enter details in the field below";
         else {
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
    The code now populates the field with "Enter the details in the field below" no matter what item I select from the dropdown list.
    Your help is greatly appreciated.
    Cheers,
    ozzy_q

    Follow Up:
    Ok so ive changed things up a bit and have had some more success.
    I have used a Switch statement in my For loop to perform different actions based on the item selected.
    The code looks like this:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*] .Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[* ].Row4.Cell1");
    for (var i=0; i <= fFrom.length-1; i++) {
         switch (fFrom.item(i).rawValue)
         case "Option 3":
         fTo.item(i).rawValue = "Enter the details in the field below";
         break;
         default:
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
         break;
    This code solves my problem but has thrown up a new issue:
    When i select Option 1 or 2 from the dropdown list  the change in the text field is instantaneous, however if I select Option 3 it wont appear in the text field until I either select Option 3 a second time or select another item. Its as if the text field is a selction behind what I have enterd in the dropdown list.
    Any thoughts?

  • Update a text field based on a SelectOneChoice field

    Hi,
    I have a set of Create, Confirm and Thankyou screens. These screens are bound to a global view object. The create screen has a SelectOneChoice element which allows the user to pick an employee. When the selection is made, I need to display the employee's department in a read only text field below the dropdown. The Employees list(SelectOneChoice) is associated to the read only view object and this view object also has the employee's department information. Im dont know how to set the department name in the text field and refresh the screen. Any help is appreciated. Thank You.

    Frank, thanks for you time. Please see my answers below.
    Hi,
    can you help me creating a reproducable testcase
    based on the HR schema where we have a Departments
    and Employees tables. To understand your usecase I
    have some questions:
    Im not too familiar with HR Schema.
    >
    First of all however, what is a "global view object",
    and is it safe to assume you are using ADF Business
    Components?
    Its the "Globals View Object" as described in the SRDemo for creating a new Service Request and yes I am using ADF Business Components.
    >
    Which version of Oracle JDeveloper do you use ?
    10.1.3
    >
    The usecase I understand is that you have a
    selectOneChoiceList that whenever you select a new
    name should update a read-only text field with the
    department name. Is this correct ? Or is there more
    in it ?
    Heres the complete description. There are 4 fields on the screen
    1. Program Name (text input field, - required field)
    2. Program Category (SelectOneChoice field - required field)
    3. Employee Name (SelectOneChoice field - required field)
    4. Employee Department (Text output field - based on 3 above)
    What you have described above is working for me now, but everytime I select a value for 3, it does the required fields check and gives a message like "1 & 2 are required and a value must be entered", this validation should only occur when my continue button is clicked.
    >
    The department name should be displayed only (read
    only), or is it also bound to what you call "global
    view"?
    Yes its read only but I need to bind to the Globals view as I need to display it in the confirmation screen.
    >
    Also, just to be sure, is the department name part of
    the VO or is it the departmentId?
    The screen is bound to the Globals View, the selectOneChoice values are displayed from another view(EmployeeList view) which has the department name.
    >
    Frank

  • Text field properties-Using the 'required' option in the text field properties.

    Using the required' option in the text field properties.
    The 'help' manual describes the 'required' function as this: Required Forces the user to fill in the selected form field. If the user attempts to submit the form while a required field is blank, an error message appears and the empty required form field is highlighted.
    My users ARE not submitting the form, they open the pdf, fill it out and print it. HOW can I, make a field "required', I don't want them to skip/leave blank specific fields. However, if I choose the box 'required' in the text field properties, and I begin filling out the form, I can just tab past that field that I've choose as 'required', and I do not get
    prompt/error message or anything, it allows me to save, or print.
    I WANT SOME TYPE OF message (similar to enter a company order form
    off the web, where you can't continue without filling out 'required' fields).
    Is there a step/option I am not doing?

    Then you are going to have to write some JavaScirpt to be executed by the "Will Print" document action to check all the requried fields, either by name or by the 'required' property and handle the issue of the imcomplete fields. You will not be able to stop the print, but you could display and error field so the user knows the form is incomplete and the printed form also conatains this information.

  • Can I shrink the size of a form text box based on the content?

    We are helping a customer migrate from some MS Word forms to use pdf forms.  We are screenscraping the data from an AS400 green screen system and populating these new pdf forms with data.  however some of the text boxes are in the middle of a sentence and the text box needs to be large enough to fit 50 characters but there are many times when the data we are entering is much less than 50.  The resulting document looks very strange with all of that extra white space in the middle of a sentence due to the size of the text box.
    So can we somehow shrink the size of the text box to fit the number of characters in the box?
    I considered making the box smaller and setting the font size to auto but I think that would look even more strange to have a word with smaller font in the middle of a sentence.
    Thanks,
    Trent

    Sorry, I should have mentioned I am using acrobat professional 9.  I see that I can change the size of the text field when I am designing the form but what I don't see is how to dynamically change the size of the text field based on what data is put inside it.
    Thanks,

  • How to populate a table based on a row selection from another table.

    Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
    By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
    ganesh

    I understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
    I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
    Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
    Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
    "EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
    This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
    Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
    Hope this helps.

  • Auto populate text fields with a trigger such as entering text into input fields in ADF

    Hello all,
    I am not able to auto populate text fields with a trigger such as entering text into input fields in ADF.
    I tried AdfFacesContext.getCurrentInstance().addPartialTarget(val); in the back end using setter method of input text field.
    its not working ..
    is there any way to achieve it
    Regards,
    Shakir

    Hi,
    Always mention your JDev version.
    The valueChangeListener would fire only when you set the autoSubmit property of the field to true. Can you elaborate your requirement? What do you mean by related data? Are you performing some sort of search?
    If you want to get the value you entered on the field, just set autoSubmit to true and get the new value from the valueChangeListener. If your requirement is something like as and when you type, do something, you need to check out this approach :https://blogs.oracle.com/groundside/entry/auto_reduce_search_sample
    -Arun

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • Payment medium - Text fields shifted to the left

    Hello Experts,
    after running the payment run, the payment media is created but the text fields that are written in the files are shifted to the left.
    The files contains 4 text fields. In the first text field should be written the value LS_REF1 and in the second one the value LS_REF3
    If LSREF1 is blanc, then the value of LS_REF3 is written in the first text field.
    Is it possible to avoid that SAP shift the fields to the left? In the function module FKK_PAYM_DEDIUM_WRITE is used the FM FKK_DME_DETAILS_FILL, which shift the values.
    Cheers and thanks in advance
    Edited by: prashak80 on Jul 23, 2010 12:16 PM

    In the respective field properties (double click the field node), goto Attributes tab.  There you'll find a field 'Conv. function'.  Press F4. You'll be presented with many functions.  Scroll down and find functions starting with C.  Select the one that best suits your needs.  This is for maintaining the alignment within the field output.
    If your problem is that REF1 field is skipped when there are no values and that's what is causing the alignment as REF3 is shifted to that extent, then you need REF1 field to output at any cost irrespective of any values are present. In this case, check the status filed in the same tab.  The status field should be blank (standard).
    You can also consider Target offset field.  This will offset as many number of characters in the output field.  You might have to play with these settings.
    Hope this helps.
    Ravi.

Maybe you are looking for