Hello,
I use JQuery, so the below advice sadly doesn't apply. I checked, when I add
the JQuery dependency, the findZoneManager method is gone. Tapestry-jquery
wants me to use tapestryZone("update",...).
With no further real documentation outside of the source code...
So, to recap, in my opinion I need at least two things as parameters for my js
function initializing the editor:
- the zone client id
- the url to request when the editor button is clicked
My js function needs to do the following:
1) when the custom button is clicked, the editor must be closed so that the
original textarea receives the new value
2) the contents of the client side textarea must be transported to the server
side
3) the server side saves the contents in the database
4) the server side sets the switch showEditor=false so that the div containing
the read-only contents is shown
5) the client side zone must be updated
1) the function does editor.remove("#textAreaClientId"), which seems to do the
above
2) and 3) I am trying to do via the JQuery bind mixin, but I can't seem to get
the client side textarea content to the server
4) can be done in the component event
5) should probably be done via $("#zoneClientId").tapestryZone("update") and
not via the component event, or should it?
Any ideas? Should I post more code?
Regards,
Daniel P.
______________________________________
Von: Thiago H de Paula Figueiredo [[email protected]]
Gesendet: Mittwoch, 27. Mai 2015 20:31
An: Tapestry users
Betreff: Re: AW: AW: Adding JS to my component combined with using t:If
For 5.3.8, you should use ZoneManager to update zones, as that's the JS
class which has all the wiring. You just cannot make an AJAX call directly
and expect the zone to update itself. There's one nice example of how to
do it in https://issues.apache.org/jira/browse/TAP5-569.
// where zoneId contains the HTML id of the zone you want to update
var zoneManager = Tapestry.findZoneManagerByZoneId( zoneId );
if ( zoneManager != null ) {
zoneManager.updateFromURL( url ); // where url contains the event URL.
}
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]