ObjectListDataProvider issues
Hello,
I've got a table bound to an ObjectListDataProvider and everything displays appropriately using the work arounds described in some of the ohter threads. So, I'm not having an issue getting and displaying my list of objects.
My issue is that I need to allow the user to edit a particular object out of that list so I've added an "Edit..." button to the table. When the button is clicked, I want to find the appropriate object in the list bound to the data provider and allow the user to use data in that object for other purposes on another screen.
I know how to get the appropriate RowKey and all that stuff for normal dataproviders but for some reason it seems as though the action code associated to the button in this table just doesn't get executed, at all.
Is there something I'm missing? Has anyone else tried to do anything like this with a table bound to an ObjectListDataProvider? It's just not behaving the same way as the other scenarios I'm using with "normal" providers.
The action code is just not being executed.
Any help is appreciated.
Thanks,
TJ
# 1
Have you ruled out whether a runtime error is preventing the action method from getting invoked? For example, if a field's input is causing a conversion or range error, then the action methods do not get called.
Do you have a Message Group component on the page? If not, add one and see if it reports any runtime errors.
# 2
Thanks, I tried what you suggested and don't see anything being reported. So, I guess I haven't officially ruled it out but I'm not seeing anything.
There really isn't much else on the page besides this one table. I just want to allow the user the ability to click on the button, retrieve the current row (where the button was clicked) and take them to another page.
It's kind of like a "master/detail" type thing that seems to work fine with other types of data providers but for some reason I just can't get the action code to even fire with this particular table/provider.
Has anyone actually tried doing this with a table bound to an ObjectListDataProvider?
Thanks,
TJ
# 3
If you would like to see a project with a table that is bound to an object list data provider, and that has buttons like yours that take you to the detail page, check out http://blogs.sun.com/roller/page/divas?entry=table_component_sample_project Hope this helps,diva#2
# 4
Thanks for the info. I'm trying to work through it now. I see a few things that are being done differently in this example than what I've tried. However, I'm having a time getting the table I'm trying to bind to this my data provider to see it. I noticed this example actually creates a new class that extends ObjectListDataProvider and puts it in SessionBean1. That's different than what I've been trying so I'm trying to do the same thing. However, I can't seem to get the table to recognize that new data provider that exists in my session bean.
Any thoughts as to what I might be missing? I've tried building, closing and all that but it just doesn't show up as an available data provider?
Thanks,
TJ
# 5
Update....
It looks like this may be on the right track. I can now see the action code associated to my button being invoked. I think the reason I couldn't find my data provider in the SessionBean is related to one of the other known design time issues that I've seen mentioned before.
Thanks for all the help. Great example to work off of. I may have other questions related to some of the other stuff I see going on in here (that I also haven't been able to get working) but this is definitely better than where I was yesterday.
Thanks,
TJ
# 6
> However,
> I can't seem to get the table to recognize that new
> data provider that exists in my session bean.
>
> Any thoughts as to what I might be missing? I've
> tried building, closing and all that but it just
> doesn't show up as an available data provider?
I can't wait until they fix this! That is why, in our blog, I say "Note: You might need to build the project, then close and re-open the project in order for the design-time mechanisms to see the FoodListDataProvider."
This has got to be a real pain for people, trying to figure out why they can't see the data provider. Here is Winston's write-up on this bug and the other one that you have encountered: http://blogs.sun.com/roller/page/winston?entry=objectlistdp_sample_project