on 12-18-2006 9:20 PM
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.
How did you bind the table cell editor, what is the context structure?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.