cancel
Showing results for 
Search instead for 
Did you mean: 

!!Value help within a Table - selection reflects all table lines!!!!

Former Member
0 Kudos

Hi,

I have created a view with table ui element.

The user should add lines to the table.

The table has one coulmn which it's value coming from a value set list ( implemented as evs value help) .

<u><b>The problem is that when i add line1 and select val1 from the list and

than add line2 and select val2 from the list, also line 1 value became val2.</b></u>

<u><b>How can i manage correctly the values in the value help column??</b></u>

I have tried to bind the column value in the ui , to a table created in context ,meansI have created node1.node2.val_code but it didn't help.

The code i used to create the value set somthing like below:

WDAttributeInfo attributeInfo =

wdContext.getNodeInfo().getAttribute("Country");

ISimpleTypeModifiable countryType =

attributeInfo.getModifiableSimpleType();

countryType.setFieldLabel("Country");

IModifiableSimpleValueSet valueSet =

countryType.getSVServices().getModifiableSimpleValueSet();

Thanks in advance,

Ronit.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

How did you bind the table cell editor, what is the context structure?

Armin

Former Member
0 Kudos

Hi,

My context structure is:

Attribute node visaTypeIcoll cardinality 0..n

below it

Attribute node VisaTypeKcoll cardinality 0..n

below it

Attribute value visa_code

Attribute value visa_val

In the UI i bound the value of the cell to VisaTypeIcoll.VisaTypeKcoll.visa_code

Any more details?

Thanks a lot for your help...

Ronit

Former Member
0 Kudos

Probably node "VisaTypeKcoll" should have singleton=false. Can you check that?

Armin

Former Member
0 Kudos

Hi,

Nodes attributes:

VisaTypeIcoll and VIsaTypeKcoll

cardinality 0..n

collectionType list

initializeLeadSElection true

selection: 0..1

singleton true

typeAccessrequired true

??

Maybe my problem is with adding new line to the table

FIrst I am adding element VisaDataElement - for line mapped to model fields

and also add KcollElement - for line search help field

Than i am building the search help for the field in the Kcoll

wdContext.nodeVIsaData.addElement(wdContext.createVisaDataElement(new(...));

wdContext.nodeVisaTypeIcoll.bind(wdContext.createVIsaTypeIcollElement());

IPrivateView.IVisaTypeKcollelement ne = wdContext.createVisaTypeKcollElement();

wdContext.nodeVisaTypeKcoll.addElement(ne);

and than build sarch helpe for visaType_code

Thanks,

Ronit

is somthing wrong?

thanks,

ronit

Thanks again

Ronit

Former Member
0 Kudos

Hi Ronit,

Cut the node VisaTypeKcoll from visaTypeIcoll and paste it in the Context.

Then map the VisaTypeKcoll.visa_code attribute to the table cell editor

Add the values to VisaTypeKcoll.visa_code using the valuehelp code.(This code needds to be executed before the creation of row in table and only once)

Then add the table row.

Hope this is helpful

Fahad Hamsa

Former Member
0 Kudos

Hi,

Thanks a lot for your reply.

I Still got the same problem.

<b>Context:</b>

Node A (model node)

---> Node B (model node)

att1

att2

Node VisaK (Value node cardinality 0..n Structure Visa from Dictionary Singleton true

visa_code

visa_val

<b>Layout:</b>

A table with field f1, f2 f2 is field with value help

Table data source is A..B

f1 cell is mapped to A.B.att1

f2 cell is mapped to VisaK.visa_code

<b>doInit():</b>

if(wdContext.nodeVisaK().size() == 0)

{

//Add values to visaK.visa_code

IWAttributeInfo att = <b>wdContext.nodeVisaK().getNodeInfo().getAttribute("visa_code");</b>

ISimpleTypeModifiable visa_code = att.getModifialeSimpleType();

IModifiableSimpleValueSet val2 =

visa_code.getSVServices().getModifiableValueSet();

.

.

.

val2.put(code,val);

<b>onactionAddVisaLine():</b>

wdContext.nodeB,addElement(wdContext.createBDataElement(new ...));

wdContext.nodeVisaK().addElement(wdContext.createVisaKElement());

}

Do you have a idea what's wrong???

Ronit.

Former Member
0 Kudos

First, the node "VisaK" must be placed under node "B", the table data source.

Additionally, why do you need cardinality 0:N for node "VisaK"?

As far as I understand your use case, you want to store a single "visa_code" and "visa_val" for each row. If that's the case, I would give node "VisaK" cardinality 1:1 and singleton=false.

Then, the code for adding a new row, is something like

IBElement b = wdContext.nodeB().createBElement();
wdContext.nodeB().addElement(b);

IVisaKElement v = b.nodeVisaK().currentVisaKElement();
v.setVisa_code(<whatever>);
v.setVisa_val(<whatever>);
createValueSet(b.nodeVisaK());

As there is a separate "VisaK" node for each "B"-element, you cannot initialize the value set in wdDoInit(), but after creation of the "B"-element.


void createValueSet(IVisaKNode visaK)
{
  IWDAttributeInfo att = visaK.getNodeInfo().getAttribute("visa_code");
  /* etc. */
}

Armin

Former Member
0 Kudos

Hi,

<u><b>Thanks a lot</b></u> for your help, by sending me such a good, detailed and working solution.

I'm really appreciate it.

Ronit

Former Member
0 Kudos

Thanks a lot for the nice words.

Armin

Answers (1)

Answers (1)

monalisa_biswal
Contributor
0 Kudos

I think u have binded datasource of table UI element to the subnode(whose singleton property is set to false)

Instead u bind it to the parent node.

Example:

Node A<-----Table's Data Source

---attr1

---attr2

-


Node B-(singleton false)

-


attr1<-----DropDownByIndex