Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

h:commandLink in Mozilla  RSS feed

Anirban Mandal
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!