How to set a dropdown display value

I know how to access the current value of a dropdown box. But how can I set it?
I have a dropdown box and one of the choices is 'Other'. When 'Other' is selected, a text box is enabled so the user can describe what they mean by 'Other'. Now, I want to make the dropdown more robust where if after selecting 'Other' and providing a comment the user willingly or not makes a different selection, the user is warned that the 'Other' description will be deleted with a choice to proceed or not. If the user proceeds the description is deleted and the text box disabled; if the user doesn't want to proceed with the deletion the text box is left enabled with its value untouched and the dropdown value is reset to 'Other'. This is the part that I can't figure out: how do I reset the display value of the dropdown?
Thanks for the help!
Marc

Ok, thanks Malcolm. Yes, you were correct about using the rawValue property to reset the selected value of the dropdown.
Why I got so confused is because all my scripting, including trying to reset the newly selected value, was done in the Change event of the dropdown. The rawValue property 'appears' to behave differently here I think because of the order of the events, where it holds the original value through the whole selection process. So essentially, the rawValue during the Change event doesn't hold the newly selected value and will not hold it until the Change event is fully completed.
So I was able to reset the selected value through the Exit event by using a form variable whose value I set in the Change event. So my Change event uses this line at the right location in my script:
cancelDDSelection.value = "yes";
and my Exit event uses the following;
if (cancelDDSelection.value == "yes") //if the Change event reset this form variable to 'yes'
this.rawValue = "Other"; //reset the selected value to 'Other'
cancelDDSelection.value = "no"; //reset the form variable to its default value
Not sure if there's a better to do this, but all works as I wanted it to now.
Marc

