DropDownByKey UI Element and Model Attribute

Hi
  The DropDownByKey UI Element can be linked to value attribute, which are simple types.
Now if i try to link them to model attribute which are simple types pertaining to some model classes, its not happening.
so my question is how to attach any DropDownByKey UI Element with Model attribute which will get data from model to which it is attached?
thanks
Srikant

D.V.,
Whether or not DDK (DropDownByKey) works with model attribute depends on type of attribute (actually, type of model class property that stays behind this attribute)
If the type contains enumeration itself then DDK works.
So, you have the following options (dynamically populating values set will not work here):
1. Alter type on back-end to include enumeration
2. Use DDI (DropDownByIndex) as suggested here
3. Create sub-node with cardinality 1..1 (better keep singleton false), then add value attribute with the same basic type (string, int etc) and set it flag calculated to true. WD will generate getter / setter for this attribute -- just return / set original model attribute in this method. Next:
3.a Either create new simple DDIC type for calculated attribute and define enumeration here
3.b Or modify SVS of calculated attribute at run-time as suggested in this thread
Valery Silaev
EPAM Systems
http://www.netweaverteam.com/

Similar Messages

  • [JS-CS4] - How to read the XML Element and its Attributes

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

    Dear All,
      I have the doubt regarding: reading the xmlElement and its attributes.
    Here I droping the xml script
    //============= Start ======================//
    var myDoc = app.activeDocument;
    var Fpath = File("../Projects/Entity_map.xml");
      if (Fpath.exists)
       Fpath.open("r");
       var Cont= Fpath.read();
      var roots = new XML(Cont);
      var myEveryName = new Array();
      var myEveryContent = new Array();
      var myEveryAttributes = new Array();
      traverse(roots);
    //$.writeln(myEveryName);
    //$.writeln(myEveryContent);
    $.writeln(myEveryAttributes.length);
    for(var i=0; i<myEveryAttributes.length; i++)
      $.writeln(myEveryAttributes[i]);
    function traverse(tree) {
        myEveryName.push(tree.name());
    myEveryContent.push(tree.text());
      myEveryAttributes.push(tree.getAttribute);
    // you get the contents by using .text() insted of .name()
        if(tree.elements().length() > 0) {
            for(var i=0; i<tree.elements().length(); i++) {
                traverse(tree.elements()[i]);
    //============== End =====================//
    and the XML Structure is
    //===============XML =====================//
    <?xml version="1.0" encoding="UTF-8"?>< Entity_Convertion>
    < Entitys char="Ç" GID="173"/></ 
    Entity_Convertion>
    //===============End ====================//
    Here I'm getting the XML Elements and its contents, but not xmlAttributes.
    Please any one can help me, then I will appreciate...
    Thanks & Regards
    T.R.Harihara SudhaN

  • Binding model attributes disables UI elements

    Hi ,
      I have created a model. and did bind its attributes to the UI elements. RFC is working fine.
    But in the runtime all UI elements are disabled bydefault when i bind these to the model attributes but to the same UI element if i bind it to the local attribute its working fine...
    I have tried reimpor and recreating model , and also changing the cardinality but not working...
    Would not it be possible to bind UI elements to model attributes ?  By using model attributes how the UI elements can be enabled ?
    Please help me out...
    Regards
    Sireesha.

    hi,
    this occurs becoz u would have bound the i/p element to a model attibute whose value is null.
    to solve dis,
    1)create a context attribute in ur view
    2)bind  the i/p elements to that context attr
    3)while executing the rfc , get the value of this context attr and set it to the model attr.
    for example if u have a model attr 'name_mo ' which u have to bind to the i/p field element
    create a context attr -
    name_vn
    bind name_vn to the i/p field element
    while executind ur rfc,
    Test_Input ip = new Test_Input();
    ip.setName_mo(wdContext.currentContextElement().getName_vn());
    Test_Input is the name of the model node that is bound from model to the view via comp.ctller
    Regards
    Jayapriya

  • DropDownByKey UI element always Disabled

    Hi,
    I have created a dropdownbykey UI element and I have bound the selected key to the view context element which is of simple type country. In the local dictionary I have created a simple type country and given it values like India, USA etc..
    But when I run the application, the dropdownbykey element is always disabled. Please help. Does someone know what I am doing wrong.
    Thank you.
    Ashish

    Hi Ashish,
    Check the cardinality of the node bound to this control make it 1..n. Reason is, You dont have a element under the context where the data can be hold.When you set it to 1..n frame work will create one for you.else you need to create an element of the node using createandelement method.
    The property selectedKey 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.
    Deepak!!!

  • 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

  • Difference among Model node creation, model attribute creation and the field creation in database through AET?

    Hello Friends,
    To display the field on the View, we can create the field via 3 ways:
    1) By creating the model attribute
    2) By creating the model node using the GENIL object and using its attributes in view
    3) Creating the field in Database structure using AET
    But, i am not aware that in exactly what kind of business scenarios we use the above 3 methods to create the field.
    Could you help me out to clarify the same.

    Hi Dev,
    1). By creating the model attribute: we will use this option in case of the field is avaibla in stanadrd sap system. It might be in another under child context nodes and we will use BOL relations to access the attribute.
    2).  By creating the model node using the GENIL object and using its attributes in view: We will use this option incase of there is no standard provision to use. Means you want to create any custom assignment block with custom attributes then you can go for this option. More over we can use AET to create custom genil object. We have an option Create Table in AET.
    3).Creating the field in Database structure using AET: We will use this option incase of there is no attribute in database relevant to your requirement then we will go for AET enhancement.
    Hope this might give you little clarification..
    Best Regards,
    Dharmakasi.

  • Check Required Elements and Attributes in JAXB

    Hi
    I need check required elements and attributes in JAXB java classes , if there are any value for them place it , otherwise place default value in xml file , because of it I upgrade JAXB2.0 to JAXB 2.1 to support "required" in "XmlElement" , I read in "JavaWS(JAXB)Tutorial.pdf" that JAXB itself check required elements and attributes , if there are any value for them place it , otherwise place default value in xml file , the exact part of document is :
    << A property is said to have a set value if that value was assigned to it during unmarshalling or by invoking its mutation method. The value of a property is
    its set value, if defined; otherwise, it is the property’s schema specified default value, if any; otherwise, it is the default initial value for the property’s base type as it would be assigned for an uninitialized field within a Java class. >>
    I want to know , dose JAXB do this task ? (now I work with JAXB2.1 but it doesnt do this task.Maybe I must set some configuration)
    and if JAXB doesnt do it , how I can check required elements and attributes in JAXB ?
    Please help me.
    Shariat

    its all on Apple's Developer site
    http://developer.apple.com/DOCUMENTATION/AppleApplications/Reference/FinalCutPro _XML/index.html

  • Modify Transition element in work flow using for and not attributes to restrict access

    Hi,
    I have TFS 2013 for my premises and I am working on changing the work flow for TFS work item. I have created a work item as per requirement and it has 3 states
    Active, In Review and Closed in work flow. When developer creates a work item it is in Active state and later it is sent to In Review and then to close after successful review.
    My question is I want development team to be restricted to move the work item to Close state. At present when developer creates a new work item they see Active state. At this point they can not see any other states in the work item. Later they
    fill the details and after checkin they will put that work item to In Review state. At this point they can see Active and In Review states. When they save this work item and modify it again they see Close state as well. I want to design the Transition element
    in work flow in such a way then developers should not be able to see the Close state at all in a work item assigned to them. Only reviewer should be able to transit the work item from In Review to Close.
    I checked the for and not attributes in the transition element but I have no idea about correct syntax I should use to enforce the restriction. I would also like to mention here that I have no separate groups defined in my TFS server. Every
    one is a part of contributor's group. There is no specific group of reviewers and one developer reviews the code of another. I want to design the work flow in such a way that the developer who creates (or gets assigned) the work item should
    not be able to put their own work item in Close state but they should be able to close another developer's work item if that work item has his name in the reviewer's box.
    I have tried to simplify my question by elaborating it hope it is not complex to understand. Let me know if you want further clarification on this.
    Regards, Premal Acharya

    Hi Premal,
    For your scenario, seems the "for" and "not" attributes not are unavailable to make it happens. Because of the developers not in groups, and the same type of work items can be assigned to all the developers hence the attributes cannot
    be allow and deny users in the groups concurrently. Please check the
    page for more information about transition xml element.
    Based on your situation, you can separate the development group and test group. Then you can only allow test group to change the state.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Making file desin with elements and attributes implementation

    hello
    this is an FILE to IDOC
    I have an xml file that need to be enter to the XI. the XML has attributes and elements.
    I would like to know how can I make an element with some attributes and below there should be a subelement.
    for example, in delivery there will be all the attributes, and I would like to make it an array so there will be below subelemnt in the name of carrier for example.
    (if any one has other ways to implement this file feel free to suggest.)
    - <delivery number="1234567890" shipment-type="Y014" shipping-point="1910" ifm-reference="125" status="final">
    - <!-- status initial, change or final
      -->
      <carrier>123456</carrier>
    - <!--  This will be the SAP vendor code
      -->
      <scheduled-departure>200810011000</scheduled-departure>
    - <!--  Precalculated departure date and time format YYYYMMDDHH24MI
      -->
      <scheduled-arrival>200810031600</scheduled-arrival>
    - <!--  Precalculated delivery date and time
      -->
      <actual-departure>200810011015</actual-departure>
    - <!--  Actual departure reported by carrier
      -->
      <actual-arrival>200810031545</actual-arrival>
    - <!--  Actual arrival reported by carrier
      -->
      </delivery>

    >>that what I thought, but after I do the attributes for the element, I dont have the option to write for the element sub-element.
    I guess the current row that is selected would be an attribute thus the option insert subelement is disabled. Always select the element and insert either attribute or subelement to it.
    Thanks
    SaNv...

  • Id and name attributes on xsd elements

    id, and name attributes on elements do not have a defined length, correct?
    We are shredding an xml document into storage, currently we assign 255 characters for the field that will persist the values, since the id/name fields can be longer than this is there a best practice hat is recommended for xml authors not to create ids, and names with a long string.
    I am working in a specialization of xml called XBRL,
    Neil

    Per the W3C standards, as I read them, you are correct. There is no limit on how long the attribute name (http://www.w3.org/TR/2008/REC-xml-20081126/#attdecls) can be. Follow the Name link on that page and you'll see a Name is defined as NameStartChar (NameChar)*, which is unbounded in length.
    What various tools, including Oracle implement, for max name lengths is not known to me but your 255 seems more than reasonable. The best practice in terms of node name length depends upon who created the schema and what pattern they followed.
    For example, this ISO standard
    ISO/IEC 11179-5:2005, Information technology — Metadata registries (MDR) — Part 5: Naming and identification principles. Available from
    http://standards.iso.org/ittf/PubliclyAvailableStandards/c035347_ISO_IEC_11179-5_2005(E).zip.
    is used by NIEM but neither it nor additional NIEM restrictions put a max length on node names.
    I've played around some with XBRL too and while I've seen a few long ones, I don't think they were over 50 characters so 255 would be more than enough. You could play around with all the .xsd schemas they have and look to see what the longest node name is and then set your length just over that but 255 is more than plenty in my opinion.

  • Parsing (COunting Elements and Attributes)

    Can anyone point me to the method sfor counting elements and attributes in a parsed XML document. For example, I have a XML document that contains a number of 'word' files, I need to produce a printout that gives the total number. The files have a size attribute and I need to calculate and printout the total size of all the files together

    ChuckBing,
    Thanks for the pointers. I now have the following method:
    }  public void startElement(String elementName, AttributeList al) throws SAXException
          String attributeValue;
          if (elementName.equals("PRICE"))
          if(al.getLength()>0)
          for(int j = 0;j<al.getLength();j++)
            attributeValue = al.getValue(j);
            System.out.println("Total Attribute value is " + attributeValue);
          }This obviously allows me to extract the detail from "PRICE" but "PRICE" actually has two attributes. I can't find another method that allows me to extract out the detail for a specific attribute.
    Can you suggest anything?

  • Looping through elements and assigning the proper attributes

    So I'm trying to loop through all my xml elements. I then
    want to loop through an element and an elements child and all
    attributes assigned inside. Does this make sense, I hope so? This
    is for an on going Cascading menu I have been building. So
    basically every element inside an element would be a submenu of a
    menu. Here is what I have....

    Okay. Much better subject line this time. :)
    You apparently know what a factorial is. You need to multiply the input by all numbers less than it (except for special case of 0! [but, then, you tell them to enter a number between 1 and 12]).
    You don't want your loop to be "while (true)". You can either start at 1 and work your way up to the input number, or start at the input number and work your way down. You may want a 'for' loop instead of a 'while' loop.
    In this (and most cases), think about how you would calculate factorials manually. Write it down in English. Then, translate it to code.
    You've been working on factorials for a while now. You haven't found the algorithm yet?

  • How to add customized value to drop down by index binded to model attribute

    i have to Ui element Drop down by index to which i have binded model attribute for populating the values, now i want to add a customized value to it like "choose all".
    how can i do this ??
    Thanks and regards,
    Aditya Deshpande

    Create a value node similar to model node. In value node you can add element at the index wherever you want to:
    wdContext.node<nodename>().addElement(<index>,<element>);
    Regards,
    Murtuza

  • Binding Dropdownbykey to child node's attribute dynamically

    Hi..
    i am creating a child node "CHILD" and attribute attached to it "ATTR" dynamically. Also i create a dynamic dropdownbykey element and trying to attach the ATTR. then i get the following error. zdyn_date is data element with some fixed values. Please let me know as quick as possible.
    <b>"Adapter error in DROPDOWN_BY_KEY "KEY1" of view "ZDYN_DDKEY.MAIN": Context binding for property SELECTED_KEY cannot be resolved: The MAIN.1.CHILD node does not contain any elements"</b>
    METHOD WDDOMODIFYVIEW .
      DATA: LR_ROOT_INFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO,
            LR_CHILD_INFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO,
            cl_des type REF TO CL_ABAP_ELEMDESCR,
    ATTR_INFO TYPE WDR_CONTEXT_ATTRIBUTE_INFO.
      LR_ROOT_INFO = WD_CONTEXT->GET_NODE_INFO( ).
    CALL METHOD lr_root_info->ADD_NEW_CHILD_NODE
          EXPORTING
            NAME                         = 'CHILD'
          RECEIVING
            CHILD_NODE_INFO              = lr_child_info.
      ATTR_INFO-NAME = 'ATTR'.
      ATTR_INFO-TYPE_NAME = 'ZDYN_DATE'.
      CALL METHOD lr_child_info->ADD_ATTRIBUTE
        EXPORTING
          ATTRIBUTE_INFO = ATTR_INFO.
      DATA: LR_ROOT_CONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER,
            LE_DD_KEY1 TYPE REF TO CL_WD_DROPDOWN_BY_KEY.
      LR_ROOT_CONTAINER ?= VIEW->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
      CALL METHOD CL_WD_DROPDOWN_BY_KEY=>NEW_DROPDOWN_BY_KEY
        EXPORTING
          BIND_SELECTED_KEY      = 'CHILD.ATTR'
          ID                     = 'KEY1'
        RECEIVING
          CONTROL                = LE_DD_KEY1. .
      CALL METHOD CL_WD_MATRIX_LAYOUT=>NEW_MATRIX_LAYOUT
        EXPORTING
          CONTAINER = LR_ROOT_CONTAINER.
      CALL METHOD CL_WD_MATRIX_HEAD_DATA=>NEW_MATRIX_HEAD_DATA
        EXPORTING
          ELEMENT = LE_DD_KEY1.
      CALL METHOD LR_ROOT_CONTAINER->ADD_CHILD
        EXPORTING
        INDEX     =
          THE_CHILD = LE_DD_KEY1.
    ENDMETHOD.

    Hi ,
    can u try to create the node and its attribute in some other method..like in some action or in WDDOINIT instead of wddomodifyview .bcoz its recommended not to modify the data of node in wddomodifyview ..
    hope it will solve ur problem .
    Regards
    Yash

  • Attaching OVS to model attribute.

    Hi,
    Can I attach OVS to a model attribute in the view controller? I tried to do it but at runtime I got the error 'must not modify the datatype of a mapped attribute'. Any suggestions...Thanks.

    Hi Guys,
    i have also the same NullPointerException in a Webdynrpo App using a  RFC Model.
    Actually, i'm not a expert in this technology
    @Kalpi
    So, what you mean by reffering to parent element?
    Can you give me an example?
    Actually i fight with this problem until three days, and i've no solution.
    I hope someone can help me! I became totally desperate.
    Thanks
    Best Regards,
    Chris
    Message was edited by: Christian Kleinschroth
    Message was edited by: Christian Kleinschroth

Maybe you are looking for

  • Cisco 2960-X & ISE accounting- username Radius attribute missing

    Hi, I'm facing an issue with cisco 2960 switch radius accounting with Cisco ISE1.2.1 .here is my senario: - Username (vendor1) is configured in ISE local database, under  group (VENDOR) - Authentication protocol : wired  MAB  - Authentication method

  • Why can I not open some previous documents in Pages?

    Help! I can not open previous documents in pages.  It is instructing me to download the latest, when I do try, it tells me the most current has been installed?  I still can not open the documents?

  • Updating apps

    Hey! Well, I have problem with updating my apps on app store...each time I tap on update button a box comes up with an email of another app id which is not mine and there is no way to change it! Is there any way to sign in with my id and update my ap

  • Usage of non static members in a static class

    Can you explain the usage of nonstatic members in a static class?

  • Specific pixel size & dpi

    Is it possible to set specific a combination of size (in pxls) and dpi?  (in Illustrator CS5) I need to create a .png document which is 16x16 px and 96dpi.   The ability to chose the dpi size when setting up a new doc is very limited.   The only thin