Re: AjaxModalDialog problems
Re: AjaxModalDialog problems
- Subject: Re: AjaxModalDialog problems
- From: Chuck Hill <email@hidden>
- Date: Thu, 26 Jul 2012 10:04:30 +0800
Hi Roger,
Wonder strips out nested form tags. You should be getting this warning in your log:
if (context.isInForm()) {
logger.warn("The AjaxModalDialog should not be used inside of a WOForm (" + ERXWOForm.formName(context, "- not specified -") +
") if it contains any form inputs or buttons. Remove this AMD from this form, add a form of its own. Replace it with " +
"an AjaxModalDialogOpener with a dialogID that matches the ID of this dialog.");
logger.warn(" page: " + context.page());
logger.warn(" component: " + context.component());
}
You will need to fix your layout as described above.
Chuck
On 2012-07-26, at 7:14 AM, Roger Perryman wrote:
>
> I have a page that uses an AjaxModalDialog control to popup an external form. The submit button does not work although an AjaxHyperlink does. When I view the (generated) source, I noticed that the form tag has been removed. The example from AjaxExample works so it must be something I am doing wrong. I've included a trimmed down version of my code. Note that I added the Yes/No links (from AjaxExample) to the popup for testing. NO doesn't do anything. YES fires the action but does not close the dialog. It also wont submit the form values since it is just a hyperlink.
>
> Thanks!
>
> Roger
>
>
> parent page: (full page)
>
> <webobject name="apptForm">
> <webobject name="apptList">
> <span>
> <webobject name="patientName"/>
> <webobject name="editApptLink">
> <webobject name="editAppt"/>
> </webobject name="editAppt">
> </span>
> <br/>
> <webobject name="apptList">
> <webobject name="apptForm">
>
>
> apptForm: WOForm { id = "apptForm"; multipleSubmit = true; }
>
> apptList: WORepetition
> {
> id = "apptListID";
> list = apptList;
> item = apptItem;
> index = apptIndex;
> }
>
> patientName: WOString { value = apptItem.toPatient.fullName; }
>
> saveUpdates: WOSubmitButton
> {
> id = "saveUpdates";
> value = "Save Updates";
> action = saveUpdates;
> }
>
> declineApptLink: ERXWOTemplate
> {
> templateName = "whatGoesHere?";
> }
>
> editAppt: AjaxModalDialog
> {
> label = "Edit Appointment";
> action = editAppointment;
> width = "900";
> height = "600";
> centerVertically = true;
> transitions = false;
> locked = false;
> title = "edit Apppointment";
> closeValue = "x"; //Value required here. Default is × Safari fails in xhtml mode.
> autoFocusing = false;
> }
>
>
> public WOActionResults editAppointment()
> {
> // Prep the objects as needed
>
> // Return an Edit Appt page for the popup.
> EditApptPopup apptPopup = pageWithName( EditApptPopup.class );
> apptPopup.setApptRequest( _apptItem );
> return apptPopup;
> }
>
>
> And in the popup component: (partial page, no head or body tags)
>
>
> <h3>Please update your information</h3>
>
> <webobject name="editForm">
> First Name: <webobject name="firstName" /><br/>
> <br/>
> <br/>
> <webobject name="yes">Yes</webobject>
>
> <webobject name="no">No</webobject>
> <br/>
> <br/>
> <webobject name="updateResults" /><br/>
> </webobject name="editForm">
>
>
>
> patientName: WOTextField
> {
> value = apptRequest.toPatient.fullName;
> }
>
> /* Tried WOForm and ERXWOForm. Tried id and name */
> editForm: ERXWOForm
> {
> id = "editForm";
> multipleSubmit = true;
> }
>
> /* A regular WOSubmitButton also doesn't work since the form is removed */
> updateResults: AjaxSubmitButton
> {
> id = "updateResults";
> value = "Save";
> action = updateResults;
> evalScripts = true;
> formName = "editForm";
> onClick = "ModalBox.hide();";
> // onClickBefore = onClickDoneButton;
> }
>
> no: WOHyperlink
> {
> href = "javascript: void(0);";
> onClick = "ModalBox.hide();";
> id = "noClicked";
> }
>
> yes: AjaxHyperlink
> {
> action = updateResults;
> evalScripts = true;
> }
>
>
> public WOActionResults updateResults()
> {
> // Push changes to parent.
>
> AjaxModalDialog.update( context(), null );
> return null;
> }
>
> public String onClickDoneButton()
> {
> return "function(){ return true; }()";
> }
>
>
> _______________________________________________
> 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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects
_______________________________________________
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