Meaningless Drivel is fun!*
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
Author

h:commandLink in Mozilla

Anirban Mandal
Greenhorn

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;
else
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 2.0.1.1 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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: h:commandLink in Mozilla
 
Similar Threads
h:commandLink and onsubmit
Multiple Actions issue in JSF
commandLink not working properly
use commandLink, get value eq null in backing bean
getting forceId in h:commandLink