How to validate on task Complete button

I have the following Data Flow Implementation in the action completeTask() of an “Item” task:
#{activePageBean.getByNo.refresh}
#{activePageBean.mytask.taskData.Item}=#{activePageBean.getByNo.result.producto}
#{activePageBean.mytask.applyChanges}
#{activePageBean.taskValidate.refresh}
#{activePageBean.mytask.completeTask}
#{activePageBean.cancelView}

The taskValidate webservice returns an exception when the validation is not Ok.
(This webservice checks data in various systems to validate the Item data and others auxiliar data is filled properly)

When the user presses the button “Complete” and the validation fails, the task is not completed and the user remains on the page (it is what I want), but my problem is that the exception is shown in the “Formatted Message” control for a few milliseconds and disappears (the user might not even view it and review the reason).

How can I keep this exception in the portlet?
Is there any other way to do this validation to avoid user complete the task until the systems stores the Item correctly?

was this resolved already? My guess would be its because your formatted messages control is inside the form and you are refreshing the complete form on press of the button. :?

I have placed the control at the view root and follows the same behavior.
There is something that is continually updating the page and I do not know what is.
Viewing the log, I notice that the page continuously write POST + GET (too many times per second):

Do you know how can I debug what is consulting continuously?

Alejandro,

Tuve el mismo interrogante y lo solucioné de la siguiente forma.

  1. quité el compomente formmatted message.
  2. realicé el llamado de servicio web mediante un boton asincrono el cual le puse el texto “complete”
  3. le puse en el rendered y display las mismas expresiones EL para que tenga la misma renderización y se oculte igual que el botón complete task.
  4. incluí un componente hidden command el cual apunta a la acción complete task.
  5. incluí un codigo javascript el cual evalúa el momento en que se completa la acción que realiza mi llamado al servicio web. Si este llamado es exitoso mediante la operación raise de java script desencadeno la acción de mi hidden command que apunta a la acción complete task; si no es exitoso despliego una ventana emergente (Modal dialog) mediante javascript.

Espero que le sirva

Dear,

I have a suggestion here either to solve the existing issue or add more value to it

  1. Catch the exception thrown by Validate Service
  2. Map the exception to the formatted message or bind to new variable and display on UI
  3. Don’t refresh the whole form but only the required panels. Check the bindings and refresh property
  4. When user clicks on Complete Button - Give a popup ( say modal dialog) with confirmation message or validation error message. then let the user clicks on the option OK to redirect (for successful) or Cancel ( stay on the page).

This feature can be implemented in many ways based on the framework