Async Table question

Dear all.

I have an async table to which the user can add rows and delete them. I have the following problem: in each row I want to display a dropdown. This dropdown is bound to an IS-service returning a list of numbers. When the user selects a number from the dropdown, another service must be invoked. This service returns a couple of values, which are to be filled in the cells of the appropriate row in the table. I don’t understandt how I bind the output of the second service to the cells in the different rows and futhermore how to add the inserted rows after a submit to my managed bean.

I hope you understand my problem and can give me some hints. Thanks in advance

Henning

Probably the best way to implement this would be using custom addRow action for your table. Default add row control works on the client only and server side model is getting updated when form is submitted. This however creates problems with dropdown and service invoke.

Instead you may create a java method in your page bean to add a new row to the backing array or list model and have a command link/button to invoke it.

I also assume that you have created a list table provider on top of your array for your table because we’d need to use its feature to keep track of the current row in the table. Add a hidden command into a row of the table and have onChange of the dropdown to fire this command.

What happens in the action of this hidden command is that provider used for the table will have current row set. The action then invokes second web service using input directly from provider (value is submitted from dropdown) and re-assign outputs of the web service to the other fields of the provider which need to be populated (they will be set on the current row which is the one fired the command)

It is a bit complicated, but hopefully you get an idea