I think my problem is pretty simple but could not find the solution so far. I miss the logic I think.
Here is the context :
I have a “Portlet application” composed of 3 portlets.
The purpose of those three portlet are :
- search & show complaints instances
- an attachment panel (for files)
- submittion of new complaint via a form
In that last portlet I have :
- several forms
- one modal dialog
Problem description :
My concern is the following. When I submit the form to send a new complaint instance I do some checks before sending the complaint via WS (giving the opportunity for the user to modify some values if they are wrong).
If the complaint is sent correctly, I would like to show the modal dialog saying that the complaint was sent correctly with a link to the same portlet reseting the state (erase all data filled so far for a new instance of complaint).
If I set up the AsyncCommandButton which submit the form with my modal dialog in the “toggle” field, the modal dialog is showed in all cases (even if there is a problem).
My AsyncCommandButton execute a custom action. I tried to toggle the modal dialog manually in that action but could not find how.
I’m searching into two ways :
- the first one is a specific return of the custom action that disabled the toggle function of the button automatically (tried to throw exception, return “OUTCOME_ERROR”…)
- the second one is to find a way to toggle manually via java code the modal dialog (tried to find the toggle function of the asyncommandbutton, tried to add a toggle button non visible and call the toggle function, …)
No luck so far for both ways.
If someone could give me some ligths on this matter, I’d appreciate.