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 = delegate.pdfPrepare;
    evalScripts = true;
    value = "Drucken";
    class = "schalter";
    onClick = "Element.show('PJSSearchPageBusyIcon')";
    updateContainerID = "LnkUpdateContainer";
    onComplete = "Element.hide('PJSSearchPageBusyIcon')";
}

LnkUpdateContainer : AjaxUpdateContainer {
    id = "LnkUpdateContainer";
onRefreshComplete = autoOpenPdfScript; // <-- 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 protected]>  wrote:


I think you probably want to bind the
onClose action.

Chuck


--- On Wed, 2/23/11, Stefan Klein<[email protected]>  wrote:

From: Stefan Klein<[email protected]>
Subject: Re: AMD and accessing the parent component
To: "Theodore Petrosky"<[email protected]>
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/stefan.klein%40buero-sde.de

This email sent to [email protected]



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to [email protected]
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to