Regarding DropDownBykey

HI,
I am accessing DropDownByKey UI element. I have binded it with a attribute( CA_ATTR ) which is under
the node ( CN_NODE ). Now If i have the cardinality of node as 0:n then my component is giving me dump as below.
Note
The following error text was processed in the system ECD : Adapter error in DROPDOWN_BY_KEY "DROP" of view "Z_TRY.MAIN": Context binding of property SELECTED_KEY cannot be resolved: Node MAIN.1.CN_DROP does not contain any elements
The error occurred on the application server isvsapeccdev_ECD_01 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: RAISE_FOR of program CX_WDR_ADAPTER_EXCEPTION======CP
Method: RAISE_BINDING_EXCEPTION of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: GET_ATTRIBUTE_INTERNAL of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
Method: IF_NW7_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/C0STANDARD==============CP
Method: IF_NW7_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/C8STANDARD==============CP
Method: IF_NW7_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/C8STANDARD==============CP
Method: IF_NW7_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/C7STANDARD==============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program CL_WDR_VIEW_ADAPTER===========CP
Method: IF_WDR_NW7_DELTA_RENDERER~CALCULATE_DELTA_BLOCKS of program CL_WDR_VIEW_ADAPTER===========CP
If i make the cardinality as 1:1 then code runs fine. Why thats happening.
Regards
Pankaj

