On Fri, 10 Sep 2010 15:32:10 -0300, Everton Agner <ton.ag...@gmail.com>
wrote:
Yeah, it's easy! Thanks!
:)
1 - I figured it out that i don't need to write JSON as response for the
even handling... Just returning the Zone's Body to magically refresh it
is all i need (since the Grid knows how to build itself). But this code
isn't working (sorry for the portuguese code, but i believe it's
readable):
The ajax call looks like this (using jquery):
$j.ajax({url: urlGravarPoi});
Do I need to change something?
If you want to update a Zone, you'll need to use its ZoneManager. Search
for ZoneUpdater in this list and you'll find some examples.
2 - I did something like this to get the XHR URI in the JS:
**** Page class ****
@Inject
private ComponentResources componentResources;
public String getUrlGravarPoiXHR()
{
return
componentResources.createEventLink("gravarPoi").toAbsoluteURI();
}
**** Page template ****
<t:hidden t:id="urlGravarPoi" value="prop:urlGravarPoiXHR" />
**** Map's JS event handling ****
var urlGravarPoi = $j("input[name=urlGravarPoi]").val(); // and some
workaround to append the context
$j.ajax({url: urlGravarPoi});
Well, I just wanted to see it working and obviously that part isn't
nice...
If you want to do a form submission, then you don't need to create an
event for that. Just trigger the Tapestry.FORM_PROCESS_SUBMIT_EVENT event
in your form. Here's one example:
http://tinybits.blogspot.com/2009/10/missing-javascript.html
Now, what's the best way for that? I didn't understand how the
Autocomplete's mixin (the example from the tap site) uses the
RenderSupport to pass the link to the js.
The example uses RenderSupport to generate a JavaScript line that is
included in the generated HTML. There's no magic here.
--
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