You need to sign in to do that
Don't have an account?

Manipulate a single item in a Datalist?
Hi Guys,
I have a datalist which lists records based on certain criteria and with each record I include a button too. I have the button coded to show or hide an OutputPanel relative to it's row in the datalist. The problem is that I can't seem to get the button to perform the task for a single item in the datalist. It will only show or hide every OutputPanel in the list.
I've tried playing with the var attribute but haven't found anything that works.
Hope you can help.
Regards,
Paul
If you like you can do a JavaScript trick to display the output panel.
All Answers
I suggest you set the row id for which you have clicked the button in a variable & rerender the datalist.
Add rendered attribute to the outputpanel with condition that rowid == variable set.
Hope this works out. If not please let me know.
If you like you can do a JavaScript trick to display the output panel.
Thank both so much!
Both suggestions make a lot of sense although in the end I used the javascript trick because I don't have any experience with the variable tag in Visualforce.
@sinsiterrulez : If you have time, I wouldn't mind seeing how this would be acheived using your method.
Thank you both, much appreciated.
Paul
Hi Paul,
Here is the code for reference:
That is brilliant!
I love the use of the rendered attribute. I will be making use of this a lot in the future.
Thanks so much sinsiterrulez.