@EventListener Question

2007-05-28 Thread Janos Mucsi

Hi
Thanks, Jesse, for your answer.
What if I want to return values from the listener method? Instead of

@EventListener(elements = "myFavoriteDiv", events = "onmouseover")
   public void watchText(BrowserEvent event)
   {
   System.out.println("watch text entered"+event);
   }

I want something like

@EventListener(elements = "myFavoriteDiv", events = "onmouseover")
   public List watchText(BrowserEvent event)
   {
// get country id from event
// String countryId = ...;
List states = someService.getStates(countryId);
return states;
   }

(Of course, probably it would be a  and onChange.) Is there a 
way to do this?


Thanks.
Janos

Jesse Kuhnert wrote:

I'm not sure what you mean, the asynchronous portion should happen
automatically.

It should also behave exactly the same way as your listener method 
would if
it were say a @Submit component listener or @DirectLink listener.  The 
major

difference is that it automatically submits your form if you happen to be
targeting a component that implements IFormComponent. (which most form 
based

Tapestry components do)

http://tapestry.apache.org/tapestry4.1/ajax/eventlistener.html

On 5/27/07, Janos Mucsi <[EMAIL PROTECTED]> wrote:


Hi

I am new to Tapestry, so excuse my basic question. I am reading
http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html

and was wondering how @EventListener implements asynchronous calls. Does
anybody have a sample that behaves like the example:

@EventListener(events = "selectOption", targets = "projectChoose",
submitForm = "taskForm", async=true)
public void projectSelected(IRequestCycle cycle)
{

cycle.getResponseBuilder().updateComponent("projectDescription");

cycle.getResponseBuilder().updateComponent("feedbackBlock");
}


Thanks!

--
Janos Mucsi









--
Janos Mucsi
209-346-4294



@EventListener Question

2007-05-27 Thread Janos Mucsi

Hi

I am new to Tapestry, so excuse my basic question. I am reading
http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html

and was wondering how @EventListener implements asynchronous calls. Does 
anybody have a sample that behaves like the example:


@EventListener(events = "selectOption", targets = "projectChoose",
submitForm = "taskForm", async=true)
public void projectSelected(IRequestCycle cycle)
{
   cycle.getResponseBuilder().updateComponent("projectDescription");
   cycle.getResponseBuilder().updateComponent("feedbackBlock");
}


Thanks!

--
Janos Mucsi