AjaxModalDialog problems
AjaxModalDialog problems
- Subject: AjaxModalDialog problems
- From: Roger Perryman <email@hidden>
- Date: Wed, 25 Jul 2012 19:14:33 -0400
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