Skip to Content

How to extend a table that's bound to a model by an additional column?

hi,

i'm using a table, that's bound to a context-node, that's mapped to a model-node.

now, i want to add an additional column to this table. so, I've created a new Value-node in the root context wuth a value attribute, added a column to the table and set the value of the column to the value-attribute.

the value-node is filled during runtime with as many elements as the table has got rows.

BUT: in the new column, all rows of the value-attribute are filled with the first entry of the value-node.

doesn't the table recognize, that the value-node has a cardinality of 0..n and uses for each row the according element?

kr, achim

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2005 at 01:47 PM

    Hi Achim,

    And set to OutMyNewTable node - singleton - false

    regards,

    Aliaksei

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2005 at 12:57 PM

    Just create your Value node as sub-node of "main" table model-node

    VS

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi all,

      let me suggest an additional declaration step:

      Make <i>OutMyColumnForTable</i> node (cardinality 0..1 or 1..1) to be the child of OutTable node, but not Output node, set the single-property of this node to 'false' <b>and additionally declare a supply function for <u>populating</u> this inner non-singleton node of cardinaltiy x..1 <u>on demand</u></b>.

      The Web Dynpro Java runtime implements a <b>'populate by rendering' mechanism</b> since NetWeaver <i>04 - Support Package 9</i>. This means the existing non-singleton node instances are only populated (validated) by the Web Dynpro Runtime in case their contained content (in this case the attribute values of one contained node-element) has to be displayed in the the table. When the table only displays five lines (five node elements in the OutTable-node) the supply function is only called five times although perhaps 500 lines exist in total.

      This approach is very helpful as soon as the retrieval of context data is time-consuming based on a required backend access.

      Regards, Bertram

  • Posted on Jan 18, 2005 at 12:55 PM

    Hi Achim,

    In my opinion the table UI element cannot be bound to attributes from different nodes. The table UI should be bound to all the attributes under one node only.

    Regards

    Sidharth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2005 at 06:00 AM

    Hello Achim,

    I also have a similar requirement but somehow I am not able to fill my defined value node.

    Actually I have defined a extra value node (with one value attribute) which I need to fill based on one of the other column value. Now I tried it using a calculated property of the value attribute. But somehow I am not able to achieve this as all the rows in the table for this attribute is filled based on the Lead Selection.

    Kindly give some input on how to fill this node.

    Thanks in advance,

    Rakesh

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Rakesh,

      what I did (in the wdDoInit or wdDoModify):

      for (int i=0; i<Node_with_base_values.size(); i++) {
        wdContext.Node_with_base_values.setLeadSelection(i);
        wdContext.Node_with_additional_value.setLeadSelection(i);
        wdContext.currentNode_with_additoinal_valueElement.setValue(...); //according to the base value
      }
      

      also make sure, that you've met the requirements explained in the posts above (new value node is child below model node, singleton=false, etc.)

      kr, achim

  • author's profile photo Former Member
    Former Member
    Posted on Feb 04, 2005 at 04:42 PM

    Hello Achim,

    Thanks for your code. However I have achieved this in a different way, hence I thought that I will share that here.

    Actaully I had defined the calculated property as true for the extra value attribute defined. Hence I got two methods set<ValuenodeValueAttribute....> and get<>..

    Now in the get method I got the parent node element as

    IPrivate<viewname>.I<parentelement>Element parentelement = (IPrivate<viewname>.I<parentelement>Element) element.node().getParentElement();

    And then I set the value for the defined elemnt as required as folows :

    if (parentelemnt.get<attributename>.(some condition))

    return <what u want>

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.