Size of Drop down by key

Hi,
when i built value set for the first time for drop down by key, values( texts ) are displayed correctly, however when it is re-built based on other drop down instead of showing texts it is showing the key value in drop down, however if select drop down, text will be selected though key is displayed.
i think it is something to do with drop down by key size adjustment, how to solve this.
i guess we can use 'CALC_WIDTH4DDLBBYKEY' method of cl_wd_utilities, but how to use this??
Please suggest!!
Edited by: kranthi kumar on May 5, 2011 3:58 PM

Hi Kranthi,
You cant adjust drop down size manually.
According to the values inserted in the dropdown, its size increased automatically.
If there are no values in dropdown it will be small in size but with values its size increases.
You can adjust WIDTH of drop down, but after filled with values it takes value size.
While filling drop down key and value, pass same value to key and value.
Example code :
      DATA : node_info TYPE REF TO if_wd_context_node_info,
        value TYPE wdy_key_value,
        set TYPE wdy_key_value_table,
        k2 type string value 'BOX',
        v2 type string value 'BOX',
        k3 type string value 'LOOSE',
        v3 type string value 'LOOSE'.
      value-key = k2.
      value-value = v2.
      APPEND value to set.
      value-key = k3.
      value-value = v3.
      APPEND value to set.
      node_info = wd_context->get_node_info( ).
      node_info = node_info->get_child_node( 'PACK_MAT' ).
      node_info->set_attribute_value_set( name = 'PACK_MATERIAL'
                                           value_set = set ).
Cheers,
Kris.

