Re: Conditionally Opening AjaxModalDialog
Re: Conditionally Opening AjaxModalDialog
- Subject: Re: Conditionally Opening AjaxModalDialog
- From: Joe Kramer <email@hidden>
- Date: Wed, 08 Jun 2011 19:46:06 -0700
Hi Chuck,
When you say it like that it seems so easy... :-) Thanks for the help!
Joe
On Wed, Jun 8, 2011 at 7:17 PM, Chuck Hill
<email@hidden> wrote:
Hi Joe,
On Jun 8, 2011, at 6:30 PM, Joe Kramer wrote:
> Hi all,
>
> I feel like this should be easy, but I am struggling. I have an AjaxModalDialogOpener inside of a form. When I click the opener, I want to save the data from that form by calling a server side action. If the save is successful, I want to open the AjaxModalDialog, but if the save fails I want to update an AjaxUpdateContainer on the page with the error messages. I'm pretty sure I've tried every combination of the action, enabled, and onFailure bindings on the AjaxModalDialogOpener, but nothing has worked as I want it to so far. Am I missing something obvious? Could someone kindly point me in the right direction?
I think you are doing it wrong. AjaxModalDialogOpener is not for submitting forms, it is for opening dialogs. AjaxSubmitButton is for submitting forms. What you want is something like this in the action method called by the ASB:
if (saveSucceeded) {
AjaxModelDialog.open(context(), "MyDialogId");
} else {
AjaxUpdateContainer.updateContainerWithID("MyUpdateContainerId", context());
}
Chuck
--
Chuck Hill Senior Consultant / VP Development
Come to WOWODC this July for unparalleled WO learning opportunities and real peer to peer problem solving! Network, socialize, and enjoy a great cosmopolitan city. See you there! http://www.wocommunity.org/wowodc11/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden