How to show default value selected in combo box...

Hi,
I need an help...
I have a combo box and i want to show the default value(coming from DB) selected on combo box on Page Render.
Thanks,
Neha

Hi,
Will this help?
database default value in selectOneChoice
Set default selected value in a SelectOneChoice
Regards
Vishal

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

  • How to set default values in matrix combo

    hai everybody.
    i want to set default values in a matrix combo box. how to do that
    pls.......

    Hi Priya,
    Public Sub comboload1()
            Try
                ds = oform.DataSources.DBDataSources.Add("OUSR")
                oitem = oform.Items.Item("pm7")
                omatrix = oitem.Specific
                ocolumns = omatrix.Columns
               ocolumn = ocolumns.Item("V_2")
               ocombo = ocolumn.Cells.Item(r).Specific (r = row number)
                LoadEroToCombo1(ocombo)
            Catch ex As Exception
                oapp.MessageBox(ex.Message)
            End Try
        End Sub
    load to combo function is below
        Public Sub LoadEroToCombo1(ByRef ocombo As SAPbouiCOM.ComboBox)
            Dim rset As SAPbobsCOM.Recordset
            Dim querystring As String
            Dim rcount As Long
            Dim rindex As Long
            Try
                rset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                querystring = "SELECT T0.U_NAME FROM OUSR T0"
                rset.DoQuery(querystring)
                rcount = rset.RecordCount
                rset.MoveFirst()
                ocombo.ValidValues.Add("0", "Select")
                For rindex = 0 To rcount - 1
                    ocombo.ValidValues.Add(rset.Fields.Item(0).Value, rindex)
                    rset.MoveNext()
                Next rindex
                ocombo.Select("0")
                rset = Nothing
                System.GC.Collect()
            Catch ex As Exception
                oapp.MessageBox(ex.Message)
            End Try
        End Sub
    try this code if it helps please reward points
    Regards
    Cool Ice
    Edited by: Cool Ice on Jul 28, 2008 1:43 PM

  • How to show default values for properties managed by UUP

    Is there a way to load default values of properties from an external source while
    associating a user with property sets managed by UUP ?
    We are trying to write a Custom User Profile using UUP so that some of the User
    Profile attributes can be stored using an existing Oracle database schema. But
    the values for some of these properties(Profile property set attributes) has to
    come from another table which already exist. So the idea is that when a new user
    is being associated with the Custom property set using Portal Admin Tool, the
    available values for an individual property has to be pulled from from a database
    table. Like when selecting a user's home city he can select the name of all cities
    already existing in a database table.
    I couldn't find a way to do this using the EntityPropertyManager. Anyone has
    any idea how to do this?
    Thomas.

    Hi Thomas,
    Yes, the UUP framework is flexible enough for you to easily load default
    values of properties from some external source. You can do this if you
    deploy your own UserProfileManager that uses a custom PropertySetManager.
    When UserProfileManager.getProperty() is called, it looks for the property
    for that user and then for the user's implicit and explicit successors
    (implicit = persisted for that property set, explicit = given as an argument
    in the method call)...if it doesn't find the property (gets null) then it
    does this:
    PropertySet set = getPropertySetManager().getPropertySet(
    getPropertySetType(), propertySet );
    if ( set != null )
    PropertyDefinition def =
    set.getPropertyDefinition( propertyName );
    if ( def != null )
    result = def.getDefaultValue();
    Check out the javadoc for the classes I have mentioned and check out the
    ejb-jar.xml depoyment descriptor for the UserProfileManager in usermgmt.jar:
    <!-- property set manager -->
    <ejb-ref>
    <ejb-ref-name>ejb/PropertySetManager</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.bea.p13n.property.PropertySetManagerHome</home>
    <remote>com.bea.p13n.property.PropertySetManager</remote>
    </ejb-ref>
    There are two options for deploying a UUP: 1) use the default
    UserProfileManager deployment with your custom EntityPropertyManager
    deployment, or 2) use your custom deployment of the UserProfileManager with
    your custom EPM deployment.
    In almost all cases, option 1) is done. However, in your case, you need to
    modify the behavior of the UserProfileManager so you must redeploy a
    custom-configured version. This means you will have to register a new
    ProfileType for your users with the DD for the UserManager EJB (because your
    special users don't use the default UserProfileManager) like this:
    <ejb-ref>
    <ejb-ref-name>ejb/ProfileType/WLCS_Customer</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.bea.commerce.ebusiness.customer.CustomerProfileManagerHome</home>
    <remote>com.bea.commerce.ebusiness.customer.CustomerProfileManager</remote>
    </ejb-ref>
    If you didn't need to retrieve the default values from your own data source,
    here is how you could get the default values using the default deployment of
    the UserProfileManager:
    * use the EBCC to create a property set (a.k.a "user profile") that matches
    your UUP property set name. Create the properties in this pset and the
    default values. When the UserProfileManager.getProperty() call fails to
    find the property value in your UUP (gets null) it will use the default
    PropertySetManager to get metadata about that property from the Portal
    schema (which you just set up using the EBCC) and it will return the default
    value that you set in the EBCC.
    I recommend you study the 2 options for deploying a UUP, especially the
    option for deploying a custom version of the UserProfileManager by checking
    out the sample UUP on dev2dev.bea.com and by looking at the Portal 4.0 docs.
    I don't know if the 7.0 docs have as much detail about this. Also, when you
    sit down to implement your custom PropertySetManager you may have to contact
    support for some of the details. For instance, how to instantiate a
    PropertySet.
    Ture Hoefner
    BEA Systems, Inc.
    www.bea.com
    "Thomas KJ" <[email protected]> wrote in message
    news:[email protected]...
    >
    Is there a way to load default values of properties from an externalsource while
    associating a user with property sets managed by UUP ?
    We are trying to write a Custom User Profile using UUP so that some of theUser
    Profile attributes can be stored using an existing Oracle database schema.But
    the values for some of these properties(Profile property set attributes)has to
    come from another table which already exist. So the idea is that when anew user
    is being associated with the Custom property set using Portal Admin Tool,the
    available values for an individual property has to be pulled from from adatabase
    table. Like when selecting a user's home city he can select the name ofall cities
    already existing in a database table.
    I couldn't find a way to do this using the EntityPropertyManager. Anyonehas
    any idea how to do this?
    Thomas.

  • How to enable group label selectable on combo box?

    When we use the combo box, we can group the items as following
    group 1
    item 1 1
    item 1 2
    group 2
    item 2 1
    item 2 2
    How to enable user select the group 1 instead of select both item 1 1 & item 1 2 ?
    In the jsf rendered result, group 1 & group 2 just a label and not selectable option, we want change it to selectable option.
    Thanks

    When we use the combo box, we can group the items as following
    group 1
    item 1 1
    item 1 2
    group 2
    item 2 1
    item 2 2
    How to enable user select the group 1 instead of select both item 1 1 & item 1 2 ?
    In the jsf rendered result, group 1 & group 2 just a label and not selectable option, we want change it to selectable option.
    Thanks

  • How to get values in the combo box in a XML form?

    Hi All,
        1. I have created a property which has "Default value" as "Clothings" and  "Allowed Values(csv)" as Real Estate - Sales , Clothings etc" by navigating to KM > CM > Global Services > Property Metadata > Properties.
       2. In the XML form builder when I drag this property I get a combo box for this property.
       3. But when I preview this by going to Content Management > Folder > New > FORMS > and select my XML form project I get a preview but it is not showing me the default values in the combo boxes which I created using the property in XML form builder.
    Please Suggest me as to how to get those values (which I mentioned in property) in the combo box ?
    Thanks in Advance,
    Jasmine.

    Hi All,
      I ll make the above Query Simple.
    1.In Xml Form Builder when you drag a property which has some 3-4 assigned values so you are  recomended to use a combo box.
    2.But the problem after using COMBOBOX is I am not getting these values in the preview of the combo box.
    3.Help Required please its urgent.
    Thanks in advance,
    Jasmine.

  • Can I Display a Selection or Combo box using MIDP

    Hey All,
    How can I display a Selection or Combo box in My Form Using MIDlet. Please send a Way to do this. Thanks in Advance.

    Hi
    use 'List' for displaying menu..
    check the api for 'javax.microedition.lcdui.List' class
    regards
    williams

  • How to show "ALL" Values by default in Page Drop-Down Lists in Pivot Tables

    Hi Everyone,
    Iam stuck with 1 problem please can any 1 help me if u know the solution.
    Here is my problem:
    How to show "ALL" Values by default in Page Drop-Down Lists in Oracle BI Pivot Tables?
    For example, if you place Region in the pages area, a Region drop-down list allows the user to select a particular region, and see the data for only that region, rather than seeing all the Regions,But by default its not showing "ALL" option in the drop down list ,rather than doing that its showing result for only 1 region by default.
    And an other problem with this pages area is, if we palce the multiple attributes in the Pages area in the pivot table, the (Fields)result is showing in vertically, the attributes 1 by 1(Every attribute in a new line) ,rather than showing like that, is there any way to show the results in horizantally?(We want to have it as a seperate drop drown list for every field horizantally not as a concatenated list).

    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

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

  • How to set default values in initialization event for select option

    Abapers,
    I have 3 GL account like 0024831231,0024831238,0024831245.
    Please help me how to set default values in select-options ( s_hkont ) in INTIALIZATION event
    Thanks

    Select option is table <Structure> with fields, low, high, sign & option
    you need to append the value into the select option, with appropriate value in low or
    example:
    S_HKONT-low  = <value>
    S_HKONT-SIGN = 'I'
    S_hkont-OPTION = 'EQ'
    append s_hkont.
    Default value for select-option also can be added directly in select-option statement.
    Regards,
    Mahesh

  • How to make default values in selection field?

    hi,
          i have selection field date , using data element 'QENTST' using following code in view INIT Method. i get the input selection field when i test application.
    DATA: LT_RANGE_TABLE TYPE REF TO DATA.
    CALL METHOD WD_THIS->M_HANDLER->CREATE_RANGE_TABLE
      EXPORTING
        I_TYPENAME                     =     'QENTST'
      RECEIVING
        RT_RANGE_TABLE           =     LT_RANGE_TABLE.
    CALL METHOD WD_THIS->M_HANDLER->ADD_SELECTION_FIELD
      EXPORTING
        I_ID                                     = 'QENTST'
        IT_RESULT                         = LT_RANGE_TABLE
        I_OBLIGATORY                 = ABAP_TRUE.
    What i need now , to make default value in this selection field( low = sy-datum and high = sy-datum + 10 ) . I have checked , i found one method called... SET_RANGE_TABLE_OF_SEL_FIELD. Bt i m not able to understand how to assign values to input table parameter in this method?
    Thanks In Advance.
    Saurin Shah

    Hi,
    Refer this Article by Thomas on how to make default values in Select Options:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60474842-91ca-2b10-3390-d2fd30f335fd
    I hope it would solve your problem.

  • How to get value of html combo box (i.e select) in jsp?

    Hello,
    I was just wondering how to get value of html combo box in jsp page. My code for combo box is:
    <select name="combo" size="1">
    <%
    List<Project> projects = mgr.getProjects();
    for(Project project : projects){
    %>
    <option value="<%= project.getId()%>"><%= project.getName()%></option>
    <%
    %>
    </select>
    I thought combo.value might give me the value, but it throws exception.
    Any help is appreciated.
    Thanks.

    The combo does not exists in Java, but only in HTML. You have to submit the form containing the combo and then use request.getParameter("combo") to get it's value ;-)

  • How to populate default values for BP (FPP1 is  tcode in ECC 6.0)

    Hello ,
    I am creating BP in ECC 6.0 using Fpp1 tcode.  How to populate default values when i hit create BP person.   any badi  triggers when we are creating BP in ECC.
    guide me.

    Hi Premanand,
    To default fields, you need to do the following steps :
    1. Create a Z module e.g. : Z_DEFAULT_FIELDS_DIALOG.
    2. Enter suppose you want to default fiels Name, title, country, write code as follows  :
    DATA : ls_busdefault LIKE busdefault.     
      ls_busdefault-title = '0002'.
      ls_busdefault-mc_name1 = 'TEST'.
      ls_busdefault-mc_name2 = 'Default'.
      ls_busdefault-country = 'IN'.
        CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
        EXPORTING
          i_busdefault = ls_busdefalut.
    3. Now got to transaction BUS7, select event ISDAT, click on Event--> function modules.
    4. Register your Z module Z_DEFAULT_FIELDS_DIALOG in this list, Save.
    This should solve your problem. Please note : You can only default those fields contained in structure BUSDEFAULT.
    Cheers,
    Rishu.

  • Using transactio code to execute a report does not show default value

    Hi all ,
          I have given a default value of a field on my selection-screen by initialization in a hr report .
    I am using PNP database and default selction-screen in hr report category .
    While the report is working fine while executing directly , It is not showing default value when executed through a transaction code .
    Can any body tell why it is so ?
    Thanks & regards
    Sun

    Did you create the transaction as a report transaction?
    Rob

  • How to set default value to date type attribute.

    Hi,
    How to set default value to date type attribute.
    E.g I want to set u201C01/01/1999u201D to date attributes.
    First i want to set value and then i want to fetch the same & want to check equals.
    please suggest solution.
    Regards,
    Smita

    Hi,
    In wdinit() method u can set the date
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    Date today = Calendar.getInstance().getTime();
    String reportDate = df.format(today);
    wdContext.currentContextElement().setFromDate(reportDate);
    Another way you have set the this formate like that
    1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
    2. Select the type as "date"
    3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
    4.Bind the context attribute to the type created now.
    Hope this helps u.
    Best Regards
    Vijay K

Maybe you are looking for

  • Report in CSV format

    In an Apex report SQL query, i had written a statement for the column as '<div style="width: 260px;">'|| PARTY_NAME || '</div>' as PARTY_NAME to avoid wrapping of the column text. Now, when i download the report in csv format, i get the output in PAR

  • IPhone not recognized by iTunes, but listed in "My Computer"

    Hi, I have exhaustively searched the other threads as well as Apple support. I am running Vista 32-bit. I just received a replacement phone and I have literally never had so much as a hiccup recognizing, syncing, etc. on my laptop which is the only c

  • Mouse pointer flashing like crazy

    Since the last Flash update, Firefox crashes once or twice a day. According to the error reports sent, Flash did cause those crashes. Now there's a new bug: the mouse pointer flickers like mad. I know it is Flash, because I killed the process in the

  • About Transportation

    Hi Sap Experts Could You please explain about the Transportation.

  • I was editing on FCE and suddenly my entire project needed to be rendered AGAIN.

    WHAT'S UP WITH THIS? Here's what happened: I put music in a line and then rendered it. Then music/titles/extra lines disappeared and red line to render reappeared. The whole format just looks different. Could this have to do with the fact that I star