I really don't like this solution.
It requires the all the javascript selectors must be written in a very
specific and awkward manner, which most people are not going to be
doing.
I don't know how many jquery libraries we are breaking by doing this.
I don't expect most people are even going to expect that the 'edit
page' and such is an ajax operation, since from a user's perspective it
looks like a full page refresh.
I don't think this will work for things applied to the windows object
(for instance, performing an operation for a resize event). Unless I am
missing something here, is it possible to bind an event on the windows
object from the document object?
I have tried using the javascript manager to handle this using the
portlet response "org.gatein.javascript.dependency" property, but I
have not had a lot of luck here yet.
My opinion would be to add an option to the gatein-resources.xml file
to specify how modules should be loaded via this ajax.
Anyone else have any thoughts on this?
Thanks,
Matt Wringe
On Tue 21 May 2013 09:12:33 AM EDT, Julien Viet wrote:
live is kind of deprecated and instead "on" should be
used:
http://api.jquery.com/on/
On May 21, 2013, at 5:45 AM, Phuong Viet VU <phuongvv(a)exoplatform.com
<mailto:phuongvv@exoplatform.com>> wrote:
> hi,
> in ajax request, the html page is not re-rendered, and a GMD js
> module will not be served (and run) 2 times. that's why the
> javascript code that register event on the DOM node (which is
> replaced by another after ajax request) is not run
>
> one solution is using the "live" mode or event handler delegation
> feature of jQuery. You can register the event on the parent DOM that
> is not update after the ajax request
> Or you can use JavascriptManager to add callback for the require
> statement
>
> Pls look at my comment on jira for details
>
>
>
>
> On Mon, May 20, 2013 at 10:16 PM, Viliam Rockai <vrockai(a)redhat.com
> <mailto:vrockai@redhat.com>> wrote:
>
> Hi all,
>
> I've got an issue with JQuery when the page is refreshed by AJAX
> - the
> javascript defined in gatein-resources.xml does not initialize
> properly:
>
https://issues.jboss.org/browse/GTNPORTAL-2875
>
> Is there any known way how to solve this?
>
> Viliam
> _______________________________________________
> gatein-dev mailing list
> gatein-dev(a)lists.jboss.org <mailto:gatein-dev@lists.jboss.org>
>
https://lists.jboss.org/mailman/listinfo/gatein-dev
>
>
> _______________________________________________
> gatein-dev mailing list
> gatein-dev(a)lists.jboss.org <mailto:gatein-dev@lists.jboss.org>
>
https://lists.jboss.org/mailman/listinfo/gatein-dev
_______________________________________________
gatein-dev mailing list
gatein-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/gatein-dev