adding a Validation Phase for non Ajax CommandButton

UI Components for JSF
Post Reply
rk.pravarsha
Posts: 1
Joined: 25 Aug 2015, 12:25

25 Aug 2015, 13:03

Hi All, I'm using a p:commandButton for File Export with ajax set to false.

I have a requirement to perform a server-side validation before generating the File.
Since this is a non-ajax button, if don't write the file data to the Response Stream upon validation Failure the page is getting completely refreshed.

I wanted to update the Ajax Requests in CommandButtonRenderer to follow the below logic:
i. onclick --> call a server side action method[use a new argument validate] and process all other ajax requests in Queue(i.e., process a change/select event from a p:calendar)
ii. if (args.validationFailed==false) then execute the non-ajax Request for FileDownload.

please suggest if this is a valid approach or if there is any other simpler way to solve the requirement.
Primefaces v3.5 , with Jboss AS 7.1.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests