cancel
Showing results for 
Search instead for 
Did you mean: 

Can't bind table to context node

Former Member
0 Kudos

Hi!

In the view, I added a child of type Table, then I created a bind to a context node. The table is showing OK in the layout but when I save I get an error saying, and I quote: «Table MyTable : Context element and property are not compatible».

Well, this context node (in the view) is bound to one on my custom controller context. The controller node is bound to the model.

After getting the error, I select the properties of the table to chage the datasource but when I press (...) button to select the datasource it says «Select an attribute of type ''». Shouldn't this dialog be saying something like «Select a multiple node»!?!?

Please help, I'm not very experienced in Web Dynpro Java.

Thanks,

Osvaldo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sounds like a bug in your IDE. Open an OSS message (BC-DWB-WD-JAV).

Armin

Former Member
0 Kudos

>

> Sounds like a bug in your IDE. Open an OSS message (BC-DWB-WD-JAV).

>

> Armin

Hi Armin and thanks for your reply.

I also thought it was a bug in the IDE but the FlightTutorial works fine: I can add the table and create the binding ok, no errors.

The only diference I see in these two projects (mine and the tutorial) is that the tutorial is developed localy in my computer and the other one is developed according to a development configuration. I don't know if this detail matters.

So can anyone tell me if there is any DC I should add to my "DC Metadata" in order to get my table's datasource to work properly?

Thanks, I really appreciate all the help I can get from you guys.

Osvaldo

Answers (2)

Answers (2)

Former Member
0 Kudos

Problem solved!

It was NWDS version that was incompatible with the Table and the definition of its datasource!!!

Now I have NWDS Version: 7.0.17, Build id: 200809171914 and it works fine.

Thanks for your help.

Osvaldo Silva

chander_kararia4
Contributor
0 Kudos

Hi Silva,

I do not understand your problem much. But, to create a table in web dynpro just follow the steps:

1. Create Node, say suppose A

2. Under that, create attributes as required by you. say suppose A1, A2 & A3. Select the attribute types as required by you.

3. Now, go to outline view & add a table by using "Insert Child" option.

4. Right click on the table & select create binding. A dialog box will appear. Select the checkbox in front of the newly created node. Click Ok.

That's it. In case of other issue please tell your scenario more clearly. Also, tell me what data type of columns you require. So it can be explained.

Regards

Chander Kararia

Edited by: Chander Kararia on Feb 6, 2009 5:06 PM

Former Member
0 Kudos

Hi Chander, thanks for your reply.

I've tried your sugestion and I've done all of the steps you sugested but I get the same result: «Context element and property are not compatible».

I think the problem is this: I can't bind the table to a node!!! (Is there some special property in the table or in the context node that I'm missing?)

I goint to try to explain more what I'm doing.

I need to show the results from a query in a table after the user fills a search form.

I've followed the steps shown in the FlightList Tutorial, so I have a SearchView, a ResultView and a custom controller.

I've created the model and added it to my component, I've also created the nodes needed in the views and in the controller and these are correctly bound between them. There is no problem in the SearchView only in the ResultView.

My ResultView context looks like this:

.Result (node) (mappinpType: collection_and_selection; cardinality: 0..n)

-->Name (attribute) (type: string)

-->Address (attribute) (type: string)

-->Phone (attribute) (type: string)

-->Birthdate (attribute) (type: date)

**(remember that this node is mapped to my custom controller node, so it represents my model data types)

In my ResultView outline I've added a child element of type Table (named ResultsTable) and then created the binding with the views context node "Result". After this step, the table shows in the layout correctly but when I look at the table properties I see that the property "datasource" has an error saying: "Table ResultsTable : Context element and property are not compatible".

Then when I press the (...) button to change the datasource of the table, the dialog that appears (name: "Context Viewer") asks me to select an attribute of type ''.

I'm guessing that this dialog should be asking me for a multiple node as it does when I used the FlightList tutorial.

I can't understand what's happening, it's like my table datasource can only be an element and not a node!

Hope I've been more clear about the problem. If there is anything more you want to know, please say it.

Thanks,

Osvaldo

chander_kararia4
Contributor
0 Kudos

Hi Silva,

I understand your problem but it is not like that your table cannot have node.

Before that, could you please let me know that while creating the binding, you have the "edit table property" window (here you can change the mapping property). What all the contents you have selected. Probably, it is might be coz of date type.

Also, in you post you said:

Result (node) (mappinpType: collection_and_selection; cardinality: 0..n)

What do you mena by mapping type: collection_and_selection ?

Regards

Chander Kararia

Former Member
0 Kudos

>

> Hi Silva,

>

> I understand your problem but it is not like that your table cannot have node.

> Before that, could you please let me know that while creating the binding, you have the "edit table property" window (here you can change the mapping property). What all the contents you have selected. Probably, it is might be coz of date type.

>

> Also, in you post you said:

>

> Result (node) (mappinpType: collection_and_selection; cardinality: 0..n)

>

>

> What do you mena by mapping type: collection_and_selection ?

>

> Regards

> Chander Kararia

Hi Chander,

On the first step when I'm creating the binding, I select the context node "Results" and all attributes are selected.

On the second step, I leave all table columns set to the defaults, i. e.: editor = TextView, binding property = text, and I click "Finish".

About the mappingType, I've only stated that because I know it's mandatory to be of that type if you want to bind that node to a table, i think!

Thanks,

Osvaldo