Similar Messages

  • Drop Down BY Index Vs Drop Down By Key

    What is the difference between Drop Down By Index & Drop Down By Key.
    How Do we retrive What value is selected in a drop down
    regards
    Nilesh

    Hello Nilesh,
    //Create ISimpleTypeModifiable to fill the dropdownbox
    //XXX is your Desc field
                    IWDAttributeInfo soAttribInfo= wdContext.getNodeInfo().getAttribute("XXX");
                    ISimpleTypeModifiable soType = soAttribInfo.getModifiableSimpleType();
                    soType.setFieldLabel("XXXX");
                    IModifiableSimpleValueSet soSet= soType.getSVServices().getModifiableSimpleValueSet();
                    soSet.clear();
                    //To Get desc and key from web services you pass some information to the run the given Webservice do it here
                    wdContext.currentRequest_XXXViDocument_getDescnKeyArrayElement().setInfo(infonr);
                    wdThis.wdGetXXXController().getDescObjects();
                    int size = wdContext.nodeResult_getDescObjectsArray().size();
                    if (size != 0)
                         //Filling the desc in the dropdownbykey field
                         for (int i=0; i<wdContext.nodeResult_getDescObjectsArray().size(); i++ )
                              IPrivateXXView.IResult_getDescObjectsArrayElement soElement =
                                  wdContext.nodeResult_getDescObjectsArray().getResult_getDescObjectsArrayElementAt(i);
                               soSet.put(soElement.getkey(),
                              soElement.getDesc().trim() + " " + soElement.getkey().trim() );
    Implement this code for populating the drowdown when that works I can tell you the next step.
    Good Luck,
    Dharmi

  • On basis of drop down by key values i want to enable and disable ui elements is wda

    How to enable and disable ui elements on basis of drop down by key values as i show in screen shot i have 3 values in drop down by key on basis of those values i need to enable and disable ui elements in webdynpro abap kindly reply back

    Hi Sreedhara,
    There are many tutorials on SCN for learning Web Dynpro ABAP. If the following steps don't make sense to you, please do a search for some tutorials and read through the tutorial materials. Hopefully the tutorials will help you to become familiar with some of the basics of Web Dynpro ABAP.
    Here is how to enable or disable a UI element upon selection from a DropDownByKey.
    In your view context, create a context attribute of type wdy_boolean. For now, let's call this attribute IS_ENABLED
    In your view layout, bind the enabled property of the UI element to the context attribute IS_ENABLED.
    In your view actions, create an action-- let's call it SET_ENABLED-- and bind this action to the DropDownByKey element's onSelect event in the view layout.
    In the event handler method for the SET_ENABLED action, use the Code Wizard to read the value of the DropDownByKey selected value, then use the Code Wizard again to set the value of context attribute IS_ENABLED to either true or false.
    Now when a value is selected from the DropDownByKey, the SET_ENABLED action will be triggered and the IS_ENABLED context attribute will be set to either true or false. Since your UI element's enabled property is bound to this true or false value via the context binding, the UI element will change to enabled or disabled.
    Good luck!
    Cheers,
    Amy

  • Query for Drop Down By key

    Hi,
    Explaining my problem with an example.
    There is a hotel table where user enter hotel details
    Like City, Dep Date, Arr Date, No of Days , rate  etc  and these in turn get saved to table say USER_HOTEL_DETAILS  . When user comes to his plan/entered details again, previously saved data is shown to him.
    For making a selection for City I have to give a dropdown to user with cities list that are maintained in other table say HOTEL_DATA which has city, rate, and currency fields and city is the key of table.
    Now if I use drop down by key or index for city I need to fetch city values from table HOTEL_DATA and have to populate context of city field of USER_HOTEL_DETAILS.
    For dropdown my value text is going to be city .For key if I try to give serial numbers say 1, 2, 3 as key for populating dropdown, the key will get stored in database table against city name. To avoid this while saving data I have to write additional code while saving and retrieving data that take value against selected key.
    To avoid this one way is to use city name as both Key and Value. What is the other alternative I can use for? Please help
      Regards,
      Madhvika

    Hi ,
    It is better to have citykey in HOTEL table and maintain a text table for the same.This is good approach.
    Because tommorow if city needs to be displayed in other text also just adding the same in the text table would be suffice.
    For city texts retrieve it from text table and bind to the node.
    Regards,
    Madhu

  • Restrict the number of visible values in drop down by key?

    Hello,
    Is it possible to restrict the max. number of entries displayed in a drop down by key element? By default i get 10 entries which i would like to limit to 5. Thanks.
    Regards,
    Vasu

    Hi,
    If you have a set of default values (which come from the domain), you can restrict them to the specific values which you need to display. In the INIT method of the view in which this UI element is present, you will have to write code to delete the entries which you do not wish to show in the drop down by key element.
    Have a look at this code snippet:
      data:     node_info type ref to if_wd_context_node_info,
                elem_attr type wdr_context_attribute_info.
      node_info = wd_context->get_node_info( ).
      node_info = node_info->get_child_node( 'CHILD_NODE' ).
      data:    lt_valueset type wdr_context_attr_value_list,
            l_value type wdr_context_attr_value.
      call method node_info->get_attribute
        exporting
          name           = 'ATTR1'
        receiving
          attribute_info = elem_attr.
      lt_valueset = elem_attr-value_set.
      delete lt_valueset where value = 'VALUE1'.
      node_info->set_attribute_value_set(
                name = 'ATTR1'
                value_set = lt_valueset ).
    Hope this helps.
    Regards,
    Wenonah

  • Clear the values in Drop down by key

    hi all ,
    i m using drop down by key (Combo box) ..
    i have populated some values in that ..
    then i navigate to next view ... from that view i m again navigating back to the
    previous view .. now the values which was filled needs to be cleared ..
    i used invalidete method also even though the values are present in the list ..
    can any one help in this ...
    points will be rewarded
    Thanks and regards
    JK

    Hi,
    Do you want the currently selected value to be reset, or do you want to delete the entire list of values? If you want to only reset your current selection, node->invalidate( ) should do it. Invalidate your node in the inbound plug handler.
    Regards
    Nithya

  • Problem with Drop down by key

    Hi all,
          I Inserted several drop down by key in my view at design time. When I try to run the application it displays an error as
    java.lang.ClassCastException at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:202)
    My requirement is,
    I am getting a table with two fields(key,value) from R/3 I want to display these in the drop down by key box how to bind them to this drop down.

    Hi Refer the below link
    DropdownList box to display R/3 table  
    Re: DropdownList box to display R/3 table
    see this link for when to use DropDownByIndex (DDI) vs DDK (DropDownByKey) and how populate data from R/3.
    Re: webdynpro populating dropdown values programmatically
    populating dropdownbyvalue with the r/3 value?  
    Re: Regarding DropDown Box
    /message/2187817#2187817 [original link is broken]
    Re: DropdownList box to display R/3 table
    create context value attribute and bind to drop down by key
    not getting value from DropDownByKey
    Dropdown by key
    dynamic DropDownByKey
    http://help.sap.com/saphelp_nw04/helpdata/en/4a/8613e41629344194e4f40393740d51/content.htm
    For DropdownbyKey
    http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/content.htm
    For DropdownByIndex
    http://help.sap.com/saphelp_nw04/helpdata/en/24/25e08d4ba6c743b55f1d375637ba8d/frameset.htm
    Regards,
    Saraswathi
    Pls reward points for useful info.

  • Change font size in drop-down form item

    When I'm in design mode, I assigned the drop-down item a
    style class of 9pt
    font and it looks fine in design mode. When I go to view in
    IE, the font
    looks like a standard 10pt font and doesn't change when I
    change the class.
    So, all of my titles are in 9pt but the form text boxes and
    drop-down boxes
    are all using 10pt font.
    How do you change the font used in form fields?
    Thanks!

    One should not use a print metric on the web. Please use
    pixels, ems, ens,
    exs, percents, or font size names, but definitely not points.
    > How do you change the font used in form fields?
    select { font-size: 9px; }
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Beverly" <[email protected]> wrote in message
    news:ernl49$iei$[email protected]..
    > When I'm in design mode, I assigned the drop-down item a
    style class of
    > 9pt font and it looks fine in design mode. When I go to
    view in IE, the
    > font looks like a standard 10pt font and doesn't change
    when I change the
    > class. So, all of my titles are in 9pt but the form text
    boxes and
    > drop-down boxes are all using 10pt font.
    >
    > How do you change the font used in form fields?
    >
    > Thanks!
    >

  • Font size in drop-down fill in the blank quiz questions.

    I've migrated an old Quiz from Captivate 4 to Captivate 5. All went reasonably well except for the fill-in-a-blank questions. Fortunately there are only relevatively few of these, but I've encountered a strange problem when I started to do this.
    I've set up a style which applies to the fill-in-a-blank question, using biggish text (30pt) because the viewers of the test will not have perfect vision. The text reproduces fine when I publish with the exception of the text in the drop down box. This is appearing as what looks to be about 10pt and not in keeping with the style that applies to the question.
    Here's what I mean...
    I've looked up and down the menus and in the helpfiles but I can't find out how to control the drop-down text size. Any help would be gratefully received as otherwise I'll have to abandon this type of question.
    regards,
    Henry

    Hello Henry,
    Have reported this issue to the Adobe team, but cannot help you to solve it.
    If you could replace the dropdown list by really to type words, there the style of the sentence itself is taken over.
    Lilybiri

  • Popup instead of list when using WD4A ALV Grid Drop Down By Key

    I am develop a WD4A application and I am using an ALV grid.  I have set the cell editor for one column wiht the following code:
    CREATE OBJECT lr_ddbk
        EXPORTING
          SELECTED_KEY_FIELDNAME = 'ZCURRENCY'.
      Data: lv_key_visable TYPE abap_bool,
            lv_key_visible_fieldname TYPE string.
       lr_ddbk->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
    *  lv_key_visable = lr_ddbk->GET_KEY_VISIBLE( ).
    *  lv_key_visible_fieldname = lr_ddbk->GET_KEY_VISIBLE_FIELDNAME( ).
    *  lr_ddbk->SET_KEY_VISIBLE( abap_false ).
      lr_alv_column->SET_CELL_EDITOR( lr_ddbk ).
    This code works fine.  I then fill the drop down with the following code:
    *...Build the currency drop down list
      DATA lv_default_currency TYPE wdr_context_attr_value.
      DATA lv_currency_count TYPE STRING.
      DATA ls_tcurt TYPE tcurt.
      CLEAR ls_contextvalue_set.
      CLEAR lt_contextvalue_set. REFRESH lt_contextvalue_set.
      CLEAR lv_default_currency.
      loop at it_ac_attr into ls_ac_attr.
        if ls_ac_attr-attr_id eq 'CUR'.
          select single * from tcurt into ls_tcurt
               Where spras = 'EN' AND
                     waers = ls_ac_attr-value.
          If sy-subrc = 0.
            ls_contextvalue_set-value = ls_ac_attr-value.
         ls_contextvalue_set-value = ls_ac_attr-value.
            ls_contextvalue_set-text = ls_tcurt-ktext.
            IF ls_ac_attr-DFT_FLAG = 'X'.
              lv_default_currency = ls_contextvalue_set.
            ENDIF.
            append ls_contextvalue_set to lt_contextvalue_set.
          endif.
        Endif.
      endloop.
      lo_nd_zebuy_describe_item_info = lo_nd_zebuy_describe_item->get_node_info( ).
      lo_nd_zebuy_describe_item_info->set_attribute_value_set(
                                    exporting
                                       name = 'ZCURRENCY'
                                      value_set = lt_contextvalue_set ).
    *...End build currency drop down list
    This code works fine.  The issue I am having is that the drop down is behaving like a search help field rather than a drop down list.  Meaning a popup comes when I drop down the list.  The popup has the values I have set.  I don't want a popup I want a drop down list.  Additionallly the field is editable (meaning I can type a value into the field as well as select a value).  I want the user to only be able to select values from the list.  Any help with this issue would be appreciated.

    I fugured out what I was doing wrong.  I was setting the cell editor to cl_salv_wd_uie_input_field later in the code by mistake.

  • Help! FCS3-How do I reduce bitmap size if drop down edit item is grayed out?

    I am in Flash CS3. I need to reduce a bunch (300) Bitmaps pixels dimensions from 1068 px to 270 px across (and proportional height)  in library but the "edit with..." (external editor) drop down item is grayed out. I have tried everything, including looking for ways to export the Bitmaps to create new images and update library items. I am stumped! Thanks in advance—[email protected]

    Hi,
    One solution I can think of is to use your bean to set up more than just a Vector of values from the database. If you could instead create a vector of objects which contain a reference to the row as well as the data then you can use that to name the select control:
    <select name=Choice_<%=vPQStatus.elementAt(i).getReference()%> >
    <option value="S">Start
    <option value="R">Restart
    <option value="C">Complete
    </select>
    <%=vPQStatus.elementAt(i).getValue()%>
    This would then require you to access all request parameters and search for those starting with "Choice_" you can then extract the reference from the name and the new selection from the value.
    Hope this helps

  • SQL azure database size not dropping down after deleting all table

    Dear all,
    I have a simple database on Azure for which I have deleted all table data. The size of the database is still showing 5Mb of data and I am charge for that. I have heard that this may happen from cluster index getting fragmented.
    I have run  a querry I found on internet on all my table index to show percentage of fragmentation and all report 0%.
    DBA is not so my job but what could it be or how can I reduce that size ?
    ON premise I would use COMPACT DB but not available in azure like some others DB action
    Thnaks for tips
    regards

    user created objects/data are not the only ones stored in your database. you got system objects and metadata as Mike mentions above.
    are you trying to skip being charged if you're not storing data? looking at the pricing table,  you'll still get charged the $4.995 for the 0-100MB database size range.

  • How to clear a drop down by key on a button action

    Hi All
            I am new to  the webdynpro i have to clear  the dropdown by key, i had tired giving the
                    wdContext.nodeA().invalidate();
                 on a button action which will navigate to next view after click but it doesn't effect when i come back to the first view can any one help me in doing this.
    Regards
    Ashwin

    Hi Ashwin,
    To display the values in DropDownbyKey, yuo need to populate the value in the node before the view is rendered to the user. So must be populating the node in the wddoinit method the view controller or the component controller.
    Now just for your knowlegde, DropDownbyKey just holds the one value which is selected by the user, and all other values are automatically invalidated by the framework. So invalidate methos is a wrong choice in this case. You can probably use the function module SET_STATIC_ATTRIBUTES_NULL for a element. For further info you can check IF_WD_CONTEXT_ELEMENT in se24 transaction.
    Hope this help.
    Cheers !
    Ashish

  • Subject: Drop Down By index Vs Key

    Question: I have domain with Fixed value and i want the drop down in webdynpro screen to pick  the domain value automatically
    what type of drop down should be used and can you differentiate the two types
    kindly reply

    Hi,
    You should use drop down by key in order to select the domain value automatically.
    Map your contxt attribute as a selected key property of the UI element property.
    Diff. b/w the two avalable types:
    For drop Down by index, You need to build the value table to the node intially and an intial value will be space by default.
    For drop Down by key: you have val-nam pair i.e if you can decide to display domain value or description.
    Hope this  may be helpful.
    Thank you
    Depeshl

  • Webdynpro " How to add values in Drop down list By Key"

    Hi experts ,
    i want to create a drop down list by key, i don't know how to assign values to it ( i.e. add list entries ) . Please help me on this ..
    With regards ,
    James..
    Valuable answers will be rewarded ....

    Hi,
    To fix values to the drop down key at runtime in the webdynpro application you can use the following code:
    DATA:
    lr_node_flightinfo TYPE REF TO if_wd_context_node,
    lr_nodeinfo_flightinfo TYPE REF TO if_wd_context_node_info,
    l_scarr type scarr,
    lt_value_set TYPE TABLE OF wdr_context_attr_value,
    lw_value_set like line of lt_value_set.
    get nodeinfo of node flightinfo
    lr_node_flightinfo = wd_context->get_child_node( name = 'FLIGHTINFO' ).
    lr_nodeinfo_flightinfo = lr_node_flightinfo->get_node_info( ).
    get value set (VALUE = CARRID , TEXT = CARRNAME)
    select carrid carrname from scarr into table lt_value_set.
    clear lw_value_set.
    lw_value_set-value = 'AI'.
    lw_value_set-text = 'Air India'.
    append lw_value_set to lt_value_set.
    sort the value set by the describing TEXT
    SORT lt_value_set BY text.
    set value to context attribute
    lr_nodeinfo_flightinfo->set_attribute_value_set(
    name = 'CARRID' value_set = lt_value_set ).
    Here CARRID is a drop down by key field on the screen.
    in The context it is an attribute in the node FLIGHTINFO.
    Please give Reward Points if this piece of code helps
    Regards,
    Manish

Maybe you are looking for