Re: AMD and accessing the parent component
Re: AMD and accessing the parent component
- Subject: Re: AMD and accessing the parent component
- From: Stefan Klein <email@hidden>
- Date: Sat, 26 Feb 2011 12:32:56 +0100
Am 26.02.11 04:29, schrieb Chuck Hill:
On Feb 24, 2011, at 9:12 AM, Theodore Petrosky wrote:
Thanks guys. now that it is working, I wanted to get an idea if this were the 'best' way to accomplish my end.
I am presenting a table with things and I wanted to give some minor search capability. My user will bring in the AMD and search for a publication (String) or a Center (String). I am creating the EOQualifier in the AMD and passing it back to Main with:
theSearchQualifier = ERXQ.and(theSearchQualifier, Grid.PUBLICATION.contains(thePubToSearch()));
((Main)context().page()).setSearchQualifier(theSearchQualifier);
AjaxModalDialog.close(context());
return null;
I then fire the onClose action method of the AMD and update my AUC with the table.
Ok, it works. but Stefan makes a comment:
But the a better way, is to set the the "main" page via a
binding in your AMD content component.
I don't understand this method. I am very interested in learning more.
I am not sure how that would work.
Chuck
Just a short example:
An the page is an AMD Opener and a dialog component:
HTML
<webobject name="PDFPrintOverviewDialog" />
<webobject name="AmdPrintOpen" />
WOD
PDFPrintOverviewDialog: PDFPrintOverviewDialog {
delegate = printOverviewDelegate; // <-- wrapper for
this
}
AmdPrintOpen : AjaxModalDialogOpener {
dialogId = "AMD_PrintJobSelect_ID";
linkTitle = "Print as PDF";
}
The dialog is an extra Component
HTML:
<webobject name="AMDPrintJobSelect">
... content ..
<webobject name="BtnPrint" />
<webobject name="LnkUpdateContainer">
</webobject>
WOD:
AMDPrintJobSelect: AjaxModalDialog {
title = "Druckversion aufbereiten";
showOpener = false;
id = "AMD_PrintJobSelect_ID";
transitions = false;
}
BtnPrint: AjaxSubmitButton {
action = "">
evalScripts = true;
value = "Drucken";
class = "schalter";
;
updateContainerID = "LnkUpdateContainer";
;
}
LnkUpdateContainer : AjaxUpdateContainer {
id = "LnkUpdateContainer";
// <-- _javascript_ to
open the result of delegate.pdfPrint()
}
The delegate is an Interface:
public interface PDFPrintOverviewDialogDelegate
{
public WOComponent pdfPrint();
public void pdfPrepare();
}
Using this construct, I am able to use one print dialog on different
pages.
Each page knows how to generate the its pdf.
Stefan
--- On Wed, 2/23/11, Chuck Hill <email@hidden> wrote:
I think you probably want to bind the
onClose action.
Chuck
--- On Wed, 2/23/11, Stefan Klein <email@hidden> wrote:
From: Stefan Klein <email@hidden>
Subject: Re: AMD and accessing the parent component
To: "Theodore Petrosky" <email@hidden>
Date: Wednesday, February 23, 2011, 4:37 PM
((Main)context().page()).setThePubToSearch()
But the a better way, is to set the the "main" page via a
binding in
your AMD content component.
Stefan
Am 23.02.11 21:23, schrieb Theodore Petrosky:
I have a component "Main". Main has a setter:
public void setThePubToSearch(String thePubToSearch)
{
this.thePubToSearch =
thePubToSearch;
}
I am displaying an AjaxModalDialog whose content is a
component.
I want to access the setter 'setThePubToSearch' in
Main before closing the AMD.
I know I have done this before I just can not remember
how.
I am just too tired.
Ted
_______________________________________________
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
_______________________________________________
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
|
_______________________________________________
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