Similar Messages

  • How to set jButton to display hourglass while executing.

    Hi All,
    How to set jButton to display hourglass while executing.
    Here is my code:
        private JButton jButton5 = new JButton();
        jButton5.setText("Refresh");
        jButton5.setBounds(new Rectangle(805, 35, 145, 25));
        jButton5.setBackground(Color.green);
        jButton5.setFont(new Font("Tahoma", 1, 15));
        jButton5.setForeground(Color.blue);
        jButton5.setSize(new Dimension(145, 25));
        jButton5.setModel((ButtonModel)panelBinding.bindUIControl("Execute",jButton5));Thanks.

    user38000 wrote:
    I do not have much experience with Java, my background is database admin, could you please spell out syntax and where introduce hourglass behavior based on the code I posted.While bobear may post his code, my recommendation in this situation is that you are always better to use the advice given, the API and the tutorials to first try to do this yourself and see what happens. Then if it fails, come back with your code attempt.
    One concern of mine, and my main reason for posting is that it seems like your JButton will initialize a task that may take a bit of time to perform (hence the need for the hour-glass). I just want to make sure that you call this task in a background thread such as within a SwingWorker's doInBackground() method. For more on this, please google the Sun tutorial on Concurrency in Swing.
    Much luck!

  • How to set max row display rows in PO's PLD

    Hi,
    How to set max row display rows in PO's PLD
    Thanks and Best Regards
    Bruce

    Hi
    Max. Rows per Page is depend on PLD Settings and Depend on Repetitive Area Fieds Height.
    Try this,
    1st Case:
    ->> Administration Module.
    ->> System Initialization.
    ->> Open the Print Perferences Window.
    ->> Click General Tab on Print Perferences Window.
    ->> Assign the Max. Rows per Page - 99 (or) your wishes.
    ->> Update the Print Perferences.
    2nd Case:
    ->> Open your PLD.
    ->> Choose Repetitive Area on Field Index Window.
    ->> Click Format Tab on Properties Area Window.
    ->> Assign the Lines in Repetitive Area - Your Wishes .
    ->> Save the PLD.
    Regards,
    Madhan.

  • How to set a payload field value only once for multiple instances selected?

    The user needs to set a payload field value and then he can approve the task so the task can continue through the process, that's fine when the user selects one instance and sets the value in the task details section and then clicks the approve button, but how do we achieve the same behavior in a multiple way?, I mean the user can select multiple tasks in the workspace (in this case the details task page is not available and instead the following label appear "Multiple tasks selected") then if the user clicks the Actions drop down -> APPROVE he only gets the message "your request was processed successfully", so how can the user modify the payload field value only once for all the selected tasks so when he clicks APPROVE the value is populated in all the instances selected.
    Thanks,
    Carlos.

    In the action which displays the edit page just set the form idx value before displaying the jsp.

  • How to set a default integer value in a form

    I have a form defined as follows:
    =================================================
    public static class ProjectForm extends FormData
    private int idx;
    private String name;
    private String projectNumber;
    private String description;
    public void setIdx(int index)
    this.idx = idx;
    public int getIdx(){
    return this.idx;
    public void setName(String name)
    this.name = name;
    public String getName()
    return this.name;
    public void setDescription(String description)
    this.description = description;
    public String getDescription()
    return this.description;
    public void setProjectNumber(String projectNumber)
    this.projectNumber = projectNumber;
    public String getProjectNumber()
    return this.projectNumber;
    ======================================================
    When I add a new entry into the database, I have no issues. However, when I want to modify an entry I run into some issues with the idx entry. For some reason, I cannot set a default value into the netui:label tag. My jsp code is as follows:
    ===================================================
    <tr valign="top">
    <td>
    Index:
    </td>
    <td>
    <netui:label value="{actionForm.idx}"
    defaultValue="{pageFlow.project.idx}"/>
    </td>
    </tr>
    <tr valign="top">
    <td>
    Name:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.name}"
    defaultValue="{pageFlow.project.name}"/>
    </td>
    </tr>
    <tr valign="top">
    <td>
    ProjectNumber:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.projectNumber}"
    defaultValue="{pageFlow.project.projNum}"/>
    </td>
    <tr valign="top">
    <td>
    Description:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.description}"
    defaultValue="{pageFlow.project.description}"/>
    </td>
    </tr>
    ======================================================
    The the project class is passes into the page and has the appropriate values. The name, project number and description fields work as I would expect. However, the idx value is alway '0'. If I print out pageFlow.project.idx it has the correct value.
    How do I fix this? My feeling is that it is related to the form field being an int and not a string. The default parameter indicates that is only works with null values, and ints default to zero. Do I need to use an Integer value instead in the form, or just stay away from non-string form fields.
    Thank for the help!!
    --John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    In the action which displays the edit page just set the form idx value before displaying the jsp.

  • How to set the default context value for flexfield in OAFramework pages

    Hi,
    I have a page which contains a contexxt value field i.e Flexfields
    To select the context value we have to select the value from drop down
    So Here we want to display the context value immediately when the page is called
    How to set the default valu in this case
    Regards,
    Krishna

    You can set the Attribute category view attribute to the Flexfield context value and call prepareforRendering in the flex bean. Check the dev guide for details.
    Regards
    Sumit

  • How to set the radiogroup default value?

    I have created a radiogroup named P521_SIZE_NUM(Dealsize, DealNum) and want DealSize is checked when the page is showed. how can I set default value in the page Definition?

    If you made a radio group off of the following static LOV:
    STATIC2:One;1,Two;2,Three;3if you set the default value of your radio group to 2, the radio button with the label Two will be selected. You have to make sure to set the default value to the actual return value not the display value.
    -Ghoulies

  • How to set up my display to be the main view HELP

    How to set up my external display automatically work as the main display when plugged into my MacBook Pro. I had it set up to work this way on my old MBP but I got a new MBP with Mountian Lion and the Display set up seen different and I can figure out how to make my Apple HD display (about 3 years old) be the main display when I turn on my MBP. Mirror is off when I look at
    System pref’s – Display – Arrangement I just get to pick which display is left and right. I cant remember how it was set up on my old MBP. Mirroring does me no good. Any help will do!!!
    Thanks Brad

    In System Preferences > Displays > Arrangement tab.  Drag the little grey rectangular "menubar" to the other monitor.

  • How to set a form element value using javascript?

    Hello,
    I have been using the following two functions in AS 9.0.2 to set form values in javascript and it works correctly. However, the same code does not work in AS 10.1.2.0.2. Would appreciate if someone could let me know how to set form elements using Javascript(onchange of a field).
    function set_item_value(p_field_name, p_value)
    var v_index, v_full_name;
    for(v_index=0; v_index<document.forms[0].length; v_index++)
    v_full_name = document.forms[0].elements[v_index].name.split
    if (v_full_name[2] == p_field_name)
    document.forms[0].elements[v_index].value = p_value;
    function get_item_value(p_field_name)
    var v_index, v_full_name, v_return="";
    for(v_index=0; v_index<document.forms[0].length; v_index++)
    v_full_name = document.forms[0].elements[v_index].name.split
    if(v_full_name[2] == p_field_name)
    if(document.forms[0].elements[v_index].type != "radio")
    v_return = document.forms[0].elements[v_index].value;
    else
    if(document.forms[0].elements[v_index].checked)
    v_return = document.forms[0].elements[v_index].value;
    if(v_return == " ")
    v_return = "";
    return v_return;
    Thanks
    Dev

    This is not the best way to write JavaScript in Portal environment!
    You can't be sure that a form is the first in the html source!
    In Portal you change the order of your portlets, and also you can have several instances of the same portlet on the same page!!!
    You should use qualified form and field names!
    Please check the following JPDK methods:
    UrlUtils.htmlFormName
    HttpPortletRendererUtil.portletParameter

  • How to set radio group default value

    Hi,
    I have a radio group in a portal form. How do I set one of them as checked when the form comes up?
    Thanks;
    Kelly.

    It might be possible with javascript. since a radio group is an array, you should loop
    through the index to set the correct
    checked value.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    Kelly,
    I tried that already, and it still didn't work. Any idea? I am using portal version 3.0.6.
    Thanks;
    Kelly.
    <HR></BLOCKQUOTE>
    null

  • How to set a variable's value from job output

    Can anyone point me at documentation on how to set the value of a variable based on the output of a job? We are running TES v6.0.2.153.
    The Agent/Adapter is a Linux command line, so the Command could be for example:
    echo foo
    and I would like a variable named bar to contain the value foo.  (Obviously in real life the variable value would be dependent on what the command output)
    Thanks in advance,
    Martin

    One more nugget: to parse the response from a command from a UNIX/Linux agent for a specific string and store that in a variable, I followed Rami's advice and then had to find the string in the output.
    The below example puts the first digit of a random number in the variable:
    Job Command:
    bash -c
    Command Parameters:
    "'echo' Random number is $RANDOM | perl -ple 's/.*Random number is (\d{1}).*/\1/'"
    Note that your command itself (in this case "echo") cannot be put in the Command box, otherwise TES does not interpret the Command Parameters correctly.  So you need to set the Command to "bash -c" (run the command in the parameter string), and enter your command and parameters within double quotes in the Command Parameters, with the command being run (in this case "echo") in single quotes at the beginning.
    (I also had to make my .bash_profile run without any output to avoid it being prefixed to the variable value.)
    Hope this helps,
    Martin.

  • JList: how a set a "name" and "value" for a element

    my JList
    DefaultListModel listMBuddy;
    JList listBuddy;
    listMBuddy = new DefaultListModel();
    listBuddy = new JList(listMBuddy);
    listMBuddy.insertElementAt("buddy name 1", listMBuddy.size());
    listMBuddy.insertElementAt("buddy name 2", listMBuddy.size());
    listMBuddy.insertElementAt("buddy name 3", listMBuddy.size());a string "buddy name 1" will be show in JList, it is like a name of element.
    how i set value for "buddy name 1"? like html
    <select>
    <option value="5">buddy name 1</option>
    <option value="7">buddy name 2</option>
    <option value="2">buddy name 3</option>
    </select>
    thanks

    You have to write your own renderer.
    example:
    public class MyListsRenderer extends JPanel implements ListCellRenderer {
         JTextArea t;
         private LinkedHashMap<Integer, String> departmentsList;
         private LinkedHashMap<Integer, Boolean> checkedList;
         public MyListsRenderer(int tabSize) {
              t = new JTextArea();
              t.setTabSize(tabSize);
         public Component getListCellRendererComponent(JList list, Object value,
                   int index, boolean isSelected, boolean cellHasFocus) {
              Integer id = (Integer) value;
              // you need to create class that get an id (value) and return name
              //this is my example:
              String name = Contacts.getInstance().getContacts().get(
                        (Integer) value);
              t.setText(name);//this is the text in the list row
              add(t);
              return this;
    }

  • HOW TO SET A ITEM DEFAULT VALUE  to today

    I have a item using select list and I like to set this item default value as
    today's date , such as "select to_char(sysdate,'YYYY-MM-DD') from dual"
    HTMLDB failed recongnize the default value, or throw error Error ERR-9132 Error in PLSQL expression for item default code, ...". I have tried each of 3 avaialable Default Value Types
    Per http://forums.oracle.com/forums/thread.jspa?messageID=443287, it is used to be doable, but the default value type (sql) is no longer avaialble in HTMLDB 2.0
    I would appreaciate it very much if anyone has successfully done this before, either set to today or current month

    Ching - Did you try a PL/SQL Expression using to_char(sysdate,'YYYY-MM-DD')?
    There have been no changes to the item default types available in HTML DB. The thread you referenced is for Oracle Portal, a separate and unrelated product.
    Scott

  • How to set a 3 default values for a dependent key flexfield

    hi,
    I have an inquiry in oracle applications 11i - Oracle General Ledger module, Accounting Key flexfield structure.
    we have an independent key segment PROJECT and a dependent key segment SUB-PROJECT.
    Can we define 3 dependent value for the SUB-PROJECT to be the default for any new entered value in the PROJECT segment??
    e.g creating 3 default SUB-PROJECT values: X, Y, and Z. Any new value entered to the PROJECT key segment will have X, Y and Z by default as it's SUB-PROJECTS.
    If the above scenario is possible, please guide me to the best solution...
    Thank you...

    I can find that the value set of any dependent value set has only one room for a default value.
    What are the implications of creating a new Independent value set and assign it to the SubProject segment, on historical data and reports?
    thank you...

  • How to set a dropdown to the blank line value

    Hi all,
    maybe a very easy question.
    How can I set a dropdownbyindex value to the blank line?
    If I use e.g.
    wdContext.currentActionsElement().setDescription(null);
    it adds another blank line among the values and if I try with:
    wdContext.nodeActions().setLeadSelection(0);
    it doesn't work.
    Any suggestion?
    Thanks in advance.
    Angelo

    wdContext.nodeActions().setLeadSelection(IWDNode.NO_SELECTION);
    Check that node selection is not mandatory (i.e. selection cardinality is 0..1, not 1..1).
    If this does not help set initializeLeadSelection to false for this node.
    VS

Maybe you are looking for

  • Movies and Music

    Anyone store your movies and music seperate? I want to store my itunes music folder on my 300gb internal. I want all my vids to be stored on my 500gb drive. What is the best way to do this? I currently have 100gb in movies and 100gb in TV shows. Do I

  • IPad won't start.

    Touch pad is not working and I cannot reset ipad.  What can I do?

  • Hide Person Responsible field for IW21

    Hello, As a business process requirement, we were requested to hide or greyout  the "Person Responsible" field in IW21. Can any one help us set that up. Thanks.

  • Photoshop crashes during launch on mac platform

    It had been working fine up until today. I have not made any changes or updates with my computer. It is version CS4, I am on Mac 10.5.8 I tried de-installing and re-installing, did the 11.1 update, still won't open. It crashes before the photoshop te

  • Binding a variable to a shared variable is taking the attributes of that variable?

    Is it possible that binding to a shared variable to have the attributes of that variable? With other words shared variable shares attributes also? Thank you, Virginia