Events are passed up the component hierarchy until handled, so just handle the selected event in your page class. Alternatively have your special component fire its own event (use ComponentResources for that) based on what button was clicked and handle that. That's probably the cleaner way to do it.

Uli

Am 26.11.2009 23:41 schrieb CarmenG:
Sorry Uli that doesn't help me as the onSelected event cannot return a value,
the download file in my case. Can you elobarate a bit more?

What I have read so far have only been examples of Forms and Submit
components on the same page/component where you would have
....
private String type;              // Value assigned to select component.
private String selectedType;

public void onSelectedFromDownload() {
    selectedType = type;
}

public Object onSuccess() {
    if (selectedType != null) {
        return XYZ;                  // StreamResponse of file for selected
type.
    }
}

In my case onSelectedFromDownload and onSuccess are in 2 different classes,
how do I get onSuccess from the page class to notify the custom component to
download the file?
The quick and dirty hack that I used was to add selectedType as a parameter
of the custom component so the value was available to the custom component
and the page, but I really do not like this solution. The custom component
should handle the downloading of the file, as it did in Tapestry 4.

Any other ideas on what I can do?

thanks,
Carmen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to