Attributes iteration of a value node bound to a structure invalid?

A context value node bound to a structure always delivers all attributes of the structure bound instead of the attributes, which were selected from the available structure attributes.
For example, if structure S has the attributes A, B and C and the value node V is bound to S, but "inherits" attribute A only, the code
wdContext.nodeV().getNodeInfo().iterateAttributes()
delivers an iterator which loops 3 times and returns A, B and C as attribute infos.
Is this a wanted behaviour? I would expect that only the attributes, which are bound to the corresponding structure attributes (A in the sample) are returned.
Regards
Stefan
Just to be a little bit more accurate: the term "structure" means a complex type defined unter "Structures" in the "Local Dictionary" for example. Attributes and nodes are Value Attributes/Nodes.
Message was edited by: Stefan Klensch

Yes, it is the intended behaviour. These <i>are</i> the attributes at run time. And I don't see why the additional structure attributes should be hidden from the application (besides the fact that iterateAttributes() is used internally, too).
If you are interested whether an attribute was originally declared or was automatically added due to the structure binding, look at IWDAttributeInfo.isDeclared().

Similar Messages

  • Access to an attribute of a value node of a component controller

    Hello experts,
    I'm new to the area of SAP CRM Web Client UI development. My problem is probably very simple and you will surely smile about it.
    I have created my own component with the value node FILE (that consists of five atributes) in the component controller. Unfortunately I have not figured out yet how I can access the value of an attribute.
    The first thing I do not know is where I can find the controller-ID.
    In addition, I get an syntax error Field "TYPED_CONTEXT->FILE->COLLECTION_WRAPPER->GET_FIRST(" unknown in the line with "lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).".
    Currently no functionality is included in my code, because firstly I want to understand the basics.
    method OP_FILEUPLOAD.
      data lo_entity       type ref to if_bol_bo_property_access.
      data lv_file_name    type string.
      data lr_file_content type ref to data.
      field-symbols <lv_file_name> type string.
      IF ( comp_controller is INITIAL ).
        get_controller( 'xxxx' ).
      ENDIF.
      lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
      while lo_entity is bound.
        lv_file_name = lo_entity->get_property_as_string( 'FILE_NAME' ).
        lr_file_content = lo_entity->get_property( 'FILE_CONTENT_STRING' ).
        assign lr_file_content->* to <lv_file_content>.
        lo_entity = me->typed_context->file->collection_wrapper->get_next( ).
      endwhile.
    endmethod.
    I hope that I will manage my "problem" with your help!
    Sebastian
    Edited by: Sebastian Lenz on Jun 27, 2011 2:35 PM

    Hi Sebastian,
    The issue is in the following line of your code:
    lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
    The 'typed_context' belongs to your own component controller class and not the standard framework superclass. So, you need to replace this single line of code with something as follows (assuming that your component controller class is ZCL_CUSTOM_BSPWDCOMPONENT_IMPL):
    DATA lr_coco TYPE REF TO ZCL_CUSTOM_BSPWDCOMPONENT_IMPL.
    lr_coco ?= me->comp_controller.
    lo_entity = lr_coco->typed_context->file->collection_wrapper->get_first( ).
    The me->comp_controller reference will refer to the standard framework superclass of all component controllers and this does not have any typed_context attribute with it. The real component controller that gets created when you create a BSP component will have this attribute. That is why you need to first cast it to your own reference type before trying to access its typed_context.
    And if your value node will have only single values, then you can as well do the following to access the attribute ATTRIB1 of context node node1:
    DATA lv_value TYPE string.
    lv_value = lr_coco->typed_context->node1->get_attrib1( attribute path = '' ).
    Basically all attributes can be accessed by above code by using the right getter method.
    Regards,
    Shiromani

  • How to set Value Attribute (under valu node) at run time

    Hi,
    This is my View context.
    wbsElement (Value Attribute of Type String)
    This is my Component Controller Context.
    Project_info  (Value node)->Wbs_Info (Value Node)-WBS(Value Attribute).
    Initially I want to set some dummy values to wbsElement(view attribute),sothat I can show that in drop downby key.
    On selecting of wbsElement I want to pass the selected value to component controllers ValueAttribute - WBS (this Value attribute is under 2 nodes-see the structure I've given).
    I tried this way which is not working fine.
        IWDNodeElement element = wdContext.createWBSElement();
         wdContext.nodeWBS().addElement(element);
        wdContext.currentWBSElement().setWBS(wbsElement);
    Can anyone tell me which is the correct way to do this?
    This is very urgent.plz help me in this.Thankx in advance.
    Regards,
    Karthick

    Hi Karthick,
       try this code.
    IPublic<compcontrolllername>.IWbc_infoElement  obj  =         wdThis.wdGet<Componentcontrollername>Controller().wdGetContext().createWbc_infoeElement();
    obj.setWBS(wdcontest.currentContestElement.getwbsElement());
    wdThis.wdGet<Componentcontrollername>Controller().wdGetContext().nodeWbc_infoElement().addelement(obj);
    set the cardinality of Project_info to 1:n or 1:1
    test this one
    if you find any problem let em know
    regars
    Naidu

  • Access a value attribute under a value node

    Hi guys,
    Could you please help me on this one. I need to access value attributes that are under a value node?. I use the following codes and I always have the error "java.lang.NullPointerException ".
    1) wdThis.wdGetContext().currentMyValueNodeElement().getMyAttribute();
    2) wdContext.currentMyValueNodeElement().getMyAttribute();
    Thanks in advance
    Franck

    HEre is an example where I'm pulling a value from a value attribute where the Node is a table.  "Ytdsl" is the actual value attribute name.
              //      Get the total  from the last line of the table
              String sx =
                   wdContext
                        .nodeChannelList()
                        .getElementAt((wdContext.nodeChannelList().size() - 1))
                        .getAttributeValue("Ytdsl")
                        .toString();
    Regards,
    Rich Heilman

  • How to populate a Value Attribute of a Value Node inside Model Node

    Hello
    I have my context like this.
      Context
    ..          - ModelNode
    ....                      - Model Attr1
    ....                      - Model Attr2
    ....                      - Model Attr3
    ....                      - Model Attr4
    ....                      - Value Node
    ......                                  |
    ......                                   - Value Attr1
    Model Node is of Cardinality 0..N
    Value Node is of Cardinality 1..1
    I want to create multiple records in my Model Node and one record for every Model Node in Value Node.
    How to do this?
    All good suggestions are welcome.
    Regards,
    Shubham

    Hi Shubham,
    With your context structure the code will be
    for(int i = wdContext.nodeModelNode().size()-1 ; i>=0 ; i--)
        IPublic<comp name>.IModelNodeElement ele =   wdContext.nodeModelNode().getModelNodeElementAt(i);
        IPublic<comp name>.IValNodeElement valEle = wdContext.nodeModelNode().nodeValNode().createValNodeElement();
        valele.setValAttr("");
        ele.nodeValNode().addElement( valEle);
    Your val node should be non singleton (singleton property = false)
    Regards,
    Jaydeep

  • How to pass value node attributes to transaction launcher?

    Hallo,
    I want to pass some parameters to transaction launcher.
    Im using a url-transaction.
    My context node is a value node.
    Can i enhance a handler class?

    Hello,
    Did you have a look at this thread ?
    WebClient Transaction Launcher Parameters
    Regards,
    Nicolas.

  • How to populate value of a Z table which is a value node for the context?

    Hi,
    My requirement is to display the content of a z table onto a webpage, for this a have create a z component having a tableview with value node (Z table) assigned.
    In output its showing the table with table columns name. But how to display the content of that table?
    Regards,
    Payalg

    The get_xxxX methods should be automatically created and there is no need to add any code .. it generally has this kind of code.
        DATA: current TYPE REF TO if_bol_bo_property_access.
        DATA: dref    TYPE REF TO data.
        value =
    CNODE1 not bound'."#EC NOTEXT
        if iterator is bound.
          current = iterator->get_current( ).
        else.
          current = collection_wrapper->get_current( ).
        endif.
        TRY.
            dref = current->get_property( 'FIELD1' )."#EC NOTEXT
          CATCH cx_sy_ref_is_initial.
            RETURN.
        ENDTRY.
        IF dref IS NOT BOUND.
          value = CNODE1/FIELD1 not bound'."#EC NOTEXT
          RETURN.
        ENDIF.
        TRY.
            value = if_bsp_model_util~convert_to_string( data_ref = dref
                                        attribute_path = attribute_path ).
          CATCH cx_bsp_conv_illegal_ref.
            FIELD-SYMBOLS: <l_data> type DATA.
            assign dref->* to <l_data>.
          please implement here some BO specific handler coding
          conversion of currency/quantity field failed caused by missing
          unit relation
          Coding sample:
          provide currency, decimals, and reference type
          value = cl_bsp_utility=>make_string(
                             value = <l_data>
                             reference_value = c_currency
                             num_decimals = decimals
                             reference_type = reference_type
              value = '-CURR/QUANT REF DATA MISSING-'.
          CATCH cx_root.
            value = '-CONVERSION FAILED-'.                  "#EC NOTEXT
        ENDTRY.

  • Model and Value node data in one form...?

    Hello,
    I have a requirement where the adobe form is expected to have model data available and then in the same form teh user provides data, which is maintained in value node.
    Now the problem we are facing is, we are unable to maintain both value node and model node(i.e,attributes) under one type of node.(Invalid node type error appears when tried to place both attributes under one node).
    How do we provide them to data source, as it takes only one node.
    Thanks & Regards,
    Sharath

    Hi,
    you could try to add a some calculated attributes in the node which is bound to the interactive form. In the getter and setter methods of these calculated attributes you can read and set the value of your model attributes.
    Regards
    Sebastian

  • Value Nodes vs. Model Nodes

    Hi,
    why model nodes have to be initialized via Service Controller and needs to be bound to a model class instance and value nodes don't need that?
    Thank you,
    Pietro

    Hi Pietro,
    A model node is similar to value node in respect to it's API.
    The main diff are:-
    Value node
    1.It maintains it's own elemnet collection,each element holding the actual runtime data.
    2.While creating new element for a value node ,the node can create element object using metadata stored within it.
    3.the children of a value node only be value nodes or value atrributes.It can't be a mix value and model nodes or attribute if the 
       parent is a value node.
    Model Node
    1.The element collection maintains by a model node is simply a collection of reference to model object instances.
    2.Actual runtime data is stored in model object, not in model node's element collection.
    Hope this will help you. if you want more check this.
    http://help.sap.com/saphelp_webas630/helpdata/en/b8/cd96edb9c8794aa362e6e8b4236a1f/frameset.htm
    Thanks & Regards,
    Bhargava.

  • Binding value nodes to component in a view

    Hi,
          What is the use of these value nodes and value attributes? How can I bind them to, say a inputfield in my view? Can any change to the value node dynamically affect the inutfield?

    Thanks to Peter Conrad for the answer. The answer's in a different post. I have included his reply below.
    From a binding perspective there's no difference between value or model nodes/ attributes. you can always bind using the syntax
    //<contextnode/attribute to the value attribute of the tag.
    And yes, for accessing the value the SET_<attribute> and GET_<attribute> methods should be used in this case.
    Peter
    Edited by: Arun Prakash Karuppanan on May 15, 2008 10:24 PM

  • How to have a tree view for value node..

    Hi all,
    I need to display a tree view for a value node in web ui  just like a model node, for a custom view in a pop up. Please guide me  how to do this or let me know the process steps.
    Thanks in advance.

    Hi All,
    while debugging I found that in class CL_BSP_WD_CONTEXT_NODE_TREE , the method GET_T_TABLE the below code is not triigerring for the child node attributes ( to trigger the get method of attribute for value node).
    this call method is not triggering at all only for first coulmn its triggering ..
      LV_TN ?= ME->NODE_MAPPER->GET_NODE_OBJECT( <LINE>-NODE_KEY ).
        CONCATENATE 'GET_' COMPONENT INTO LV_METHOD.
        TRY.
            CALL METHOD LV_TN->(LV_METHOD)
              EXPORTING
                ATTRIBUTE_PATH = ''
              RECEIVING
                VALUE          = VALUE.
          CATCH CX_ROOT INTO LV_ERROR.
    I created the GETTER method inthe class CN01 and CN02. But those methods are not triggered in CALL METHOD LV_TN->(LV_METHOD). Even that class CN02 is having the  same methods. Those methods are already Implemented. May I know what was the reason Why those methods are not triggered ( getter method ). With out that Method data will not display in the Tree view. Can anybody tell me the reason why it is not happenning?
    .Please find the below .HTM code  as well.
    <chtmlb:configTree
                          actionsMaxInRow       = "5"
                       id             = "Table1"
                       nodeTable      = "<%= ZTREEVIEW->node_tab %>"
                       table          = "//ZTREEVIEW/Table"
                       noFrame        = "FALSE"
                       personalizable = "TRUE"
                       onCollapseNode = "NODECOLLAPSE"
                       selectionMode  = "MULTILINEEDIT"
                       onExpandNode   = "NODEEXPAND"
                       onRowSelection = "select" />
    Only one column was triggered another column did not get any value becasue of the above method call fail.. We are not restricted anywhere to display one column value in the output.   Even in Debugging I checked that LV_METHOD  is having the method name. CN02 class is also having the  same method, But it is not going into the method. It is coming out side. What could be  the reason I could not able to understnad.
    Please provide me some pointers on the issue....
    Thanks in advance..

  • Dynamic removing of Value Nodes

    Hi,
    in my application I create Value Nodes and Value Attributes dynamically.
    How can I remove this Value Nodes and Attributes again dynamically?
    Regards,
    Eva

    Eva,
    The only way is to completely reset context:
    wdContext.reset(false);
    This will remove all dynamically created nodes / attributes. You have to recreate structure afterwards (obviously, without node you were actually "removing")
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com/

  • Problem while copying from model node to value node!!

    Hi All,
    I am trying to copy the contents of model table to newly created value table. For this i have written following code -
    IWDNode targetnode = wdContext.nodeZhress_Firstday_Service_ValueNode();
    IWDNode sourcenode = wdContext.nodeOutput().nodeT_Zhress_Firstday_output();
    WDCopyService.copyElements(sourcenode,targetnode);
    tagetnode is the node which is created in root context and sourcenode is the node which the node that shows the output when RFC runs.
    After that by using copyService i m trying to copy from source to targetnode.
    This target node is also binded to table, for getting the output.
    When i copied the things from source to target it's size is equivalent to source node but its not getting any data from source node and showing blank in the table.
    When i have tried to get whats it showing, its showing me        null .
    Please help me on this problem.
    Regards,
    Roshan Gupta

    hi
    check out this threads
    Re: WDCopyService - copy model node to Value node
    WDCOPYSERVICE
    Value of attribute not copied after WDCopyService.copyElements
    Regards,
    Gopi

  • Invalidate concept for value node and model node

    Hello everybody,
    We have invalidate method for value node and model node.
    I want to know basic concept behind this method.
    What this method acually does?
    Regards,
    Bhavik

    Hi Pran and all,
    I figured out the problem. Input parameters are going multple times. So, depending upon that it gives multiple values.
    My scenario is:
    Root Node
    |_ Input_node1
         |_Attr1
    |_ Input_Node2
         |_Attr2
    |_Output_node
         |_Result
    I am passing values in Attr1 and Attr2 attributes.
    For this, first of all, i wrote following code.
    In controller, i have initialized Root node:
    Root_Node model = new Root_Node();
    wdcontext.nodeRoot_Node().bind(model);
    In view, I set values for attr1 and attr2 using following code:
    Ipublic<View>.IInput_node1Element ele = wdcontext.createInput_node1Element();
    ele.setAttr1("<value>");
    wdcontext.nodeInput_node1().addElement(ele);
    Ipublic<View>.IInput_node2Element ele1 = wdcontext.createInput_node2Element();
    ele1.setAttr2("<value>");
    wdcontext.nodeInput_node2().addElement(ele);
    But this code didnt work. Model was executed without data in this case.
    So, i thought that these elements were created at view level only. And corresponding model objects were not created.
    So, I have changed code like following way:
    I have removed initialization code for Input_Node1 and Input_Node2 from view. Now, I am getting input values in two different value nodes. And before calling custom controller's method to execute model, I am making two ArrayLists and filling data in it. Now, i am passing these ArrayList objects as parameters to controller's method.
    In this method, i am setting both values as follows:
    wdcontext.currentRoot_NodeElement().modelObject().setInput_Node1(List1); 
    wdcontext.currentRoot_NodeElement().modelObject().setInput_Node2(List2); 
    Then i am executing my model.
    But, When i am setting values for Input_Node1 and Input_Node2 as shown above, values are appended instead of overwritting the value. Because of this appended values, it gives mupltiple results.
    Means, Both ways are not proper. What should be the proper and best way to pass values in this case?
    Thanks,
    Bhavik

  • Cardinality of a value node

    Dear friends,
    When I create a value node in the context controller why should I change its cardinality to 1..1 and not to keep it as the default one 0..n?  And what will happen if I leave it unchanged?
    I really want to understand that from the runtime data point of view.
    regards,

    Hi Hisham,
    Cardinality:
    Any node or attribute that has the context root node as its immediate parent, is known as an independent node or attribute.
    Any node or attribute that has some other node as its immediate parent, is known as a dependent node or attribute.
    All context nodes are collections.
    A node collection is composed of elements, where an element is an aggregation of the node’s immediate children (attributes and/or other nodes).
    The cardinality property controls the number of elements a node collection may hold at runtime.
    Every context node has a property called Cardinality. This property is composed of two values that taken together, describe the maximum and minimum number of elements the node collection may hold
    at runtime.
    Therefore, there are four possible cardinality values (specified as <Min>..<Max>)
    0:1: At most one element can be selected
    1:1: Exactly one is selected
    0:N: Any number of elements can be selected
    1:N: At least one ...
    The first two values define a node with single-selection. The second two values define a node with multi-selection.
    Like if you have input field , in that case if you are binding it with the value node then you need cardinality as 1:1/1:n.
    The reason is that it will create an element always for you so that you can give some input in this element.
    If you set the cardinality to 0:1/0:n then it will disable the input  field and user will not be able to enter the data.
    Thanks n Regards,
    Jhansi Miryala

Maybe you are looking for

  • I cant get my sound to work

    I have the MSI K8M Neo-V Socket 754 VIA K8M800 ATX AMD Motherboard. I cant get the onboard audio to work. I've downloaded and ran necessary drivers and still pc can not find an output sound device anyone have any ideas

  • Want SCRIPT name for DME

    Hi Experts,      I want to know what is the print program and SCRIPT for DME(Data Medium Exchanger). Thanks & Regards, Vallamuhtu.M

  • Two Quicktimes

    After installing Lion, I find that I have both Quicktime 10.1 and Quicktime 7.   Why do I have both, and what s the difference?  Should I keep both for some reason?

  • PSE 12 not working

    I have install PSE 12 but the install fail in Shared technologies. When I start PSE the starting windows appears and I can't go further

  • How to config.  rfc connection

    hi all, how do we config. RFC connection,JCo and SLD plz give me good example also.. Regards