WebSphere Portal Server - Re: how to insert javascript confirm into commandLink , JSF with

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > November 2006 > Re: how to insert javascript confirm into commandLink , JSF with





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: how to insert javascript confirm into commandLink , JSF with

2006-11-20, 1:18 pm

I have not gotten a CommandLink to work in a DataTable, I use an OutputLink to invoke a JavaScript function that rebuilds and submits the command link

<h:outputLink onkeypress=" return hiddenKey(#{dbCd.cdNo},'Edit');" onclick="return hiddenKey(#{dbCd.cdNo},'Edit');" value="#{msg.cdSearchResults_editlink}">

The JavaScript function sets up a CommandLink outside the datatable, you could add your confirm in here and conditionally issue the submit().

<script language="JavaScript1.2" type="text/javascript">
function hiddenKey(key, mode) {
var f = document.forms[mode+'ProxyForm'];
f.elements[mode+'ProxyForm:_link_hidden_'].value=mode+'ProxyForm:proxy'+mode;
f.elements['keyValueFrm'].value=key;
f.submit();
return false;
}
</script>



The CommandLink then does the work

<h:form id="EditProxyForm">
<h:commandLink id="proxyEdit" action="#{cdBacking.doItem}">
<f:param name="keyValueFrm" value="" />
</h:commandLink>
</h:form>




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com