On Mon, 12 Jul 2010 17:09:00 -0300, Pablo dos Reis
<pablodosr...@gmail.com> wrote:
Hi,
Hi, guys!
Nice example, Pablo! A StreamResponse is a good choice when all you need
to return is a String. When you need something more structured, you can
return a JSSONObject or an JSONArray.
@Property
private String url;
/**
* Register the action Link
*/
void preRender() {
Link link = recursosComponente.createActionLink("firstTextField",
false, new Object[0]);
url = link.toAbsoluteURI();
}
I would use a single method for it:
@Inject
private ComponentResources resources;
Link getFirstTextFieldLink() {
return resources.createEventLink("firstTextField");
}
/*
* Action Link Event
*/
StreamResponse onFirsTextField() {
String value = request.getParameter("firstValue");
// do some thing
//return a stream response
}
You can return a JSONObject or JSONArray here too.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org