Re: Proper way to Pop a Modal Edit Form from a list?
Re: Proper way to Pop a Modal Edit Form from a list?
- Subject: Re: Proper way to Pop a Modal Edit Form from a list?
- From: Chuck Hill <email@hidden>
- Date: Sat, 30 Jan 2010 10:27:51 -0800
On Jan 29, 2010, at 3:59 PM, James Cicenia wrote:
OK -
Let's see.
1) I am successfully using an AjaxGrid to show my list of
FestivalArtists
2) In that AjaxGrid I have a CellComponent that controls whether to
remove the item (it works) or to popup and editor (that doesn't)
3) Following Component Nestings
EditFestival
AjaxModalDialog (the one I want to pop)
form to render
/AjaxModalDialog
FestivalArtistGrid
FestivalActionCell
AjaxModalDialogOpener (this references the above
AjaxModalDialogID)
Cells's bindings:
EditFestivalArtistOpener: AjaxModalDialogOpener{
label = "View/Edit1";
dialogId = "AdminEditFestivalArtistDialog";
action = selectFestivalArtistToEdit;
What does that method do?
title = "Edit Festival Artist";
}
AjaxModalDialog bindings:
FestivalArtistEditorDialog: AjaxModalDialog {
pageName = "AdminEditFestivalArtist";
Using this with the action above is unlikely to give you the result
you seem to want.
id = "AdminEditFestivalArtistDialog";
showOpener = false;
transitions = false;
locked = true;
title = "Review Artist";
width = -1;
onClose = updatePage;
}
Does this make sense?
Hard to say based on the pieces you have shown.
Here is pattern that works.
Main Page:
<webobject name = "LogModalDialog" >
<webobject name = "LogDialogContents" />
</webobject>
LogModalDialog: AjaxModalDialog {
id = "LogDialog";
transitions = false;
open = false;
showOpener = false;
locked = true;
closeUpdateContainerID = "resultsContainer";
}
LogDialogContents: LogDialog {
object = object; // This passes the selected object
}
In the grid cell component:
<webobject name = "LogModalDialogOpener" />
LogModalDialogOpener: AjaxModalDialogOpener {
action = selectCurrentObject;
label = "Log";
dialogId = "LogDialog";
}
/**
* Sets selectedObject on page() to the row this component is
displaying
*/
public void selectCurrentObject() {
ModelessEditingPage page = (ModelessEditingPage) page();
page.setSelectedObject( object() );
}
public EOEnterpriseObject object() {
return (EOEnterpriseObject)grid().row();
}
--
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/products/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