Skip to Content
author's profile photo Former Member
Former Member

TableView

Hi,

I have a Value Node (NodeA) and a Value Attribute (AttributeA). The attribute is of type SimpleType stored in the local dictionary.

Cardinality 1..n

Selection 1..n

singleton true

In my view I have a TableView with 2 columns. Column 1 is mapped to AttributeA of NodeA, which is a dropdown.

In my View doInit() method I have the following code:

for( int i = 0; i <= 5; i++)

{

IPrivateNameofView.INodeAElement newElement =

wdContext.createNodeAElement();

newElement.setAttributeA("");

wdContext.nodeNodeA().addElement(newElement);

}

The TableView shows up with 5 rows and dropdowns in each row.

The problem is when I make a selection in the drop down in row1 and select row3 the element selected in Row1 dropdown gets shown for all drop downs in all 5 rows.

Any suggestions would be appreciated.

~NAC

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 03, 2005 at 03:51 AM

    Any thoughts.

    NAC

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Try doing this:

      Make your ValueNode have singleton=false. If it is at the root level of the context you will not be able to do this, so create a "dummy" node with Singleton=true (cardinality=0..n, selection=0..1), and place your value node under this.

      Good luck,

      Walter

  • author's profile photo Former Member
    Former Member
    Posted on Oct 03, 2005 at 09:00 AM

    Using drop-down lists in a table:

    1. If you need drop-down lists with different <b>entries </b>in each row, you <b>cannot </b>use DropDownBy<b>Key</b>, because the entries are provided by the value set of a context attribute type (which is the same for all rows).

    So let's assume you are using the *ByIndex variant.

    For providing different entries per row, you have to provide a <b>non-singleton</b> subnode "Entries" (cardinality 0:N, selection 0:1) of the table's data source node "Rows".

    Then each node element of "Rows" has its own node "Entries". The drop-down list in table row #i corresponds to node "Entries" of the node element #i in "Rows".

    The drop-down list selection in table row #i corresponds to the lead selection of "Entries" of the node element #i in "Rows".

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 03, 2005 at 02:12 PM

    I have declared nodes as suggested by Walter

    - Node A (cardinality=0..n;selection=0..1; singleton=true)

    - Node B (cardinality=0..n;selection=0..1;

    singleton=false)

    .AttributeA

    I am trying to initialize this node in the View but am facing issues.

    IPrivateView.INodeA nodeElement = wdThis.wdGetContext

    ().nodeA();

    for( int i = 0; i <= 5; i++)

    {

    IPrivateView.INodeBElement nodeBElement =

    wdContext.createNodeBElement();

    nodeB.setAttributeA("");

    nodeElement.addElement( nodeBElement);

    }

    Any advice would be appreciated.

    NAC

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Suppose you have the following context structure:

      A (node, card=0:N)

      +-- B (node, card=0:N, non-singleton)

      +----- X (attribute)

      To create 5 elements in node A, each with 2 elements in its node B:

      
      for (int i = 0; i < 5; ++i)
      {
        /* create and add A-element */
        IAElement a = wdContext.nodeA().createAElement();
        wdContext.nodeA().add(a);
        for (j = 0; j < 2; ++j)
        {
          /* create and add B-element */
          IBElement b = a.nodeB().createBElement();
          a.nodeB().addElement(b);
          b.setX("I am B-element " + j + " in A-element " + i;
        }
      }
      

      Armin

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.