Cardinality 0:n can be set when the number of instantiated elements of the context node are multiple.
For eg: Node bound to a table.
For a dropdown we can set only one instance.
Check this link regarding cardinality.
[http://help.sap.com/saphelp_erp2005/helpdata/EN/7a/787e40417c6d1de10000000a1550b0/content.htm]
Regards,
Radhika.

Similar Messages

  • Error when trying to create a Dynamic UI Element(DropDownByKey)

    Dear All,
    I am trying to create a Dynamic UI element(dropdownbykey) .
    I used the following code which i wrote in domodify:
    if (firstTime)
    IWDTransparentContainer thetransparent =(IWDTransparentContainer)view.getElement("AttributeDynamic_TransparentContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild(
      "DynamicNode",null,true,true,false,true,false,true,null,null,null);
                              IWDAttributeInfo attr1=node.addAttribute("attrib00","ddic:com.sap.dictionary.string");
    IWDAbstractDropDownByKey Sizedropdown=(IWDAbstractDropDownByKey)view.createElement(IWDAbstractDropDownByKey.class,null);
    Sizedropdown.bindSelectedKey(attr1);
    thetransparent.addChild(Sizedropdown);
    When i deployed it i got the following error:
    com.sap.tc.webdynpro.services.exceptions.CreationFailedException: Cannot create view element implementation com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByKey
    Can anyone please help me in this regard.
    Thanks and Regards
    Nishita Salver

    Dear All,
    Thanks for ur quick reply below is the entire error chain:
    com.sap.tc.webdynpro.services.exceptions.CreationFailedException: Cannot create view element implementation com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByIndex
         at com.sap.tc.webdynpro.progmodel.view.ViewElementFactory.createElement(ViewElementFactory.java:161)
         at com.sap.tc.webdynpro.progmodel.view.View.createElement(View.java:177)
         at com.sap.satyam.dynamic_attrapp.Dynamic_attrAppView.wdDoModifyView(Dynamic_attrAppView.java:184)
         at com.sap.satyam.dynamic_attrapp.wdp.InternalDynamic_attrAppView.wdDoModifyView(InternalDynamic_attrAppView.java:364)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
         at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: java.lang.NoSuchMethodException
         at java.lang.Class.getConstructorImpl(Native Method)
         at java.lang.Class.getConstructor(Class.java:554)
         at com.sap.tc.webdynpro.progmodel.view.ViewElementFactory.createElement(ViewElementFactory.java:150)
         at com.sap.tc.webdynpro.progmodel.view.View.createElement(View.java:177)
         at com.sap.satyam.dynamic_attrapp.Dynamic_attrAppView.wdDoModifyView(Dynamic_attrAppView.java:184)
    Thanks and Regards,
    Nishita

  • How to populate values in dropdownbykey in webdynpro

    I have a scenario where I have to populte data in the dropdownbykey element, select and then submit .
    How do you first insert data from database into the dropdown list ?
    Kindly help me out by providing the steps.I am new to webdynpro.
    Thanks n regards

    Hi Saju,
    There are 2 types of dropdown ui elemts:
    1. For DropDownByIndex UI element we need to bind the text property to an attribute within a context node, which contains several elements (cardinality = 0..n). The number of elements defines the possible entries in the list. In the WDDOINIT method we can prepare an internal table with the values and bind it to the node and the lead selection defines the selected element.
    For example if u have defined a node 'TEXT' with cardinality '0..n' with attribute TEXT. Bind the text property of DropDownbyIndex UI element to attribute Text of context node Text.
    In the WDDOINIT method you can prepare an internal table with the values and bind it to the node and the lead selection defines the selected element.
    The below code sample may help.
    method WDDOINIT .
    data:
    node_text type ref to if_wd_context_node,
    stru_text type if_componentcontroller=>element_text,
    tab_text type if_componentcontroller=>elements_text .
    node_text = wd_context->get_child_node( name = if_componentcontroller=>wdctx_text ).
    * Set/fill your values
    stru_text-text = 'Value1'.
    append stru_text to tab_text.
    stru_text-text = 'Value2'.
    append stru_text to tab_text.
    * set values to the node
    call method node_ddi_also_text->bind_table
    exporting
    new_items = tab_text.
    endmethod.
    2. For DropDownByKey UI element bind the SelectedKey property to an attribute within a context node. Then you must provide the fixed values (table with key value combination) in a different way and store them in the node info. We can use the elements get_attribute method to get the attribute value which user has selected.
    For this we need to use the interface IF_WD_CONTEXT_NODE which has a method GET_NODE_INFO, which returns meta information on the respective node. This information is of type IF_WD_CONTEXT_NODE_INFO.
    Kindly refer the following code:
    method WDDOINIT .
    data: NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
    NODE type ref to IF_WD_CONTEXT_NODE.
    NODE = WD_CONTEXT->GET_CHILD_NODE( 'NODE1' ).
    NODE_INFO = NODE->GET_NODE_INFO( ).
    * To be able to store the fixed values for the attribute in the node info, two
    *additional variables are necessary:
    data: LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST ,
    L_VALUE type WDR_CONTEXT_ATTR_VALUE.
    *WDR_CONTEXT_ATTR_VALUE is a data type defined in the DDIC. It contains *two components KEY and VALUE, both of type STRING.
    *WDR_CONTEXT_ATTR_VALUE_LIST is a table type stored in the DDIC, whose *rows are of type WDR_CONTEXT_ATTR_VALUE.
    *The two variables created in the source text example are used to accept the value *pairs that will later be passed to the node info.
    L_VALUE-VALUE = 'V1'.
    L_VALUE-TEXT = 'yesterday'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE = 'V2'.
    L_VALUE-TEXT = 'today'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE = 'V3'.
    L_VALUE-TEXT = 'tomorrow'.
    INSERT L_VALUE into table LT_VALUESET.
    NODE_INFO->SET_ATTRIBUTE_VALUE_SET (
    NAME = 'ATTRIBUTE1'
    VALUE_SET = LT_VALUESET ).
    endmethod.
    Hope this helps.
    Best regards,
    Suresh
    Message was edited by:
            Suresh Honnappanavar

  • Help required  regarding ObjectValueSelector

    Hi all,
    I have a requirement like this, in my View I have 2 DropDownByKeys  and 1 input field. The inputfield should be empty and the 2 DropDoenByKeys shud be populated with the data from backend, when I click on save button, the data shud be saved in the backend with the given values. I have a Bapi which have all these fields and will also save to the database.
    How to do this appl? Give me development procedure step-wise and also suggest me where and what code shud be written. Its urgent. Plz someone share your knowledge.
    regards,
    Datta Saru
    Thanks a lot in advance.

    Hi ,
    You can populate dropdown values from BAPI using the following steps. I assume you have idea about custom controller.
    step1:
    Create custom controller.Inside custom controller Bind input value then execute BAPI.
    step2:
    Now you have value node which is returned from BAPI. After execute BAPI you can find size using the following code. create value node and model node object using the code.
    Step3:
    <custom controller name>.IRole_ResultNode modelnode=wdContext.nodeRole_Result();
    <custom controller name>.IRole_OutputNode valuenode=wdContext.nodeRole_Output();
    valuenode.invalidate();
    int size=modelnode.size();
    Step4:
    After find size using loop fetch values from model node into value node.Asume in this value node contains key and value.
    for(int x=0;x<modelnode.size();x++){
    <custom controller name>.IRole_ResultElement modelElement=modelnode.getRole_ResultElementAt(x);
    <custom controller name>.IRole_OutputElement valueElement=wdContext.createRole_OutputElement();
    valueElement.setId(modelElement.getKey());
    valueElement.setText(modelElement.getValue());
    valuenode.addElement(valueElement);
    step5:
    After that bind this value node(Role_Output) into Component controller. Then Bind value node(Role_Output) from component controller into view.
    Step6:
    Finally bind dropdown UI Element into Role_Output node's attribute(ID).
    Kind Regards,
    S.Saravanan
    Message was edited by: Saravanan S
    Message was edited by: Saravanan S
    Message was edited by: Saravanan S

  • DropDownbyKey Problem with displayed values

    Hi all,
    I've got some strange behaviors with some dropDownbyKey. These DropDownbyKey are linked to enumerations.
    In our projects we use several DCs. 4 DCs have been developed separately.
    Since we refer in our master DCs to the 3 others DCs, dropdownbyKey of first DC displayed the key and not the description of the enumeration. It worked properly before.
    For the 3 others DCs there is no problem, description of the enumeration is displayed and not the key.
    This is really strange...moreover we made the following test: for a dropdown of master DC we refer to an enumeration included in one of the slave DC, this works properly. The description of the enumeration is displayed.
    May anobody helps me?
    Thanks a lot,
    Damien

    I also got this problem, one of my DC doesn't work with enumeration description.
    If you got something, please let me know.
    You can go to Regarding datatype, strange behavior
    for this problem.
    Thank you.
    William

  • Using WD messages with DropDownByKey in a table

    Hello,
    Has anyone here tried using the method
    reportContextAttributeMessage with dropdownbykey in a table?
    For some reason, the dropdownbykey field is marked as a missing field but the <b>cursor doesn't jump</b> to the field.
    Thanks.
    Ruthie.

    Hallo Ruthie,
    could you please specify the used NW '04  SP stack?
    Regards, Bertram

  • Check mandatory dropdownbykey

    In my view I have two dropdownbykey elements. After a push on the button I want to check if a value in the dropdown is selected.
    I found the following code to check "simple" inputfields:
    public void checkMandatory( java.lang.String fieldname )
        //@@begin checkMandatory()
        IWDMessageManager msgMan = wdComponentAPI.getMessageManager();
        String value = wdContext.nodeProject().currentProjectElement().getAttributeAsText(fieldname);
        IWDAttributeInfo projectAttr = wdContext.nodeProject().getNodeInfo().getAttribute(fieldname);
        if (value.length() == 0) {
             msgMan.reportContextAttributeMessage(
                  wdContext.nodeProject().currentProjectElement(),
                  projectAttr,
                  IMessageCCAdvice.MISSING_INPUT,
                  new Object[] { fieldname },
                  true);
        //@@end
    But if I run this a dump appears on
    String value = wdContext.nodeProject().currentProjectElement().getAttributeAsText(fieldname);
    It works fine for "simple" inputfields but not for the dropdown fields.
    Can anybody help me?
    Thanks in advance.
    Michael

    Hi
    Do dynamic validation this way, its generic for every string attribute, regardless of the UIElement..:
    //Method on the view
    public void checkMandatory( java.lang.String[] pathNodeNames, java.lang.String attributeName, java.lang.String placeHolder )
        //@@begin checkMandatory()
          //MessageManagerInstance
          IWDMessageManager messageManager =     wdComponentAPI.getMessageManager();
          IWDNode node = wdContext;
          Object attributeValue = null;
          IWDAttributeInfo attributeInfo = null;
          //Find the attribute within context tree
          if (pathNodeNames.length == 0)
               //Let's get the attribute value          
               attributeValue = wdContext.currentContextElement().getAttributeValue(attributeName);
          else
         for(int i=0; i< pathNodeNames.length; i++)
           //Go a level down within context tree
           node = node.getChildNode(pathNodeNames<i>, IWDNode.LEAD_SELECTION);
          //Let's get the attribute value          
          attributeValue = node.getCurrentElement().getAttributeValue(attributeName);
          //Extract attribute info
          attributeInfo = node.getNodeInfo().getAttribute(attributeName);
          //Check if the string is null or empty, and report nulls/empties to messagemanager
          if (isEmptyField(attributeValue))     
               messageManager.reportContextAttributeMessage(node.getCurrentElement(),
                   attributeInfo, IMessageCCAdvice.MISSING_INPUT, new Object[] { placeHolder }, true);
        //@@end
      //Metodo on the view
    public boolean isEmptyField( java.lang.Object attributeValue )
        //@@begin isEmptyField()
          String stringValue;
          if ((attributeValue != null))
               stringValue = attributeValue.toString();
               if (stringValue.trim().length() > 0)
                 return false;
          return true;     
        //@@end
      //Method which will manage dynamic validation to achieve business rules
       public void doValidateFields( )
          if (someCondition())  //You can validate based on conditions, in order to apply business rules sucessfully
            //Array of Strings would go empty if the attribute is located in context root
            //wdContext -->attribute
            this.checkMandatory(new String[]{} , fieldname , "placeholderValue");
          else
            //Careful here, you'll send one element inside the array of String for each subnode in context tree in which attributeName is located
            //on your case, within context root you have a node called "Project", and your attributeName inside "Project"
            //wdContext-->node "Project"--> attribute "fieldName"
            checkMandatory(new String[]{"Project"}, "fieldName", "placeholder text of your choice if needed");
            //Show error messages if thats the case
               wdComponentAPI.getMessageManager().raisePendingException();
    Just call the method doValidateFields whenever you want to apply dynamic validation.
      public void onActionRejectLoanRequest(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionRejectLoanRequest(ServerEvent)
         //Execute validations
         doValidateFields();
         //ATTENTION:  If at least one field didn't pass validation,
         //                    this Action's code will stop HERE, next lines
         //                    won't execute. Nice uh?
         //Call method of Loan Reject in CompController to execute reject actions
         wdThis.wdGetLoansAdministrationCompController().doRejectRequest();
        //@@end
    Normally, i use some generic error message, and pass the name or description of the value i'm validating, something like:
    "The value is mandatory, please select or enter a valid value".
    It could be generic too (passed as parameter) , with a few more refinement of this method.
    Regards
    Julio C. Herrera Cuevas

  • Empty row in UI Element DropDownByKey

    Hi there
    I have problems with the DropDownByKey UI Element. The one being populated with somme BAPI data works fine, but I want to implement one with the data from an enumeration of a simple type. What I am missing is the possiblity to set the selected element to the first value instead of having an empty row. Any ideas?
    Thank you for your help!
    Andreas

    hi,
    What is the built in type for the simple type.. I think it is string ? Check that..
    Did u set it as the type for a context attribute and map the context attribute to the dropdownby key UI element.
    If u have done this you can set the value as
    wdContext.currentContextelement.set<Cont attr name>("the value want to be selected");
    This value u want to select will be of the built in type of the enumeration
    regards
    Bharathwaj

  • Regarding populating values in drop down

    hi all
    if my drop down is getting populated by direct mapping of my drop down with the context then if i am to set its lead selection how am i to do that is by the followin code in the domodifyview
      if(wdContext.nodeShip_To_Partners().size()==2)
                           wdContext.nodeShip_To_Partners().setLeadSelection(1);
    thanks&regards
    jaspreet

    Hi Jaspreet,
    Check this thread.
    How to select 1st entry in DropDownByKey  object
    Re: Change lead element in Drop Down by Key
    Regards,
    Mithu

  • How to display key in dropdownbykey element

    Hi,
    I am using dropdownbykey element to display the contact type,from R/3 it is key-value TEL-Telephone,
    currently from front-end i ma able to see "Telephone", wnt to display "TEL"
    Please advise.
    Thanks!
    Piyush

    Hi Piyush
    Please try below code in order to accomplish your requirement might helps
    HashMap keyValues = new HashMap();
    I<RFC OUTPUT NODE>Element element = null;               
    for(int i= 0; i< wdContext.node<RFC Output Node>().size(); i++)
             element = wdContext.node<RFC OUTPUT NODE>().get<RFC OUTPUT NODE>ElementAt(i);
             keyValues.put(element.get<FOR TEL>(),element.get<FOR TEL>() + "-" + element.get<FOR TELEPHOME>());     
    IWDAttributeInfo nodeInfo = wdContext.node<CONTEXT NODE>().getNodeInfo().getAttribute("DROPDOWN BY KEY NAME");
    ISimpleTypeModifiable simpleType = nodeInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet valueSet = simpleType.getSVServices().getModifiableSimpleValueSet();
    //Clear valueset object if any existing values
    valueSet.clear();
    Iterator iterator = keyValues.keySet().iterator();     
    while(iterator.hasNext()) {
         Object keyValueNew = iterator.next();     
         valueSet.put(keyValueNew, keyValues.get(keyValueNew).toString());
    Hope it will helps
    Regards
    Arun Jaiswal

  • DropdownByKey UI element is giving Classcast exception

    Hi
    In my webdynpro view if i add "DropdownbyKey" UI element and the run the application,it is giving Classcast Exception.i am getting following error
    The initial exception that caused the request to fail, was:
       java.lang.ClassCastException
        at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:202)
        at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.DropDownByKeyAdapter.setViewAndNodeElement(DropDownByKeyAdapter.java:240)
        at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:231)
        at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:64)
        at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.FlowLayoutAdapter$Items.getControl(FlowLayoutAdapter.java:318)
        ... 39 more
    Please help
    thanks
    Prasad

    Hi Sriram,
    You need to bind the property "selectedKey"  for the DropdownByKey UIElement
    http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/frameset.htm
    Regards, Anilkumar

  • Dynamically binding simpletype to a dropdownbykey??

    Dear All,
    How to bind a existing simpletype to a dropdownbykey UI element?
    I have set of simpletypes created and I want to assign them to dropdownbykey UI element ( statically created). How do I go about it?
    Pls help. Can anybody give me sample code for this?
    I am writing following code in my wdModifyView method:-
    IWDDropDownByKey combs = (IWDDropDownByKey) view.getElement(<UI element ID>);
    combs.bindSelectedKey(<simpletypename>);
    But it is throwing context exception "Unknown child node"
    regards,
    Amey

    See ... i have three context value attributes:-
    1. context value attribute : combs1 of type "com.myproject.simpletypes.combsList1"
    2. context value attribute : combs2 of type "com.myproject.simpletypes.combsList2"
    3. context value attribute : combs3 of type "com.myproject.simpletypes.combsList3"
    Now my purpose is to bind one of these attributes to a SINGLE dropdownbykey UI Element dynamically !!!
    That means initially I am binding combs1 to UI element's 'Selected key" property.
    I hope  i am explaining you my scenario correctly !!!
    regards,
    Amey

  • Dynamic Population of DropDownByKey/Index

    Hi,
    I'm using Adaptive RFC model to get data from SAP and I've to create DropDownByKey/Index dynamically and populate it with the data. I've Model node with attributes in the Controller context bound to the DataModel and also model nodes/attributes in the view context bound to controller context. But the data doesnt seem to be populated.
    The return from the RFC is just one internal table. Where exactly (in the code or otherwise) do i need to populate this dynamically created drop down unit?
    Any links/code would be greatly appreciated.
    Thanks,
    Rajit.

    Hi Rajit,
    I have been creating DropDownByKey elements with dynamic values by following Example A under "Code Example of Key Binding" in the IDE help.  I just use a loop on the internal table to populate the value set that's bound to the context node attribute with the desired key/value pairs.
    Hope this helps.
    Best regards,
    Loren
    Message was edited by: Loren Woo

  • Dynamic DropDownByKey

    Hi,
    I'm creating a DropDownByKey:
    select * from ycenas into corresponding fields of table lt_cenas.
    loop at lt_cenas into ls_cenas.
        l_palias-value = ls_cenas-palias.
        l_palias-text = ls_cenas-palias.
        insert l_palias into table lt_palias.
    endloop.
    attribute_cenas->set_attribute_value_set(
          name = 'PALIAS'
          value_set = lt_palias ).
    This inserts all values from ls_profile-palias in the DropDownByKey by I don't want to display duplicate values, how can I do that?
    Regards

    hi,
    select * from ycenas into corresponding fields of table lt_cenas.
    loop at lt_cenas into ls_cenas.
        l_palias-value = ls_cenas-palias.
        l_palias-text = ls_cenas-palias.
        insert l_palias into table lt_palias.
    endloop.
    DELETE ADJACENT DUPLICATES FROM lt_palias COMPARING value.
    attribute_cenas->set_attribute_value_set(
          name = 'PALIAS'
          value_set = lt_palias ).
    Regards,
    akshay

  • Disabled dropdownbykey is showing up

    I have added dropdownbykey form element and binded it controller attribute node. I have put following code to initialize the drop down.
      public void wdDoInit()
        //@@begin wdDoInit()
         String locations[] = new String[]{"Economy","Compact","Intermediate","Full Size","Premium","Luxury","Convertible","Mini Van" };
         IWDNodeInfo csn=wdContext.nodeDropdown().getNodeInfo();
         IWDAttributeInfo cattinfo=csn.getAttribute("location");
         ISimpleTypeModifiable cmstype = cattinfo.getModifiableSimpleType();
         cmstype.setFieldLabel("Cities");
         IModifiableSimpleValueSet cvalueset=cmstype.getSVServices().getModifiableSimpleValueSet();
         for (int i = 0; i < locations.length; i++) {
              cvalueset.put(locations<i>, locations<i>);      
        //@@end
    when I am running application, a disabled dropdown box shown up. Can any body tell me how to fix this? or what I have been doing wrong?

    Hi,
    <b>Check the cardinality of the node bound to this control make it 1..n</b>
    The property <b>selectedKey</b> must be bound to a context attribute Key having a simple type like String with a value set.
    The selectable items of the drop-down list are the keys of the value set, the displayed texts are the corresponding values. The currently selected item is given by the current value of property selectedKey.
    Regards
    Ayyapparaj

Maybe you are looking for

  • How to get the contents associated with a component.

    How to get the contents associated with a component. Like i have 2 buttons and i want to get the contents associated with these button without clicking them i.e without firing the event. By Contents i mean, whatever things we get after firing the eve

  • TS1702 Problems trying to purchase and download a game

    I am trying to download a game from the App Store but it says i have insufficient memory even though the app is only 1.7gb and I currently have 3.5gb in unused space?

  • Clean install OSX 10.5.8 in macbook air, missing iphoto, imovie, garage etc..

    Hello everyone, I just recently bought a used macbook air from someone, its a late 2009 macbook. it was originally version 10.5.6 but I wanted a clean macbook (as if i just bought a completely new macbook) so i erased and installed with a CD that app

  • Rebate Accounting Entries.

    Dear Sd gurus, I have done whole senarion of rebate bt i wan tto know std accounting entries in rebate process like wht goes cr or dr like accurals g/l etc. and want to know abt manual accuals doc & rebate correction req doc. hope u will solve my iss

  • Whats up with the download not working?

    I down loaded the trial version of elements 12 last night , it read download complete, I just went to use it, and it telling me to download, But I already did, so whats the problem ? Before I actually purchase it , I'd like to try it and feel it out.