File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes h:commandLink in  Mozilla Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "h:commandLink in  Mozilla" Watch "h:commandLink in  Mozilla" New topic

h:commandLink in Mozilla

Anirban Mandal

Joined: Sep 28, 2007
Posts: 5
I have a commandlink in my page, onclick of that I need to check few field values my page so I have called a javascript method and chacked that, Depending upon the result I am submitting the form

JSF code version 1.0.1:& lt;h:commandLink type="submit" value="Filter" id="filterButton"
action="#{pc_DCMeldingenPortlet.doButton2Action}" onmosedown="return #{facesContext.externalContext.response.namespace}checkDate(this, event);"
onkdown="return #{facesContext.externalContext.response.namespace}checkDate(this, event);" style="font-style:Arial;font-size: 12px;"& gt;

Javascipt code:

function & lt;portlet:namespace/& gt;checkDate(thisObj, thisEvent) {
if(psuedo code)
return true;
return false;

In IE6/7 when the user is clicking the commandlink first the javascript method is getting called then if the return is true the form is getting submitted else stays in the current page.

But in Mozilla When ever we are clicking the commandlink its submittting the form before calling the Javascript method for validation so the validation methods becomes of no use.

Does any body have any idea with the possible incompatibilty issue of JSF with Mozilla or am I doing any mistake?
I agree. Here's the link:
subject: h:commandLink in Mozilla
It's not a secret anymore!