Primefaces retrieve DataList or DataGrid value?

Not Possible as both p:dataList and p:dataGrid don't have a selection property that can be attached to the backing bean your p:commandButton will belong to.

Up vote 0 down vote favorite share g+ share fb share tw.

I have the below dataList that displays images with pagination that shows one image at a time. I want to be able to know/retrieve what image is being displayed when I click my p:commandButton so that I can have access to it in my actionListener method (bookmarkletBean. Update).

Any ideas here? Primefaces link|improve this question asked Mar 22 '11 at 20:33c12405340 90% accept rate.

Not Possible as both p:dataList and p:dataGrid don't have a selection property that can be attached to the backing bean your p:commandButton will belong to. Therefore, I would recommend having a p:dataTable which does have the selection property, and once you click the button you will now which row (Image) was selected.

Thanks for the response and the help. The selection didn't map the current row to my bean. I think the selection property is meant to be used when there is a selection event (click, double click..etc).

I'm just using the pagination to go to the next image in the Collection. The only way I get it to work is how I outlined in my the below post. Any ideas?

Sorry about the previous formatting. – c12 Mar 23 '11 at 3:27.

One possible solution was the below to arrange it like so with a link to select the wanted image and then the actionListener process's the selection select image.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions