cancel
Showing results for 
Search instead for 
Did you mean: 

Value attributes into Model Node?

Former Member
0 Kudos

Hi guys....

I faced with this "problem" a lot of times and I think that is very common....

Well, to explain better: You have an Model Node ( an Adaptive RFC Model for instance) . This node must to be used to populate a IWDTable, but you need to have another attributes ( like enabled, visibility, join attribute values, format some value, etc )....

Well, in the NW2004 the horrible workaround was create a Model Node into your context and add the "value attributes" BEFORE binding with the Model, but in 2004s ( or 7.0 ) it doesn't work... Another solution is create a value node with a similar structure ( plus the extra attributes ) and copy the values from the Model Node....

Is There another solution to solve this problems? I m thinking in create a JavaModel, that executes the RFCModel and provide the right structure, but some types of attributes ( visibility for example ) are View responsibility and not Model... Did I forget some part of the documentation ( from IWDNode, IWDTable or another one )???

Thanks a lot

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Create a model node and make a copy of created node. Now rename copied model node and add extra attributes. This is the easiest way to do.

Thanks

Krishna

Former Member
0 Kudos

Hi Alexander,

If you want value attributes under Model Node structure create a ValueNode under such ModelNode having 1:1 cardinality and keep all value attributes related to visibility or any calculated attributes under this 1:1 cardinality ValueNode.

Regards,

Gopal

Former Member
0 Kudos

How can i save values in this attributes?

for example, the result of RFC

nodeModel

- att1

- att2

- att3

- nodeValue

- att4

- att5

Modelnode is filled with several values (table), how can i fill nodeValue values within a loop??

for (int i = 0; i < wdContext.nodeModel().size(); i++)

{

???

}

Former Member
0 Kudos

Hi Christopher,

Try following code:

int leadSelection = wdContext.nodeModel().getLeadSelection();

for (int i = 0; i < wdContext.nodeModel().size(); i++)

{

wdcontext.nodeModel().setLeadSelection(i);

wdContext.currentValueElement().setAtt4("Att4 Value");

}

wdcontext.nodeModel().setLeadSelection(leadSelection);

I hope nodeValue has cardinality 1:1

Also make sure nodeValue has singleton property set to false.

Regards,

Gopal

Edited by: Gopal on Jun 13, 2008 4:55 PM

Former Member
0 Kudos

Thx Gobal, works perfect.

Unfortunately i can't reward points in this thread

Former Member
0 Kudos

Hi Christopher,

Happy your problem got solved. Regarding Points, no problem buddy..

Regards.

Gopal

Former Member
0 Kudos

No need to change lead-selection. You can also do it like this:


for (int i = 0; i < wdContext.nodeModelNode().size(); ++i)
{
  IModelNodeElement e = wdContext.nodeModelNode().getModelNodeElementAt(i);
  e.nodeValueNode().setXYZ(...); /* access value node for this model node element */
}

Armin

Former Member
0 Kudos

One more question regarding this topic:

I use the ModelNode to show values in a table. This works perfectly with the addes valueNode.

But i have implement the TableFilter and here i get the error message "attributeInfo must not be null".

This results becauce the iterator of my sourceNode (my ModelNode) don't get the values in my valueNode!

my example

modelNode

- att1

- att2

- att3

valueNode

- att4

- att5

The iterator of my modelNode (which is created in TableFilter class) contains only 3 values!!

how can is solve that??

Former Member
0 Kudos

Adapt the TableFilter class to take such subnodes into account.

Armin

Former Member
0 Kudos

Has anyone found a way to modify the TableFilter class to see these subnodes? I face the same problem and wanted to see if anyone solved it yet?

Former Member
0 Kudos

@Alexandre

Did you solve your problem? Want to do the same..

PradeepBondla
Active Contributor
0 Kudos

Hi,

By your post I understud that... you have a Model Node ( an Adaptive RFC Model for instance) with this you are populating a table and also you want to have some more attributes ( like enabled, visibility, join attribute values, format some value, etc ).... rigth?

under your Model Node (your Adaptive RFC Model) crate another Model node ( right click on RFC Model node -> new -> Model node) and in properties make "singleton" as "false" and then you can add Model Attributes as enabled, visibility like that.

This is the simplest way. and I worked on this a year back.

regards,

Pradeep

Former Member
0 Kudos

"Another solution is create a value node with a similar structure ( plus the extra attributes ) and copy the values from the Model Node.... "

I think this is a comfortable way doing that, don't know how to make that easier..

nikhil_bose
Active Contributor
0 Kudos

I didn't get your point exactly. From what I understood, you can make sub nodes within a model node where you can place value attributes and can have attributes with calculated property.

nikhil