Set the default in a drop down box using BHTML

Hi,
I've got the following code in my html template:
`repeat with i from 1 to g_curr_name.DIM`
<option value="`g_curr_code<i>`">`g_curr_name<i>`</option>
`end`
This works fine, it displays all the values I've set from my program.  But I want to default the selected value to be USD.  Currently the list is sorted alphabetically so USD is somewhere in the middle.
What's the correct code to check if the code is USD and then make that the selected one?  Maybe something like this:
`repeat with i from 1 to g_curr_name.DIM`
`if ( g_curr_code = "USD" )`
<option selected value="`g_curr_code<i>`">`g_curr_name<i>`</option>
`else`
<option value="`g_curr_code<i>`">`g_curr_name<i>`</option>
`end`
`end`
This code doesn't work and I've tried a few other ways but nothing works.  I don't know HTML so I might be making a basic error.
Thanks for your help.
Gill

Hi,
Use ingle quotes for USD like 'USD'.
it will work.
regards
Satya

Similar Messages

  • How to set default value for drop down box in jsf

    Hi,
    Can anyone help me to set the default value in drop down box using <af:selectManyChoice> ?
    As I know there is an unselectedLabel attribute in <af:selectOneChoice> but not valid attribute for <af:selectManyChoice>.
    Any help must be appreciated.
    Regards,
    AK

    Hi Frank
    My entity type is a List in managed bean. I have set the entityType in the constructor of the managed bean. I have attached my code here.
    TPSearchCriteriaBean.java****************************************
    /** Constructor */
    public TPSearchCriteriaBean() {
    super();
    entityType=new ArrayList<String>();
    entityType.add(UIConstants.LIST_ITEM_ALL);
    authorizationType=new ArrayList<String>();
    authorizationType.add(UIConstants.LIST_ITEM_ALL);
    companyType=new ArrayList<String>();
    companyType.add(UIConstants.LIST_ITEM_ALL);
    mrgStatus=new ArrayList<String>();
    mrgStatus.add(UIConstants.LIST_ITEM_ALL);
    legalStatus=new ArrayList<String>();
    setEntityType(entityType);
    setAuthorizationType(authorizationType);
    setCompanyType(companyType);
    setMrgStatus(mrgStatus);
    country = "0";
    //address = new AddressBean();
    UIConstants.java***********************************************************
    public static final String LIST_ITEM_DEFAULT = "select";
    public static final String LIST_ITEM_ALL = "0";
    LOVManager.java*****************************************************************
    public List<SelectItem> getLovList(String lovType, boolean requiredOption_SELECT, boolean requiredOption_ALL)
    log.debug("LOV loading for " + lovType + ": START");
    List<SelectItem> lovList = new ArrayList<SelectItem>();
    //check validity of lov loading request
    validLov:
    for (int i = 0; i < lovTypeArray.length; i++)
    if (lovTypeArray.equals(lovType))
    break validLov;
    log.debug("ERROR: LOV Type not valid.");
    return lovList;
    //First select is replaced by ALL here
    //<-- Select --> should be an option
    if (requiredOption_SELECT)
    lovList.add(new SelectItem(UIConstants.LIST_ITEM_DEFAULT, "--Select--"));
    LOVDao dao = new LOVDao();
    dao.loadLOVValues(lovType, lovList);
    log.debug("LOV Loading successful!");
    //<ALL> should be an option
    if (requiredOption_ALL)
    lovList.add(new SelectItem( UIConstants.LIST_ITEM_ALL, "ALL"));
    return lovList;
    Kindly help me.
    Regards,
    AK

  • HT4864 The Outgoing Mail Server drop down box in mail setup keeps reverting back to 'None' - anyone have any ideas why?

    Hi
    I've been having difficulties with mail on my Mac and have checked all the settings.  I have three mail accounts, 2 iClouds (different acct names) and 1 bigpond account. 
    Whenever I change the outgoing mail server drop down boxes for the iCloud accts and save my changes, I go out of it then when I go back to the iCloud accts the drop down boxes for both iCloud accounts have reverted back to 'None'. 
    Is this of any relevance?  Is it 'normal'? 
    I've tried deleting all mail accounts and adding them all again but the same thing still happens. 
    I have been on Apple Support and followed the Mail Acct setup tutorial.
    I'd appreciate any help on this matter thanks.

    Thanks for your reply Winston Churchill.
    Because I'd been having problems which had recently been resolved by AppleCare Support I decided to go through all my accounts and check their individual settings.  I found a Tutorial on Apple support for setting up or verifying email account settings and found mine were different so I changed it.
    In any event I took your advice and just went with the option of automatically setting the iCloud accounts up and I haven't had anymore problems thus far - fingers crossed.
    I do however note that my drop down box in account settings still says 'none' for the outgoing mail server and the 'use this server only' check box isn't ticked despite being ticked in the 'verify account' info on the tutorial, so hence my question to the community - did this matter and what was the difference?
    I will let sleeping dogs lie I think and will see how I go.
    Many thanks for your help.

  • I have version 3.6.16 and when I login to my hotmail account, and type the first letter of the email address, a drop down box appears with my hotmail address and I can choose it from that box with a click. How do I get version 4 to do this? Thanks.

    I have version 3.6.16 and when I login to my hotmail account, and type the first letter of the email address, a drop down box appears with my hotmail address and I can choose it from that box with a click.
    How do I get version 4 to do this?
    Thanks.

    The new but not-ready-for-prime-time autocomplete method searches for matches that contain the entered text, not just ones that begin with the string. Your options are:
    1) type in longer strings that narrow the search
    2) use an add-on to search just the beginnings:
    https://support.mozilla.org/en-US/questions/1037469
    3) install an older version of TB:
    http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/

  • Getting the value from a Drop Down Box

    I'm working on a database project to keep track of our Blackberrys. The problem I'm having is entering the values for two drop down boxes. The page I'm working on enters the FirstName, LastName, Department, and Location. Department and Location have thier own Primary Keys and are foreign keys in the Person table. Departments and Locations are aligned by numbers like 1 = Ohio, 2 = Chicago. They
    don't automatically increase. The problem I'm having is entering them as a foreign key in the Person Table. I'm not sure if I use a getValue or getSelected or some other code to get the values to populate in the Person Table. I just keep getting a can't add department or location to table.
    public String newUser_action() {
    // TODO: Process the button click action. Return value is a navigation
    // case name where null will return to the same page.
    if (personDataProvider.canAppendRow()) {
    try {
    RowKey rowKey =
    personDataProvider.appendRow();
    personDataProvider.setValue(
    "DBO.PERSON.FIRSTNAME", rowKey,
    firstName.getText());
    personDataProvider.setValue(
    "DBO.PERSON.LASTNAME", rowKey,
    lastName.getText());
    personDataProvider.setValue(
    "DBO.PERSON.DEPTID", rowKey,
    department.getSelected());
    personDataProvider.setValue(
    "DBO.PERSON.LOCATIONID", rowKey,
    location.getSelected());
    personDataProvider.setValue(
    "DBO.PERSON.BEGINDATE", rowKey,
    newDate.getText());
    //personDataProvider.setValue(
    "DBO.PERSONDEVICE.AQUIREDATE", rowKey,
    newDate.getText());
    personDataProvider.commitChanges();
    info("New User " + newUser.getText() +
    " added to USER table");
    newUser.setText(null);
    } catch (Exception e) {
    log("Cannot add new User ", e);
    error("Cannot add new User: " +
    e.getMessage());
    } else {
    log("Cannot append new User");
    error("Cannot append new User");
    return null;
    }

    Sun's databound components tutorial may prove helpful to you.

  • How to set the default text in an input box or a label to be a predefine, multiline text

    how to set the default text in an input box or a label to be a predefine, multiline text. In other words how to break the line in the code of a text box.
    thank you

    There are a couple of ways of doing this:
    If you're editing on the canvas, press Shift + Enter.
    If you're working in Express View (see lower right hand corner of Project Siena), you'll need to copy a hard return from another app such as Notepad.
    I believe a better implementation of hard returns are in the list of requested functionality that you can find here:
    https://social.technet.microsoft.com/Forums/en-US/2e1f9446-56b2-419a-9c17-7037d2cd6146/from-the-community-overview-of-requested-additional-functionality?forum=projectsiena
    Thor

  • How to Change a Default Value from Drop Down Box displayed in Web Dynpro?

    Hi,
    How to Change a Default Value from 'High' to 'Low'  in a Drop Down Box for RANGE field displayed in Standard Web Dynpro Component.  I saw a Default Value set for a RANGE field  in View Context When I select that field and click on Display. I am seeing Default Value set it to 'HI'. Please let me know how to change from HIgh to Low.
    I appreciate your help!
    Thanks,
    Monica

    hi,
    use the set_attribute( ) method now to set the attribute with a particular key eg HIGH in ur case
    // u can use the code wizard( control +f7) this code will be auto generated when u select the
    //radio button to read the context node
    DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
      DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
      DATA ls_cn_node TYPE wd_this->element_cn_node.
    * navigate from <CONTEXT> to <CN_NODE> via lead selection
      lo_nd_cn_node = wd_context->get_child_node( name = wd_this->wdctx_cn_node ).
    * get element via lead selection
      lo_el_cn_node = lo_nd_cn_node->get_element(  ).
    * set single attribute
      lo_el_cn_node->set_attribute(
          name =  `ATTribute name.`
          value = 'LOW' ).
    it will solve ur query ..
    also refer to this component
    wdr_test_events -> view dropdownbyidx and dropdownbykey ->method name onactionselect.
    regards,
    amit

  • How to get ALL values as default for  a drop down box in JSF

    Hi,
    I have a drop down box in JSF page which retrieves values from LOVCache.java. I have values like Company, Client, User, ALL in the drop down box.
    By default blank value is selected for the drop down box. I want to make ALL(which retrieves data for all the values) as default value for the drop down box.
    Could any body help me? Any help must be appreciated.
    Thanks,
    Aseet

    Thanks Nikhil. But I am fetching the values from the LOVCache.java.
    I am using <af:selectManyChoice>. Is there any way I can use LOVCache.java value for selecting default values instead of hard coding?
    I mean to say can I write
    unselectedLabel="#{LOVCache.entityTypeSelectionList.anyValue}"
    where LOVCache.entityTypeSelectionList is used to populate the drop down box.
    Regards,
    Aseet

  • Why can't the Accordian widget's drop down box span full width in mobile layout?

    I'm trying to create a simple drop down navigation for mobile. When the entire header is clicked, it expands down to reveal a dynamic vertical menu, which will cover the page content below, not push it down.
    I've taken an accordian widget and added a vertical navigation widget (to allow dynamic navigation) into the expanded area. When I preview it, the drop down box of the accordian widget doesn't span the full width of the site width (380px). It stops 5-10px short of the right edge, which is a small detail, but it annoys me, and is not how I have it set up in design view. There is no other content on the page, just this element. When I have elements extend off the page area, it somehow affects the amount of space the drop down area stops short from and adds more. Strange again. Kind of stumped as to if/how I can fix this.
    Screenshot attached.

    The code taht you have shown is not the template, it is a document that has been created from a template and renamed with a dwt extension.
    If you load the document into DW then go to menu item Modify->Templates->Detach from Template and save the file, you will have your original template called index.dwt and located in the Templates subdirectory.

  • The 'Third Party Connections' drop down box on the 'Source Database' step in the Migration Wizard is empty.

    Here are the environmental details:  
    SQLDeveloper 32-bit Version 3.2.20.09 (Build MAIN-09.87)
    Oracle Database:  12C single instance (no RAC)
    Oracle client:  12C 32 bit
    Windows 64 bit desktop
    I am attempting to migrate an MS Access application to Oracle.  I pick the ‘Migrate’ selection from the ‘Tools’ Menu SQL Developer.  This puts me into the Migration Wizard.  When I get to the ‘Source Database’ step of the migration wizard, the ‘Choose the Third Party database from which you are migrating’  drop-down box is not being populated with the current available connections. It is empty.  If I type a valid connection name into the box, SQL Developer takes it on this screen but does not keep it for the next screen/step.  It has no persistence.  I even tried to make sure that each connection was open/connected before beginning the migration process.
    Due to the fact that I am attempting to migrate an MSAccess application, I am mixing 32-bit and 64 bit software.  This may be the issue as to why the drop down is losing addressability.  I have not applied any patches to this version of SQL Developer.

    Hi,
    If you need easy way to migrate Microsoft Access to Oracle probably it is more reasonable to review some tools specially designed to this purpose. For example:
    Access to Oracle converter by Intelligent Converters
    Access to Oracle converter by SpectralCore
    Access to Oracle converter by Interface Computers
    Hope, this will help.
    Sincerely,
    Vlad

  • I just sent the following in a drop down box that allowed reporting system problems:I am most unhappy with your Lion 10.7.3 operating system that I installed on this MacBook:  Hardware Overview:    Model Name:     MacBook Pro   Model Identifier:     MacBo

    I am most unhappy with your Lion 10.7.3 operating system that I installed on this MacBook:
    Hardware Overview:
      Model Name:          MacBook Pro
      Model Identifier:          MacBookPro5,4
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          2.53 GHz
      Number of Processors:          1
      Total Number of Cores:          2
      L2 Cache:          3 MB
      Memory:          4 GB
      Bus Speed:          1.07 GHz
      Boot ROM Version:          MBP53.00AC.B03
      SMC Version (system):          1.49f2
      Serial Number (system):          W8******7XJ
      Hardware UUID: ******
      Sudden Motion Sensor:
      State:          Enabled
    1. The scrolling, as far as I've been able to determine, is by using the slide bar to the right of most diplays. There are no up or down arrows that allow slow movement
    2. The top and botton toolbars are not visible. The top one appears when you point the arrow to the top of the screen but the same doesn't work well if at all pointing the cursor to the bottom.
    3. When downloading, something jumps to the upper right of the screen. I could point and click it and get a diplay if my downloads. I was attempting to fix some of the above. Now the little thing jumps off the screen and I can't get to it.
    4I was trying to installMacBook Pro EFI Firmware Update 2.3. I got message it couldn't be installed on my system.
    5. The red yellow and blue bullets that allow shutting down, minimizing and maximizing are missing on most open windows.
    Can you do something about these problems
    It's problematical that one can't communicate directly with Apple to resolve these problems
    <Edited By Host>

    1: I'm scrolling this page right now using the arrow keys.
    2: Press the escape (esc) key to exit full-screen mode. Select Apple menu > Dock > Turn Hiding Off.
    3: ???
    4: That's because you downloaded an update for another model.
    5: See 2.

  • Can the value of a drop down be used as part of an SQL query?

    I am using JDeveloper11g to develop a web application that displays some data from a database table. To do so I created Business Component from Table (Entity) that represents one of the tables in the database. I then use a panelCollection component to display the data of the tables.
    Assuming that the SQL of this entity is as follows:
    SELECT test.field1 FROM test WHERE test.field2 = :MyVariableCan I somehow set :MyVariable to be equal to the value selected by a user from a selectOneChoice component?

    Hi,
    Yes, you can. Check out setNamedWhereClauseParam method.
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/bcquerying009.htm
    For ex :
    Re: add where clause dynamicaly
    -Arun

  • Drop Down List - Setting the Default Selected Item

    I have a drop down list in my application that gets populated by a remote database.  When you select an item from the list, a screen full of thumbnails is populated based on the selection.  We have decided that when the user gets to this component in our air application, that it looks too empty and barren.  All that displays is a drop down list with an empty screen.  So we would like to set a default setting for the drop down list so that when the user gets to this component, a screen full of thumbnails is awaiting them and they can change it if they want.  My first instinct was just to set the selectedIndex property of the drop down list to the value that we want as the default, and that works, but it only changes the label in the dropdownlist, it doesn't actually populate the screen with the thumbnails.  That is because when an item is selected, it has to be commited to the drop down list by a CLOSE event that then sets off the close handler that populates the screen with thumbnails.  So after looking at the documentation, I found that there is a method called closeDropDown that states the following:
    closeDropDown
    method
    public function closeDropDown(commit:Boolean):void
    Close the drop-down list and dispatch a DropDownEvent.CLOSE event.
    Parameters
    commit:Boolean — If true, commit the selected data item.
    When I use this method, nothing happens.  In fact if I add a listener for the CLOSE event, the close event isn't getting fired.  So I am a little befuddled.  The only thing that I can figure is that I am setting the selectedIndex and not the selectedItem before I call the closeDropDown method, and if you look above, the documentation vaguely states that that "If true, commit the selected data item".  Do I need to set the selectedItem and not the selectedIndex?  If so, I am not exactly sure how to do this since I am using a service to populate my drop down list which kind of makes the dataprovider a little unclear to me in the code because it gets replaced by an AsyncListView.  Here is what I have.
    <fx:Script>
         <![CDATA[
            protected function dropDownList_creationCompleteHandler(event:FlexEvent):void{
              getAllAudio_descriptionsResult.token = audiodescriptionsService.getAllAudio_descriptions();
              getAllAudioResult.token = audioService.getAllAudio();
         private function audioDescriptionsCallResponderHandler(event:ResultEvent):void {
              audioDesc = event.result as ArrayCollection;
         private function audioCallResponderHandler(event:ResultEvent):void {
              audio = event.result as ArrayCollection;
              audioDescDropDown.selectedIndex = 2;
              audioDescDropDown.closeDropDown(true);
         ]]>
    </fx:Script>
    <fx:Declarations>
         <s:CallResponder id="getAllAudio_descriptionsResult" result="audioDescriptionsCallResponderHandler(event)"/>
         <audiodescriptionsservice:AudiodescriptionsService id="audiodescriptionsService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
         <s:CallResponder id="getAllAudioResult" result="audioCallResponderHandler(event)"/>
         <audioservice:AudioService id="audioService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    </fx:Declarations>
    <s:DropDownList id="audioDescDropDown" x="43" y="65" width="185" height="34" fontFamily="MyriadProSemiBold"
                        fontSize="15" skinClass="skins.VideoSkins.Video.DropDownSkin"
                        color="0xE6E6E6" selectionColor="0x054F7C" rollOverColor="0x007CBA"
                        creationComplete="dropDownList_creationCompleteHandler(event)" labelField="audioCatName"
                        itemRenderer="renderers.DropDownList3" close="DDLAudioCloseHandler(event)">
         <s:AsyncListView list="{getAllAudio_descriptionsResult.lastResult}"/>
    </s:DropDownList>
    I would really appreciated hearing from anyone who has experience or insight into setting a default for a drop down list and actually forcing it to execute that default selection.  Any thoughts at all would be helpful.  Thanks!

    I don't see your close handler in the code you posted, so if you provided it and I missed seeing it, please forgive me.  I'm a bit unclear on why the open and close of your dropdown list is so critical to your functionality.  It seems to me that the page of data would be tied to the item selected in the drop down (which to my mind is the only purpose for the drop down to be there).  So why do you first need to open and close the drop down, rather than just taking the selected value and doing whatever you'd normally do with it to populate that page?
    What I'm getting at is that I'd expect that page to be a separate component that would just have a property for the selected "thing", and that you could populate it either manually, as I suggested, or through the close handler on your drop down--I wouldn't think that there should be a need to go through the close handler every time.  Even if you don't have it implemented the way I'm thinking, you may want to think about whether you need to go through the close handler every time, or whether you could break it out so that the close handler simply determines which item to select, then jumps to another function that actually does something with the selected value.  That way, you don't have to go through the overhead of opening and closing the drop down if you need to change its value programmatically.
    HTH;
    Amy

  • From database to drop down box

    Hi all,
    Suppose I have the following
    String query ="Select name, number from Person";
    I want to put all the "names" in a drop down box and all the "numbers" in a separate drop down box. When I do this:
    while(rs.next()){
    <select="person" onchange="showSelection">
    <option value="<%=rs.getString("name")%>"><%=rs.getString("name")%></option></select>
    I only get the value of the first name in my table. Can anyone help me?

    Hi
    I think you need to do some order. my suggestion is to create an Object that contains name and number like this:public class MyClass {
         String name;
         int number;
         public MyClass(String n,int num){
              setName(n);
              setNumber(num);
         //set and get methods for the data members...
    }next, roll over the ResultSet and create MyClass object each time and add it to a Vector or something like that. usually a drop down box displays many times and it will be very bad if you will query the data base each time you want to display it, thats why i suggest you to save this Vector in a bean or somewhere else (of course, if the data is static).
    than display the vector content like this:<select name="person" onchange="showSelection">
    <%     Enumeration e=vec.elements();
         while(e.hasMoreElements()){
              MyClass m=(MyClass)e.nextElement();
    %>          <option value="<%=m.getName();%>"><%=m.getName();%></option>
    <%     }%>
    </select>
    <%     e=vec.elements();
    %><select name="number" onchange="showSelection">
    <%     while(vec.hasNext()){
              MyClass m=(MyClass)vec.next();
    %>          <option value="<%=m.getNumber();%>"><%=m.getNumber();%></option>
    <%     }%>
    </select>pay attention on how you wrote the select tag: <select="person"...
    and not: <select name="person"...
    hope it helps
    mamtz
    BTW
    think of using struts and custom tags in jsp it will much easier to do this!!!

  • Drop down box data is not saving in Adobe form.

    Hi Experts
    We are struggling in one pirticular issue to resolve. Please help me to resolve the below issue.
    1. We have created the adobe form using jave script. and make some entires are dynamic.
    2. We have created another drop down box having the vlaues of YES, NO. When YES there are some other drop down list and when No there are some other drop down lists.
    3. The options are working fine and drop down lists are showing all the values when download the form to local PC.
    4. When we try to enter the data into the drop down list and save and close it. When you re-open the form the saved data dissapering.
    This is the very critical issue for us. Kindly help me to resolve this issue. If  required further more information please let me know.

    Hi,
    Make sure that you have binded a context value to default binding for drop down box.
    Regards,
    Chandran S

Maybe you are looking for