I have a primefaces dataTable with several URLs as data. There is one URL per line. A line has a button. If you click it, a dialog is opened, containing a iframe with the website of the corresponding URL.
This is the (shortened) xhtml:
<p:dataTable id="transResult" rendered="#{not empty urlList}"
var="aUrl"
value="#{urlList}">
<p:column ...></p:column>
...
<p:column>
<p:commandButton id="urlBtn" value="#{aUrl}"
onclick="PF('showURL').show();"/>
<p:dialog id="urlDialog" widgetVar="showURL">
<h:outputLabel value="URL: #{aUrl}"/>
<iframe src="#{aUrl}"/>
</p:dialog>
</p:column>
</p:dataTable>
The table with the buttons is displayed correctly:
|url1|
|url2|
...
If I have a look at the hidden dialogs with firebug, the URLs are put correctly! Also the id's are generated corrctly:
transResult:0:urlDialog
transResult:1:urlDialog
...
Problem: But when I click on a button, always the dialog with the last URL is openend.
Any idea why this goes wrong?