<h:commandButton id="raporlayanBtn"
value="..."
>
</h:commandButton>
I used commandButton instead of commandLink, because onclick event cannot be overridden with commandLink. I didn't want to use ondblclick event.
doPopup function is here:
function doPopup(source) {
var sourceId = source.id;
var hiddenInputId = sourceId.replace(/form1:content:bekleyenIslerTbl:(\w*):raporlayanBtn/g,
"form1:content:bekleyenIslerTbl:$1:raporlayanHdn");
var hiddenForm = source.form;
var raporlayanId = hiddenForm[hiddenInputId].value
popup = window.open("bildiren-irtibat.faces?raporlayanId=" + raporlayanId,
"popup", "height=300,width=200,toolbar=no,menubar=no,"
+ "scrollbars=yes");
popup.openerFormId = source.form.id;
popup.focus();
}
As you notice I specified the path of the new jsp page explicitly in window.open function.
But this method has a drawback. Since this doesn't submit any form you can't use JSF value binding mechanism to pass a parameter. Thus I obtained the id of the row of the datatable by using DOM and _javascript_. In the same column as the commandButton I put a hidden field and put the id of the row into this hidden field:
<h:commandButton id="raporlayanBtn" value="..."
/>
<h:inputHidden id="raporlayanHdn" value="#{bb.raporlayanId}"/>
Hope this helps,
Mert
>
> hopefully someone could help me with this.
> I have a dataTable displaying a dataBase-query result. In each row there
> is a commandLink which opens up a new window displaying some addtional
> information (e.g. a window to change this record). The link is
> referencing an action method of a backing bean with the outcome "goDetail".
>
> However, when clicking on a link in another line (with the same
> reference and outcome), the popup window then displays the table itself,
> instead of the expected details window. After that klicking the link
> again, the record-details-window is shown. It is always flip-floping
> between these to views.
>
> How can I make the link work correctly?
>
> Thanks for help in advance
> Rgds
> Alex
>
>

