You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by "seba.wagner@gmail.com" <se...@gmail.com> on 2012/09/16 10:25:01 UTC
JavaScript execution on Ajax response in Wicket
Hi,
we build a single page application and want to extend that with some
jQuery plugins.
The issue is that "$(document).ready( function()" is not called (or
only the first time) a Panel is loaded via Ajax.
Example1 "JavaScript in HTML wicket:head":
https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
Line 27ff
=> Works, but only one time: The first time you initialize the Panel,
$(document).ready is executed, the second time you click on the menu
item / load the Panel via Ajax,the JavaScript is not executed
Example2 "JavaScript pragmatically injected by overwriting
renderHead(HtmlHeaderContainer container)":
https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
Line 45ff
=> Works but $(document).ready is executed before the table with the
id "example" is rendered in the UI, so you can't see any effect
Additionally to the load of the Ajax Panel, we need to trigger an
JavaScript event every time the table dynamically loads new records to
the grid/table.
>From examples in the Net I can ready that AjaxRequestTarget is used
for that. However the Panel itself does not provide a method to
overwrite or similar to catch such events globally for a the
component.
I guess this is a common issue in Wicket, how do folks solve it?
Thanks!
Sebastian
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: JavaScript execution on Ajax response in Wicket
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Thanks Sebastian,
I was able to resolve it based on your examples!
Sebastian
2012/9/16 Sebastien <se...@gmail.com>:
> Hi Sebastian
>
>>The issue is that "$(document).ready( function()" is not called (or only
> the first time) a Panel is loaded via Ajax.
> IMHO, the main thing to understand while working with jQuery is that, when
> you re-attach your component, you need to re-execute the jQuery statement.
>
> A generic way to achieve this is to add (jQuery)behavior added to your
> component.
> In behavior#renderHead()):
>
> AjaxRequestTarget target =
> component.getRequestCycle().find(AjaxRequestTarget.class);
>
> if (target != null)
> {
> target.appendJavaScript(this.$());
> }
> else
> {
> response.render(JavaScriptHeaderItem.forScript(this.$(), this.getToken()));
> }
>
> where #$() gets the jQuery statement.
>
>> Additionally to the load of the Ajax Panel, we need to trigger an
> JavaScript event every time the table dynamically loads new records to the
> grid/table.
> You can achieve this in the same way as describe above, by attaching the
> statement you want to be executed.
>
> Feel free to have a look to the code severals jQuery / Wicket integrations
> did. For instance, the base JQueryAbstractBehavior of wicket-jquery-ui
> could be found here:
> https://github.com/sebfz1/wicket-jquery-ui/blob/wicket6/wicket-jquery-ui-core/src/main/java/com/googlecode/wicket/jquery/ui/JQueryAbstractBehavior.java
>
> Also, these integrations are designed to be extended and already solve
> these kind of issues...
>
> Best regards,
> Sebastien.
>
> On Sun, Sep 16, 2012 at 10:25 AM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> Hi,
>>
>> we build a single page application and want to extend that with some
>> jQuery plugins.
>>
>> The issue is that "$(document).ready( function()" is not called (or
>> only the first time) a Panel is loaded via Ajax.
>>
>> Example1 "JavaScript in HTML wicket:head":
>>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> Line 27ff
>> => Works, but only one time: The first time you initialize the Panel,
>> $(document).ready is executed, the second time you click on the menu
>> item / load the Panel via Ajax,the JavaScript is not executed
>>
>> Example2 "JavaScript pragmatically injected by overwriting
>> renderHead(HtmlHeaderContainer container)":
>>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> Line 45ff
>> => Works but $(document).ready is executed before the table with the
>> id "example" is rendered in the UI, so you can't see any effect
>>
>> Additionally to the load of the Ajax Panel, we need to trigger an
>> JavaScript event every time the table dynamically loads new records to
>> the grid/table.
>>
>> From examples in the Net I can ready that AjaxRequestTarget is used
>> for that. However the Panel itself does not provide a method to
>> overwrite or similar to catch such events globally for a the
>> component.
>>
>> I guess this is a common issue in Wicket, how do folks solve it?
>>
>> Thanks!
>> Sebastian
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: JavaScript execution on Ajax response in Wicket
Posted by Sebastien <se...@gmail.com>.
Hi Sebastian
>The issue is that "$(document).ready( function()" is not called (or only
the first time) a Panel is loaded via Ajax.
IMHO, the main thing to understand while working with jQuery is that, when
you re-attach your component, you need to re-execute the jQuery statement.
A generic way to achieve this is to add (jQuery)behavior added to your
component.
In behavior#renderHead()):
AjaxRequestTarget target =
component.getRequestCycle().find(AjaxRequestTarget.class);
if (target != null)
{
target.appendJavaScript(this.$());
}
else
{
response.render(JavaScriptHeaderItem.forScript(this.$(), this.getToken()));
}
where #$() gets the jQuery statement.
> Additionally to the load of the Ajax Panel, we need to trigger an
JavaScript event every time the table dynamically loads new records to the
grid/table.
You can achieve this in the same way as describe above, by attaching the
statement you want to be executed.
Feel free to have a look to the code severals jQuery / Wicket integrations
did. For instance, the base JQueryAbstractBehavior of wicket-jquery-ui
could be found here:
https://github.com/sebfz1/wicket-jquery-ui/blob/wicket6/wicket-jquery-ui-core/src/main/java/com/googlecode/wicket/jquery/ui/JQueryAbstractBehavior.java
Also, these integrations are designed to be extended and already solve
these kind of issues...
Best regards,
Sebastien.
On Sun, Sep 16, 2012 at 10:25 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> Hi,
>
> we build a single page application and want to extend that with some
> jQuery plugins.
>
> The issue is that "$(document).ready( function()" is not called (or
> only the first time) a Panel is loaded via Ajax.
>
> Example1 "JavaScript in HTML wicket:head":
>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> Line 27ff
> => Works, but only one time: The first time you initialize the Panel,
> $(document).ready is executed, the second time you click on the menu
> item / load the Panel via Ajax,the JavaScript is not executed
>
> Example2 "JavaScript pragmatically injected by overwriting
> renderHead(HtmlHeaderContainer container)":
>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> Line 45ff
> => Works but $(document).ready is executed before the table with the
> id "example" is rendered in the UI, so you can't see any effect
>
> Additionally to the load of the Ajax Panel, we need to trigger an
> JavaScript event every time the table dynamically loads new records to
> the grid/table.
>
> From examples in the Net I can ready that AjaxRequestTarget is used
> for that. However the Panel itself does not provide a method to
> overwrite or similar to catch such events globally for a the
> component.
>
> I guess this is a common issue in Wicket, how do folks solve it?
>
> Thanks!
> Sebastian
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
I propose the following solution (implemented in CalendarPanel, tested in
IE, FF, Chrome):
1) all js init placed into special function with name "omComponentInit"
2) MenuPanel will call this function automatically on component load
please see latest CalendarPanel sources for details (commited
revision 1388315)
If you like this implementation I can add it to all other panels (and we
will need to use it with all future panels)
On Fri, Sep 21, 2012 at 9:03 AM, Maxim Solodovnik <so...@gmail.com>wrote:
> I would like to find solution which will let me to write code in the
> markup file. (not sure if it possible)
>
>
> On Fri, Sep 21, 2012 at 1:09 AM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> This revision already contained a fix for the ConfigPanel to execute
>> Ajax both times:
>> 1) Initially
>> 2) when the panel is reloaded
>>
>> I removed it when I was removing the jQuery plugin for datatables again.
>>
>>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?revision=1385325&view=markup
>>
>> Sebastian
>>
>> 2012/9/20 Maxim Solodovnik <so...@gmail.com>:
>> > IE seems to work as expected.
>> > Will take a look at "panel double load".
>> >
>> >
>> > On Wed, Sep 19, 2012 at 4:19 PM, Maxim Solodovnik <solomax666@gmail.com
>> >
>> > wrote:
>> >>
>> >> I was able to reproduce IE issue will take a look at it.
>> >>
>> >>
>> >> On Wed, Sep 19, 2012 at 1:17 AM, Maxim Solodovnik <
>> solomax666@gmail.com>
>> >> wrote:
>> >>>
>> >>> That's _really_ weird
>> >>> Did implement code like this in my previous projects, will check
>> >>> tomorrow, or the day after tomorrow ...
>> >>>
>> >>>
>> >>> On Wed, Sep 19, 2012 at 1:11 AM, seba.wagner@gmail.com
>> >>> <se...@gmail.com> wrote:
>> >>>>
>> >>>> I don't think that there is need to disable anything at the moment.
>> >>>> Btw: In IE9 not even the login box is visible. You just get a blank
>> >>>> page with the "OpenMeetings" text on the top left. In IE9 it is
>> really
>> >>>> a browser issue :)
>> >>>>
>> >>>> Sebastian
>> >>>>
>> >>>> 2012/9/18 Maxim Solodovnik <so...@gmail.com>:
>> >>>> > Was able to reproduce that :(
>> >>>> > Will dig into it
>> >>>> > As a workaround I can disable current menu item ...
>> >>>> >
>> >>>> > What do you think?
>> >>>> >
>> >>>> >
>> >>>> > On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com
>> >>>> > <se...@gmail.com> wrote:
>> >>>> >>
>> >>>> >> Hi Maxim,
>> >>>> >>
>> >>>> >> the calendar code does neither work with FF (latest) or Chrome.
>> >>>> >> The second time you load the calendar via the Menu it will show
>> just
>> >>>> >> a
>> >>>> >> blank page.
>> >>>> >> I don't think that it is a browser specific issue. The JS code is
>> >>>> >> simply not executed the second time you load the Panel in the same
>> >>>> >> session/without pressing f5.
>> >>>> >>
>> >>>> >> Sebastian
>> >>>> >>
>> >>>> >> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
>> >>>> >> > I'm currently using following calls in Wicket 6:
>> >>>> >> >
>> >>>> >> > add(new AbstractAjaxBehavior() {
>> >>>> >> > public void onRequest() {
>> >>>> >> > }
>> >>>> >> > @Override
>> >>>> >> > public void renderHead(Component component, IHeaderResponse
>> >>>> >> > response) {
>> >>>> >> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
>> >>>> >> > "alertScript"));
>> >>>> >> > }
>> >>>> >> > });
>> >>>> >> >
>> >>>> >> >
>> >>>> >> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
>> >>>> >> > seba.wagner@gmail.com> wrote:
>> >>>> >> >
>> >>>> >> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
>> >>>> >> >> AjaxRequestTarget.get() anymore:
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >>
>> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>> >>>> >> >>
>> >>>> >> >> Sebastian
>> >>>> >> >>
>> >>>> >> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
>> >>>> >> >> > Hello,
>> >>>> >> >> >
>> >>>> >> >> > Within AJAX request AjaxRequestTarget can be accessed via
>> >>>> >> >> > AjaxRequestTarget.get().
>> >>>> >> >> > Script can be appended, for example, in
>> >>>> >> >> > onBeforeReder/onRender/onAfterRender method of Component.
>> >>>> >> >> >
>> >>>> >> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>> >>>> >> >> >
>> >>>> >> >> >> Hi,
>> >>>> >> >> >>
>> >>>> >> >> >> we build a single page application and want to extend that
>> with
>> >>>> >> >> >> some
>> >>>> >> >> >> jQuery plugins.
>> >>>> >> >> >>
>> >>>> >> >> >> The issue is that "$(document).ready( function()" is not
>> called
>> >>>> >> >> >> (or
>> >>>> >> >> >> only the first time) a Panel is loaded via Ajax.
>> >>>> >> >> >>
>> >>>> >> >> >> Example1 "JavaScript in HTML wicket:head":
>> >>>> >> >> >>
>> >>>> >> >> >>
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> >>>> >> >> >> Line 27ff
>> >>>> >> >> >> => Works, but only one time: The first time you initialize
>> the
>> >>>> >> >> >> Panel,
>> >>>> >> >> >> $(document).ready is executed, the second time you click on
>> the
>> >>>> >> >> >> menu
>> >>>> >> >> >> item / load the Panel via Ajax,the JavaScript is not
>> executed
>> >>>> >> >> >>
>> >>>> >> >> >> Example2 "JavaScript pragmatically injected by overwriting
>> >>>> >> >> >> renderHead(HtmlHeaderContainer container)":
>> >>>> >> >> >>
>> >>>> >> >> >>
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> >>>> >> >> >> Line 45ff
>> >>>> >> >> >> => Works but $(document).ready is executed before the table
>> >>>> >> >> >> with the
>> >>>> >> >> >> id "example" is rendered in the UI, so you can't see any
>> effect
>> >>>> >> >> >>
>> >>>> >> >> >> Additionally to the load of the Ajax Panel, we need to
>> trigger
>> >>>> >> >> >> an
>> >>>> >> >> >> JavaScript event every time the table dynamically loads new
>> >>>> >> >> >> records
>> >>>> >> >> >> to
>> >>>> >> >> >> the grid/table.
>> >>>> >> >> >>
>> >>>> >> >> >> From examples in the Net I can ready that AjaxRequestTarget
>> is
>> >>>> >> >> >> used
>> >>>> >> >> >> for that. However the Panel itself does not provide a
>> method to
>> >>>> >> >> >> overwrite or similar to catch such events globally for a the
>> >>>> >> >> >> component.
>> >>>> >> >> >>
>> >>>> >> >> >> I guess this is a common issue in Wicket, how do folks solve
>> >>>> >> >> >> it?
>> >>>> >> >> >>
>> >>>> >> >> >> Thanks!
>> >>>> >> >> >> Sebastian
>> >>>> >> >> >>
>> >>>> >> >> >> --
>> >>>> >> >> >> Sebastian Wagner
>> >>>> >> >> >> https://twitter.com/#!/dead_lock
>> >>>> >> >> >> http://www.webbase-design.de
>> >>>> >> >> >> http://www.wagner-sebastian.com
>> >>>> >> >> >> seba.wagner@gmail.com
>> >>>> >> >> >>
>> >>>> >> >> >
>> >>>> >> >> >
>> >>>> >> >> >
>> >>>> >> >> > --
>> >>>> >> >> > Timur Tleukenov
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >>
>> >>>> >> >> --
>> >>>> >> >> Sebastian Wagner
>> >>>> >> >> https://twitter.com/#!/dead_lock
>> >>>> >> >> http://www.webbase-design.de
>> >>>> >> >> http://www.wagner-sebastian.com
>> >>>> >> >> seba.wagner@gmail.com
>> >>>> >> >>
>> >>>> >> >
>> >>>> >> >
>> >>>> >> >
>> >>>> >> > --
>> >>>> >> > WBR
>> >>>> >> > Maxim aka solomax
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >> --
>> >>>> >> Sebastian Wagner
>> >>>> >> https://twitter.com/#!/dead_lock
>> >>>> >> http://www.webbase-design.de
>> >>>> >> http://www.wagner-sebastian.com
>> >>>> >> seba.wagner@gmail.com
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > --
>> >>>> > WBR
>> >>>> > Maxim aka solomax
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Sebastian Wagner
>> >>>> https://twitter.com/#!/dead_lock
>> >>>> http://www.webbase-design.de
>> >>>> http://www.wagner-sebastian.com
>> >>>> seba.wagner@gmail.com
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> WBR
>> >>> Maxim aka solomax
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> WBR
>> >> Maxim aka solomax
>> >
>> >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
I would like to find solution which will let me to write code in the markup
file. (not sure if it possible)
On Fri, Sep 21, 2012 at 1:09 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> This revision already contained a fix for the ConfigPanel to execute
> Ajax both times:
> 1) Initially
> 2) when the panel is reloaded
>
> I removed it when I was removing the jQuery plugin for datatables again.
>
>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?revision=1385325&view=markup
>
> Sebastian
>
> 2012/9/20 Maxim Solodovnik <so...@gmail.com>:
> > IE seems to work as expected.
> > Will take a look at "panel double load".
> >
> >
> > On Wed, Sep 19, 2012 at 4:19 PM, Maxim Solodovnik <so...@gmail.com>
> > wrote:
> >>
> >> I was able to reproduce IE issue will take a look at it.
> >>
> >>
> >> On Wed, Sep 19, 2012 at 1:17 AM, Maxim Solodovnik <solomax666@gmail.com
> >
> >> wrote:
> >>>
> >>> That's _really_ weird
> >>> Did implement code like this in my previous projects, will check
> >>> tomorrow, or the day after tomorrow ...
> >>>
> >>>
> >>> On Wed, Sep 19, 2012 at 1:11 AM, seba.wagner@gmail.com
> >>> <se...@gmail.com> wrote:
> >>>>
> >>>> I don't think that there is need to disable anything at the moment.
> >>>> Btw: In IE9 not even the login box is visible. You just get a blank
> >>>> page with the "OpenMeetings" text on the top left. In IE9 it is really
> >>>> a browser issue :)
> >>>>
> >>>> Sebastian
> >>>>
> >>>> 2012/9/18 Maxim Solodovnik <so...@gmail.com>:
> >>>> > Was able to reproduce that :(
> >>>> > Will dig into it
> >>>> > As a workaround I can disable current menu item ...
> >>>> >
> >>>> > What do you think?
> >>>> >
> >>>> >
> >>>> > On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com
> >>>> > <se...@gmail.com> wrote:
> >>>> >>
> >>>> >> Hi Maxim,
> >>>> >>
> >>>> >> the calendar code does neither work with FF (latest) or Chrome.
> >>>> >> The second time you load the calendar via the Menu it will show
> just
> >>>> >> a
> >>>> >> blank page.
> >>>> >> I don't think that it is a browser specific issue. The JS code is
> >>>> >> simply not executed the second time you load the Panel in the same
> >>>> >> session/without pressing f5.
> >>>> >>
> >>>> >> Sebastian
> >>>> >>
> >>>> >> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
> >>>> >> > I'm currently using following calls in Wicket 6:
> >>>> >> >
> >>>> >> > add(new AbstractAjaxBehavior() {
> >>>> >> > public void onRequest() {
> >>>> >> > }
> >>>> >> > @Override
> >>>> >> > public void renderHead(Component component, IHeaderResponse
> >>>> >> > response) {
> >>>> >> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
> >>>> >> > "alertScript"));
> >>>> >> > }
> >>>> >> > });
> >>>> >> >
> >>>> >> >
> >>>> >> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
> >>>> >> > seba.wagner@gmail.com> wrote:
> >>>> >> >
> >>>> >> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
> >>>> >> >> AjaxRequestTarget.get() anymore:
> >>>> >> >>
> >>>> >> >>
> >>>> >> >>
> >>>> >> >>
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
> >>>> >> >>
> >>>> >> >> Sebastian
> >>>> >> >>
> >>>> >> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
> >>>> >> >> > Hello,
> >>>> >> >> >
> >>>> >> >> > Within AJAX request AjaxRequestTarget can be accessed via
> >>>> >> >> > AjaxRequestTarget.get().
> >>>> >> >> > Script can be appended, for example, in
> >>>> >> >> > onBeforeReder/onRender/onAfterRender method of Component.
> >>>> >> >> >
> >>>> >> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
> >>>> >> >> >
> >>>> >> >> >> Hi,
> >>>> >> >> >>
> >>>> >> >> >> we build a single page application and want to extend that
> with
> >>>> >> >> >> some
> >>>> >> >> >> jQuery plugins.
> >>>> >> >> >>
> >>>> >> >> >> The issue is that "$(document).ready( function()" is not
> called
> >>>> >> >> >> (or
> >>>> >> >> >> only the first time) a Panel is loaded via Ajax.
> >>>> >> >> >>
> >>>> >> >> >> Example1 "JavaScript in HTML wicket:head":
> >>>> >> >> >>
> >>>> >> >> >>
> >>>> >> >>
> >>>> >> >>
> >>>> >> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> >>>> >> >> >> Line 27ff
> >>>> >> >> >> => Works, but only one time: The first time you initialize
> the
> >>>> >> >> >> Panel,
> >>>> >> >> >> $(document).ready is executed, the second time you click on
> the
> >>>> >> >> >> menu
> >>>> >> >> >> item / load the Panel via Ajax,the JavaScript is not executed
> >>>> >> >> >>
> >>>> >> >> >> Example2 "JavaScript pragmatically injected by overwriting
> >>>> >> >> >> renderHead(HtmlHeaderContainer container)":
> >>>> >> >> >>
> >>>> >> >> >>
> >>>> >> >>
> >>>> >> >>
> >>>> >> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> >>>> >> >> >> Line 45ff
> >>>> >> >> >> => Works but $(document).ready is executed before the table
> >>>> >> >> >> with the
> >>>> >> >> >> id "example" is rendered in the UI, so you can't see any
> effect
> >>>> >> >> >>
> >>>> >> >> >> Additionally to the load of the Ajax Panel, we need to
> trigger
> >>>> >> >> >> an
> >>>> >> >> >> JavaScript event every time the table dynamically loads new
> >>>> >> >> >> records
> >>>> >> >> >> to
> >>>> >> >> >> the grid/table.
> >>>> >> >> >>
> >>>> >> >> >> From examples in the Net I can ready that AjaxRequestTarget
> is
> >>>> >> >> >> used
> >>>> >> >> >> for that. However the Panel itself does not provide a method
> to
> >>>> >> >> >> overwrite or similar to catch such events globally for a the
> >>>> >> >> >> component.
> >>>> >> >> >>
> >>>> >> >> >> I guess this is a common issue in Wicket, how do folks solve
> >>>> >> >> >> it?
> >>>> >> >> >>
> >>>> >> >> >> Thanks!
> >>>> >> >> >> Sebastian
> >>>> >> >> >>
> >>>> >> >> >> --
> >>>> >> >> >> Sebastian Wagner
> >>>> >> >> >> https://twitter.com/#!/dead_lock
> >>>> >> >> >> http://www.webbase-design.de
> >>>> >> >> >> http://www.wagner-sebastian.com
> >>>> >> >> >> seba.wagner@gmail.com
> >>>> >> >> >>
> >>>> >> >> >
> >>>> >> >> >
> >>>> >> >> >
> >>>> >> >> > --
> >>>> >> >> > Timur Tleukenov
> >>>> >> >>
> >>>> >> >>
> >>>> >> >>
> >>>> >> >> --
> >>>> >> >> Sebastian Wagner
> >>>> >> >> https://twitter.com/#!/dead_lock
> >>>> >> >> http://www.webbase-design.de
> >>>> >> >> http://www.wagner-sebastian.com
> >>>> >> >> seba.wagner@gmail.com
> >>>> >> >>
> >>>> >> >
> >>>> >> >
> >>>> >> >
> >>>> >> > --
> >>>> >> > WBR
> >>>> >> > Maxim aka solomax
> >>>> >>
> >>>> >>
> >>>> >>
> >>>> >> --
> >>>> >> Sebastian Wagner
> >>>> >> https://twitter.com/#!/dead_lock
> >>>> >> http://www.webbase-design.de
> >>>> >> http://www.wagner-sebastian.com
> >>>> >> seba.wagner@gmail.com
> >>>> >
> >>>> >
> >>>> >
> >>>> >
> >>>> > --
> >>>> > WBR
> >>>> > Maxim aka solomax
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Sebastian Wagner
> >>>> https://twitter.com/#!/dead_lock
> >>>> http://www.webbase-design.de
> >>>> http://www.wagner-sebastian.com
> >>>> seba.wagner@gmail.com
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> WBR
> >>> Maxim aka solomax
> >>
> >>
> >>
> >>
> >> --
> >> WBR
> >> Maxim aka solomax
> >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
This revision already contained a fix for the ConfigPanel to execute
Ajax both times:
1) Initially
2) when the panel is reloaded
I removed it when I was removing the jQuery plugin for datatables again.
https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?revision=1385325&view=markup
Sebastian
2012/9/20 Maxim Solodovnik <so...@gmail.com>:
> IE seems to work as expected.
> Will take a look at "panel double load".
>
>
> On Wed, Sep 19, 2012 at 4:19 PM, Maxim Solodovnik <so...@gmail.com>
> wrote:
>>
>> I was able to reproduce IE issue will take a look at it.
>>
>>
>> On Wed, Sep 19, 2012 at 1:17 AM, Maxim Solodovnik <so...@gmail.com>
>> wrote:
>>>
>>> That's _really_ weird
>>> Did implement code like this in my previous projects, will check
>>> tomorrow, or the day after tomorrow ...
>>>
>>>
>>> On Wed, Sep 19, 2012 at 1:11 AM, seba.wagner@gmail.com
>>> <se...@gmail.com> wrote:
>>>>
>>>> I don't think that there is need to disable anything at the moment.
>>>> Btw: In IE9 not even the login box is visible. You just get a blank
>>>> page with the "OpenMeetings" text on the top left. In IE9 it is really
>>>> a browser issue :)
>>>>
>>>> Sebastian
>>>>
>>>> 2012/9/18 Maxim Solodovnik <so...@gmail.com>:
>>>> > Was able to reproduce that :(
>>>> > Will dig into it
>>>> > As a workaround I can disable current menu item ...
>>>> >
>>>> > What do you think?
>>>> >
>>>> >
>>>> > On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com
>>>> > <se...@gmail.com> wrote:
>>>> >>
>>>> >> Hi Maxim,
>>>> >>
>>>> >> the calendar code does neither work with FF (latest) or Chrome.
>>>> >> The second time you load the calendar via the Menu it will show just
>>>> >> a
>>>> >> blank page.
>>>> >> I don't think that it is a browser specific issue. The JS code is
>>>> >> simply not executed the second time you load the Panel in the same
>>>> >> session/without pressing f5.
>>>> >>
>>>> >> Sebastian
>>>> >>
>>>> >> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
>>>> >> > I'm currently using following calls in Wicket 6:
>>>> >> >
>>>> >> > add(new AbstractAjaxBehavior() {
>>>> >> > public void onRequest() {
>>>> >> > }
>>>> >> > @Override
>>>> >> > public void renderHead(Component component, IHeaderResponse
>>>> >> > response) {
>>>> >> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
>>>> >> > "alertScript"));
>>>> >> > }
>>>> >> > });
>>>> >> >
>>>> >> >
>>>> >> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
>>>> >> > seba.wagner@gmail.com> wrote:
>>>> >> >
>>>> >> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
>>>> >> >> AjaxRequestTarget.get() anymore:
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>>>> >> >>
>>>> >> >> Sebastian
>>>> >> >>
>>>> >> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
>>>> >> >> > Hello,
>>>> >> >> >
>>>> >> >> > Within AJAX request AjaxRequestTarget can be accessed via
>>>> >> >> > AjaxRequestTarget.get().
>>>> >> >> > Script can be appended, for example, in
>>>> >> >> > onBeforeReder/onRender/onAfterRender method of Component.
>>>> >> >> >
>>>> >> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>>>> >> >> >
>>>> >> >> >> Hi,
>>>> >> >> >>
>>>> >> >> >> we build a single page application and want to extend that with
>>>> >> >> >> some
>>>> >> >> >> jQuery plugins.
>>>> >> >> >>
>>>> >> >> >> The issue is that "$(document).ready( function()" is not called
>>>> >> >> >> (or
>>>> >> >> >> only the first time) a Panel is loaded via Ajax.
>>>> >> >> >>
>>>> >> >> >> Example1 "JavaScript in HTML wicket:head":
>>>> >> >> >>
>>>> >> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>>>> >> >> >> Line 27ff
>>>> >> >> >> => Works, but only one time: The first time you initialize the
>>>> >> >> >> Panel,
>>>> >> >> >> $(document).ready is executed, the second time you click on the
>>>> >> >> >> menu
>>>> >> >> >> item / load the Panel via Ajax,the JavaScript is not executed
>>>> >> >> >>
>>>> >> >> >> Example2 "JavaScript pragmatically injected by overwriting
>>>> >> >> >> renderHead(HtmlHeaderContainer container)":
>>>> >> >> >>
>>>> >> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>>>> >> >> >> Line 45ff
>>>> >> >> >> => Works but $(document).ready is executed before the table
>>>> >> >> >> with the
>>>> >> >> >> id "example" is rendered in the UI, so you can't see any effect
>>>> >> >> >>
>>>> >> >> >> Additionally to the load of the Ajax Panel, we need to trigger
>>>> >> >> >> an
>>>> >> >> >> JavaScript event every time the table dynamically loads new
>>>> >> >> >> records
>>>> >> >> >> to
>>>> >> >> >> the grid/table.
>>>> >> >> >>
>>>> >> >> >> From examples in the Net I can ready that AjaxRequestTarget is
>>>> >> >> >> used
>>>> >> >> >> for that. However the Panel itself does not provide a method to
>>>> >> >> >> overwrite or similar to catch such events globally for a the
>>>> >> >> >> component.
>>>> >> >> >>
>>>> >> >> >> I guess this is a common issue in Wicket, how do folks solve
>>>> >> >> >> it?
>>>> >> >> >>
>>>> >> >> >> Thanks!
>>>> >> >> >> Sebastian
>>>> >> >> >>
>>>> >> >> >> --
>>>> >> >> >> Sebastian Wagner
>>>> >> >> >> https://twitter.com/#!/dead_lock
>>>> >> >> >> http://www.webbase-design.de
>>>> >> >> >> http://www.wagner-sebastian.com
>>>> >> >> >> seba.wagner@gmail.com
>>>> >> >> >>
>>>> >> >> >
>>>> >> >> >
>>>> >> >> >
>>>> >> >> > --
>>>> >> >> > Timur Tleukenov
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >> --
>>>> >> >> Sebastian Wagner
>>>> >> >> https://twitter.com/#!/dead_lock
>>>> >> >> http://www.webbase-design.de
>>>> >> >> http://www.wagner-sebastian.com
>>>> >> >> seba.wagner@gmail.com
>>>> >> >>
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > --
>>>> >> > WBR
>>>> >> > Maxim aka solomax
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> Sebastian Wagner
>>>> >> https://twitter.com/#!/dead_lock
>>>> >> http://www.webbase-design.de
>>>> >> http://www.wagner-sebastian.com
>>>> >> seba.wagner@gmail.com
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > WBR
>>>> > Maxim aka solomax
>>>>
>>>>
>>>>
>>>> --
>>>> Sebastian Wagner
>>>> https://twitter.com/#!/dead_lock
>>>> http://www.webbase-design.de
>>>> http://www.wagner-sebastian.com
>>>> seba.wagner@gmail.com
>>>
>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>
>
>
>
> --
> WBR
> Maxim aka solomax
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
IE seems to work as expected.
Will take a look at "panel double load".
On Wed, Sep 19, 2012 at 4:19 PM, Maxim Solodovnik <so...@gmail.com>wrote:
> I was able to reproduce IE issue will take a look at it.
>
>
> On Wed, Sep 19, 2012 at 1:17 AM, Maxim Solodovnik <so...@gmail.com>wrote:
>
>> That's _really_ weird
>> Did implement code like this in my previous projects, will check
>> tomorrow, or the day after tomorrow ...
>>
>>
>> On Wed, Sep 19, 2012 at 1:11 AM, seba.wagner@gmail.com <
>> seba.wagner@gmail.com> wrote:
>>
>>> I don't think that there is need to disable anything at the moment.
>>> Btw: In IE9 not even the login box is visible. You just get a blank
>>> page with the "OpenMeetings" text on the top left. In IE9 it is really
>>> a browser issue :)
>>>
>>> Sebastian
>>>
>>> 2012/9/18 Maxim Solodovnik <so...@gmail.com>:
>>> > Was able to reproduce that :(
>>> > Will dig into it
>>> > As a workaround I can disable current menu item ...
>>> >
>>> > What do you think?
>>> >
>>> >
>>> > On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com
>>> > <se...@gmail.com> wrote:
>>> >>
>>> >> Hi Maxim,
>>> >>
>>> >> the calendar code does neither work with FF (latest) or Chrome.
>>> >> The second time you load the calendar via the Menu it will show just a
>>> >> blank page.
>>> >> I don't think that it is a browser specific issue. The JS code is
>>> >> simply not executed the second time you load the Panel in the same
>>> >> session/without pressing f5.
>>> >>
>>> >> Sebastian
>>> >>
>>> >> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
>>> >> > I'm currently using following calls in Wicket 6:
>>> >> >
>>> >> > add(new AbstractAjaxBehavior() {
>>> >> > public void onRequest() {
>>> >> > }
>>> >> > @Override
>>> >> > public void renderHead(Component component, IHeaderResponse
>>> response) {
>>> >> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
>>> >> > "alertScript"));
>>> >> > }
>>> >> > });
>>> >> >
>>> >> >
>>> >> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
>>> >> > seba.wagner@gmail.com> wrote:
>>> >> >
>>> >> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
>>> >> >> AjaxRequestTarget.get() anymore:
>>> >> >>
>>> >> >>
>>> >> >>
>>> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>>> >> >>
>>> >> >> Sebastian
>>> >> >>
>>> >> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
>>> >> >> > Hello,
>>> >> >> >
>>> >> >> > Within AJAX request AjaxRequestTarget can be accessed via
>>> >> >> > AjaxRequestTarget.get().
>>> >> >> > Script can be appended, for example, in
>>> >> >> > onBeforeReder/onRender/onAfterRender method of Component.
>>> >> >> >
>>> >> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>>> >> >> >
>>> >> >> >> Hi,
>>> >> >> >>
>>> >> >> >> we build a single page application and want to extend that with
>>> some
>>> >> >> >> jQuery plugins.
>>> >> >> >>
>>> >> >> >> The issue is that "$(document).ready( function()" is not called
>>> (or
>>> >> >> >> only the first time) a Panel is loaded via Ajax.
>>> >> >> >>
>>> >> >> >> Example1 "JavaScript in HTML wicket:head":
>>> >> >> >>
>>> >> >> >>
>>> >> >>
>>> >> >>
>>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>>> >> >> >> Line 27ff
>>> >> >> >> => Works, but only one time: The first time you initialize the
>>> >> >> >> Panel,
>>> >> >> >> $(document).ready is executed, the second time you click on the
>>> menu
>>> >> >> >> item / load the Panel via Ajax,the JavaScript is not executed
>>> >> >> >>
>>> >> >> >> Example2 "JavaScript pragmatically injected by overwriting
>>> >> >> >> renderHead(HtmlHeaderContainer container)":
>>> >> >> >>
>>> >> >> >>
>>> >> >>
>>> >> >>
>>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>>> >> >> >> Line 45ff
>>> >> >> >> => Works but $(document).ready is executed before the table
>>> with the
>>> >> >> >> id "example" is rendered in the UI, so you can't see any effect
>>> >> >> >>
>>> >> >> >> Additionally to the load of the Ajax Panel, we need to trigger
>>> an
>>> >> >> >> JavaScript event every time the table dynamically loads new
>>> records
>>> >> >> >> to
>>> >> >> >> the grid/table.
>>> >> >> >>
>>> >> >> >> From examples in the Net I can ready that AjaxRequestTarget is
>>> used
>>> >> >> >> for that. However the Panel itself does not provide a method to
>>> >> >> >> overwrite or similar to catch such events globally for a the
>>> >> >> >> component.
>>> >> >> >>
>>> >> >> >> I guess this is a common issue in Wicket, how do folks solve it?
>>> >> >> >>
>>> >> >> >> Thanks!
>>> >> >> >> Sebastian
>>> >> >> >>
>>> >> >> >> --
>>> >> >> >> Sebastian Wagner
>>> >> >> >> https://twitter.com/#!/dead_lock
>>> >> >> >> http://www.webbase-design.de
>>> >> >> >> http://www.wagner-sebastian.com
>>> >> >> >> seba.wagner@gmail.com
>>> >> >> >>
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >> > --
>>> >> >> > Timur Tleukenov
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >> Sebastian Wagner
>>> >> >> https://twitter.com/#!/dead_lock
>>> >> >> http://www.webbase-design.de
>>> >> >> http://www.wagner-sebastian.com
>>> >> >> seba.wagner@gmail.com
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > --
>>> >> > WBR
>>> >> > Maxim aka solomax
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Sebastian Wagner
>>> >> https://twitter.com/#!/dead_lock
>>> >> http://www.webbase-design.de
>>> >> http://www.wagner-sebastian.com
>>> >> seba.wagner@gmail.com
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > WBR
>>> > Maxim aka solomax
>>>
>>>
>>>
>>> --
>>> Sebastian Wagner
>>> https://twitter.com/#!/dead_lock
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> seba.wagner@gmail.com
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
I was able to reproduce IE issue will take a look at it.
On Wed, Sep 19, 2012 at 1:17 AM, Maxim Solodovnik <so...@gmail.com>wrote:
> That's _really_ weird
> Did implement code like this in my previous projects, will check tomorrow,
> or the day after tomorrow ...
>
>
> On Wed, Sep 19, 2012 at 1:11 AM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> I don't think that there is need to disable anything at the moment.
>> Btw: In IE9 not even the login box is visible. You just get a blank
>> page with the "OpenMeetings" text on the top left. In IE9 it is really
>> a browser issue :)
>>
>> Sebastian
>>
>> 2012/9/18 Maxim Solodovnik <so...@gmail.com>:
>> > Was able to reproduce that :(
>> > Will dig into it
>> > As a workaround I can disable current menu item ...
>> >
>> > What do you think?
>> >
>> >
>> > On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com
>> > <se...@gmail.com> wrote:
>> >>
>> >> Hi Maxim,
>> >>
>> >> the calendar code does neither work with FF (latest) or Chrome.
>> >> The second time you load the calendar via the Menu it will show just a
>> >> blank page.
>> >> I don't think that it is a browser specific issue. The JS code is
>> >> simply not executed the second time you load the Panel in the same
>> >> session/without pressing f5.
>> >>
>> >> Sebastian
>> >>
>> >> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
>> >> > I'm currently using following calls in Wicket 6:
>> >> >
>> >> > add(new AbstractAjaxBehavior() {
>> >> > public void onRequest() {
>> >> > }
>> >> > @Override
>> >> > public void renderHead(Component component, IHeaderResponse
>> response) {
>> >> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
>> >> > "alertScript"));
>> >> > }
>> >> > });
>> >> >
>> >> >
>> >> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
>> >> > seba.wagner@gmail.com> wrote:
>> >> >
>> >> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
>> >> >> AjaxRequestTarget.get() anymore:
>> >> >>
>> >> >>
>> >> >>
>> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>> >> >>
>> >> >> Sebastian
>> >> >>
>> >> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
>> >> >> > Hello,
>> >> >> >
>> >> >> > Within AJAX request AjaxRequestTarget can be accessed via
>> >> >> > AjaxRequestTarget.get().
>> >> >> > Script can be appended, for example, in
>> >> >> > onBeforeReder/onRender/onAfterRender method of Component.
>> >> >> >
>> >> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>> >> >> >
>> >> >> >> Hi,
>> >> >> >>
>> >> >> >> we build a single page application and want to extend that with
>> some
>> >> >> >> jQuery plugins.
>> >> >> >>
>> >> >> >> The issue is that "$(document).ready( function()" is not called
>> (or
>> >> >> >> only the first time) a Panel is loaded via Ajax.
>> >> >> >>
>> >> >> >> Example1 "JavaScript in HTML wicket:head":
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> >> >> >> Line 27ff
>> >> >> >> => Works, but only one time: The first time you initialize the
>> >> >> >> Panel,
>> >> >> >> $(document).ready is executed, the second time you click on the
>> menu
>> >> >> >> item / load the Panel via Ajax,the JavaScript is not executed
>> >> >> >>
>> >> >> >> Example2 "JavaScript pragmatically injected by overwriting
>> >> >> >> renderHead(HtmlHeaderContainer container)":
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> >> >> >> Line 45ff
>> >> >> >> => Works but $(document).ready is executed before the table with
>> the
>> >> >> >> id "example" is rendered in the UI, so you can't see any effect
>> >> >> >>
>> >> >> >> Additionally to the load of the Ajax Panel, we need to trigger an
>> >> >> >> JavaScript event every time the table dynamically loads new
>> records
>> >> >> >> to
>> >> >> >> the grid/table.
>> >> >> >>
>> >> >> >> From examples in the Net I can ready that AjaxRequestTarget is
>> used
>> >> >> >> for that. However the Panel itself does not provide a method to
>> >> >> >> overwrite or similar to catch such events globally for a the
>> >> >> >> component.
>> >> >> >>
>> >> >> >> I guess this is a common issue in Wicket, how do folks solve it?
>> >> >> >>
>> >> >> >> Thanks!
>> >> >> >> Sebastian
>> >> >> >>
>> >> >> >> --
>> >> >> >> Sebastian Wagner
>> >> >> >> https://twitter.com/#!/dead_lock
>> >> >> >> http://www.webbase-design.de
>> >> >> >> http://www.wagner-sebastian.com
>> >> >> >> seba.wagner@gmail.com
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Timur Tleukenov
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Sebastian Wagner
>> >> >> https://twitter.com/#!/dead_lock
>> >> >> http://www.webbase-design.de
>> >> >> http://www.wagner-sebastian.com
>> >> >> seba.wagner@gmail.com
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > WBR
>> >> > Maxim aka solomax
>> >>
>> >>
>> >>
>> >> --
>> >> Sebastian Wagner
>> >> https://twitter.com/#!/dead_lock
>> >> http://www.webbase-design.de
>> >> http://www.wagner-sebastian.com
>> >> seba.wagner@gmail.com
>> >
>> >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
That's _really_ weird
Did implement code like this in my previous projects, will check tomorrow,
or the day after tomorrow ...
On Wed, Sep 19, 2012 at 1:11 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> I don't think that there is need to disable anything at the moment.
> Btw: In IE9 not even the login box is visible. You just get a blank
> page with the "OpenMeetings" text on the top left. In IE9 it is really
> a browser issue :)
>
> Sebastian
>
> 2012/9/18 Maxim Solodovnik <so...@gmail.com>:
> > Was able to reproduce that :(
> > Will dig into it
> > As a workaround I can disable current menu item ...
> >
> > What do you think?
> >
> >
> > On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com
> > <se...@gmail.com> wrote:
> >>
> >> Hi Maxim,
> >>
> >> the calendar code does neither work with FF (latest) or Chrome.
> >> The second time you load the calendar via the Menu it will show just a
> >> blank page.
> >> I don't think that it is a browser specific issue. The JS code is
> >> simply not executed the second time you load the Panel in the same
> >> session/without pressing f5.
> >>
> >> Sebastian
> >>
> >> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
> >> > I'm currently using following calls in Wicket 6:
> >> >
> >> > add(new AbstractAjaxBehavior() {
> >> > public void onRequest() {
> >> > }
> >> > @Override
> >> > public void renderHead(Component component, IHeaderResponse response)
> {
> >> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
> >> > "alertScript"));
> >> > }
> >> > });
> >> >
> >> >
> >> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
> >> > seba.wagner@gmail.com> wrote:
> >> >
> >> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
> >> >> AjaxRequestTarget.get() anymore:
> >> >>
> >> >>
> >> >>
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
> >> >>
> >> >> Sebastian
> >> >>
> >> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
> >> >> > Hello,
> >> >> >
> >> >> > Within AJAX request AjaxRequestTarget can be accessed via
> >> >> > AjaxRequestTarget.get().
> >> >> > Script can be appended, for example, in
> >> >> > onBeforeReder/onRender/onAfterRender method of Component.
> >> >> >
> >> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
> >> >> >
> >> >> >> Hi,
> >> >> >>
> >> >> >> we build a single page application and want to extend that with
> some
> >> >> >> jQuery plugins.
> >> >> >>
> >> >> >> The issue is that "$(document).ready( function()" is not called
> (or
> >> >> >> only the first time) a Panel is loaded via Ajax.
> >> >> >>
> >> >> >> Example1 "JavaScript in HTML wicket:head":
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> >> >> >> Line 27ff
> >> >> >> => Works, but only one time: The first time you initialize the
> >> >> >> Panel,
> >> >> >> $(document).ready is executed, the second time you click on the
> menu
> >> >> >> item / load the Panel via Ajax,the JavaScript is not executed
> >> >> >>
> >> >> >> Example2 "JavaScript pragmatically injected by overwriting
> >> >> >> renderHead(HtmlHeaderContainer container)":
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> >> >> >> Line 45ff
> >> >> >> => Works but $(document).ready is executed before the table with
> the
> >> >> >> id "example" is rendered in the UI, so you can't see any effect
> >> >> >>
> >> >> >> Additionally to the load of the Ajax Panel, we need to trigger an
> >> >> >> JavaScript event every time the table dynamically loads new
> records
> >> >> >> to
> >> >> >> the grid/table.
> >> >> >>
> >> >> >> From examples in the Net I can ready that AjaxRequestTarget is
> used
> >> >> >> for that. However the Panel itself does not provide a method to
> >> >> >> overwrite or similar to catch such events globally for a the
> >> >> >> component.
> >> >> >>
> >> >> >> I guess this is a common issue in Wicket, how do folks solve it?
> >> >> >>
> >> >> >> Thanks!
> >> >> >> Sebastian
> >> >> >>
> >> >> >> --
> >> >> >> Sebastian Wagner
> >> >> >> https://twitter.com/#!/dead_lock
> >> >> >> http://www.webbase-design.de
> >> >> >> http://www.wagner-sebastian.com
> >> >> >> seba.wagner@gmail.com
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Timur Tleukenov
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Sebastian Wagner
> >> >> https://twitter.com/#!/dead_lock
> >> >> http://www.webbase-design.de
> >> >> http://www.wagner-sebastian.com
> >> >> seba.wagner@gmail.com
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > WBR
> >> > Maxim aka solomax
> >>
> >>
> >>
> >> --
> >> Sebastian Wagner
> >> https://twitter.com/#!/dead_lock
> >> http://www.webbase-design.de
> >> http://www.wagner-sebastian.com
> >> seba.wagner@gmail.com
> >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
I don't think that there is need to disable anything at the moment.
Btw: In IE9 not even the login box is visible. You just get a blank
page with the "OpenMeetings" text on the top left. In IE9 it is really
a browser issue :)
Sebastian
2012/9/18 Maxim Solodovnik <so...@gmail.com>:
> Was able to reproduce that :(
> Will dig into it
> As a workaround I can disable current menu item ...
>
> What do you think?
>
>
> On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com
> <se...@gmail.com> wrote:
>>
>> Hi Maxim,
>>
>> the calendar code does neither work with FF (latest) or Chrome.
>> The second time you load the calendar via the Menu it will show just a
>> blank page.
>> I don't think that it is a browser specific issue. The JS code is
>> simply not executed the second time you load the Panel in the same
>> session/without pressing f5.
>>
>> Sebastian
>>
>> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
>> > I'm currently using following calls in Wicket 6:
>> >
>> > add(new AbstractAjaxBehavior() {
>> > public void onRequest() {
>> > }
>> > @Override
>> > public void renderHead(Component component, IHeaderResponse response) {
>> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
>> > "alertScript"));
>> > }
>> > });
>> >
>> >
>> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
>> > seba.wagner@gmail.com> wrote:
>> >
>> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
>> >> AjaxRequestTarget.get() anymore:
>> >>
>> >>
>> >> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>> >>
>> >> Sebastian
>> >>
>> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
>> >> > Hello,
>> >> >
>> >> > Within AJAX request AjaxRequestTarget can be accessed via
>> >> > AjaxRequestTarget.get().
>> >> > Script can be appended, for example, in
>> >> > onBeforeReder/onRender/onAfterRender method of Component.
>> >> >
>> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> we build a single page application and want to extend that with some
>> >> >> jQuery plugins.
>> >> >>
>> >> >> The issue is that "$(document).ready( function()" is not called (or
>> >> >> only the first time) a Panel is loaded via Ajax.
>> >> >>
>> >> >> Example1 "JavaScript in HTML wicket:head":
>> >> >>
>> >> >>
>> >>
>> >> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> >> >> Line 27ff
>> >> >> => Works, but only one time: The first time you initialize the
>> >> >> Panel,
>> >> >> $(document).ready is executed, the second time you click on the menu
>> >> >> item / load the Panel via Ajax,the JavaScript is not executed
>> >> >>
>> >> >> Example2 "JavaScript pragmatically injected by overwriting
>> >> >> renderHead(HtmlHeaderContainer container)":
>> >> >>
>> >> >>
>> >>
>> >> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> >> >> Line 45ff
>> >> >> => Works but $(document).ready is executed before the table with the
>> >> >> id "example" is rendered in the UI, so you can't see any effect
>> >> >>
>> >> >> Additionally to the load of the Ajax Panel, we need to trigger an
>> >> >> JavaScript event every time the table dynamically loads new records
>> >> >> to
>> >> >> the grid/table.
>> >> >>
>> >> >> From examples in the Net I can ready that AjaxRequestTarget is used
>> >> >> for that. However the Panel itself does not provide a method to
>> >> >> overwrite or similar to catch such events globally for a the
>> >> >> component.
>> >> >>
>> >> >> I guess this is a common issue in Wicket, how do folks solve it?
>> >> >>
>> >> >> Thanks!
>> >> >> Sebastian
>> >> >>
>> >> >> --
>> >> >> Sebastian Wagner
>> >> >> https://twitter.com/#!/dead_lock
>> >> >> http://www.webbase-design.de
>> >> >> http://www.wagner-sebastian.com
>> >> >> seba.wagner@gmail.com
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Timur Tleukenov
>> >>
>> >>
>> >>
>> >> --
>> >> Sebastian Wagner
>> >> https://twitter.com/#!/dead_lock
>> >> http://www.webbase-design.de
>> >> http://www.wagner-sebastian.com
>> >> seba.wagner@gmail.com
>> >>
>> >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>
>
>
>
> --
> WBR
> Maxim aka solomax
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
Was able to reproduce that :(
Will dig into it
As a workaround I can disable current menu item ...
What do you think?
On Wed, Sep 19, 2012 at 12:43 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> Hi Maxim,
>
> the calendar code does neither work with FF (latest) or Chrome.
> The second time you load the calendar via the Menu it will show just a
> blank page.
> I don't think that it is a browser specific issue. The JS code is
> simply not executed the second time you load the Panel in the same
> session/without pressing f5.
>
> Sebastian
>
> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
> > I'm currently using following calls in Wicket 6:
> >
> > add(new AbstractAjaxBehavior() {
> > public void onRequest() {
> > }
> > @Override
> > public void renderHead(Component component, IHeaderResponse response) {
> > response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
> > "alertScript"));
> > }
> > });
> >
> >
> > On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
> > seba.wagner@gmail.com> wrote:
> >
> >> @Timur: Thanks but in Wicket 6.0.0 there is no static method
> >> AjaxRequestTarget.get() anymore:
> >>
> >>
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
> >>
> >> Sebastian
> >>
> >> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
> >> > Hello,
> >> >
> >> > Within AJAX request AjaxRequestTarget can be accessed via
> >> > AjaxRequestTarget.get().
> >> > Script can be appended, for example, in
> >> > onBeforeReder/onRender/onAfterRender method of Component.
> >> >
> >> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
> >> >
> >> >> Hi,
> >> >>
> >> >> we build a single page application and want to extend that with some
> >> >> jQuery plugins.
> >> >>
> >> >> The issue is that "$(document).ready( function()" is not called (or
> >> >> only the first time) a Panel is loaded via Ajax.
> >> >>
> >> >> Example1 "JavaScript in HTML wicket:head":
> >> >>
> >> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> >> >> Line 27ff
> >> >> => Works, but only one time: The first time you initialize the Panel,
> >> >> $(document).ready is executed, the second time you click on the menu
> >> >> item / load the Panel via Ajax,the JavaScript is not executed
> >> >>
> >> >> Example2 "JavaScript pragmatically injected by overwriting
> >> >> renderHead(HtmlHeaderContainer container)":
> >> >>
> >> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> >> >> Line 45ff
> >> >> => Works but $(document).ready is executed before the table with the
> >> >> id "example" is rendered in the UI, so you can't see any effect
> >> >>
> >> >> Additionally to the load of the Ajax Panel, we need to trigger an
> >> >> JavaScript event every time the table dynamically loads new records
> to
> >> >> the grid/table.
> >> >>
> >> >> From examples in the Net I can ready that AjaxRequestTarget is used
> >> >> for that. However the Panel itself does not provide a method to
> >> >> overwrite or similar to catch such events globally for a the
> >> >> component.
> >> >>
> >> >> I guess this is a common issue in Wicket, how do folks solve it?
> >> >>
> >> >> Thanks!
> >> >> Sebastian
> >> >>
> >> >> --
> >> >> Sebastian Wagner
> >> >> https://twitter.com/#!/dead_lock
> >> >> http://www.webbase-design.de
> >> >> http://www.wagner-sebastian.com
> >> >> seba.wagner@gmail.com
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Timur Tleukenov
> >>
> >>
> >>
> >> --
> >> Sebastian Wagner
> >> https://twitter.com/#!/dead_lock
> >> http://www.webbase-design.de
> >> http://www.wagner-sebastian.com
> >> seba.wagner@gmail.com
> >>
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Hi Maxim,
the calendar code does neither work with FF (latest) or Chrome.
The second time you load the calendar via the Menu it will show just a
blank page.
I don't think that it is a browser specific issue. The JS code is
simply not executed the second time you load the Panel in the same
session/without pressing f5.
Sebastian
2012/9/16 Maxim Solodovnik <so...@gmail.com>:
> I'm currently using following calls in Wicket 6:
>
> add(new AbstractAjaxBehavior() {
> public void onRequest() {
> }
> @Override
> public void renderHead(Component component, IHeaderResponse response) {
> response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
> "alertScript"));
> }
> });
>
>
> On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> @Timur: Thanks but in Wicket 6.0.0 there is no static method
>> AjaxRequestTarget.get() anymore:
>>
>> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>>
>> Sebastian
>>
>> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
>> > Hello,
>> >
>> > Within AJAX request AjaxRequestTarget can be accessed via
>> > AjaxRequestTarget.get().
>> > Script can be appended, for example, in
>> > onBeforeReder/onRender/onAfterRender method of Component.
>> >
>> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>> >
>> >> Hi,
>> >>
>> >> we build a single page application and want to extend that with some
>> >> jQuery plugins.
>> >>
>> >> The issue is that "$(document).ready( function()" is not called (or
>> >> only the first time) a Panel is loaded via Ajax.
>> >>
>> >> Example1 "JavaScript in HTML wicket:head":
>> >>
>> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> >> Line 27ff
>> >> => Works, but only one time: The first time you initialize the Panel,
>> >> $(document).ready is executed, the second time you click on the menu
>> >> item / load the Panel via Ajax,the JavaScript is not executed
>> >>
>> >> Example2 "JavaScript pragmatically injected by overwriting
>> >> renderHead(HtmlHeaderContainer container)":
>> >>
>> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> >> Line 45ff
>> >> => Works but $(document).ready is executed before the table with the
>> >> id "example" is rendered in the UI, so you can't see any effect
>> >>
>> >> Additionally to the load of the Ajax Panel, we need to trigger an
>> >> JavaScript event every time the table dynamically loads new records to
>> >> the grid/table.
>> >>
>> >> From examples in the Net I can ready that AjaxRequestTarget is used
>> >> for that. However the Panel itself does not provide a method to
>> >> overwrite or similar to catch such events globally for a the
>> >> component.
>> >>
>> >> I guess this is a common issue in Wicket, how do folks solve it?
>> >>
>> >> Thanks!
>> >> Sebastian
>> >>
>> >> --
>> >> Sebastian Wagner
>> >> https://twitter.com/#!/dead_lock
>> >> http://www.webbase-design.de
>> >> http://www.wagner-sebastian.com
>> >> seba.wagner@gmail.com
>> >>
>> >
>> >
>> >
>> > --
>> > Timur Tleukenov
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
I'm currently using following calls in Wicket 6:
add(new AbstractAjaxBehavior() {
public void onRequest() {
}
@Override
public void renderHead(Component component, IHeaderResponse response) {
response.render(JavaScriptHeaderItem.forScript( "alert('AAA');",
"alertScript"));
}
});
On Sun, Sep 16, 2012 at 11:43 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> @Timur: Thanks but in Wicket 6.0.0 there is no static method
> AjaxRequestTarget.get() anymore:
>
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>
> Sebastian
>
> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
> > Hello,
> >
> > Within AJAX request AjaxRequestTarget can be accessed via
> > AjaxRequestTarget.get().
> > Script can be appended, for example, in
> > onBeforeReder/onRender/onAfterRender method of Component.
> >
> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
> >
> >> Hi,
> >>
> >> we build a single page application and want to extend that with some
> >> jQuery plugins.
> >>
> >> The issue is that "$(document).ready( function()" is not called (or
> >> only the first time) a Panel is loaded via Ajax.
> >>
> >> Example1 "JavaScript in HTML wicket:head":
> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> >> Line 27ff
> >> => Works, but only one time: The first time you initialize the Panel,
> >> $(document).ready is executed, the second time you click on the menu
> >> item / load the Panel via Ajax,the JavaScript is not executed
> >>
> >> Example2 "JavaScript pragmatically injected by overwriting
> >> renderHead(HtmlHeaderContainer container)":
> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> >> Line 45ff
> >> => Works but $(document).ready is executed before the table with the
> >> id "example" is rendered in the UI, so you can't see any effect
> >>
> >> Additionally to the load of the Ajax Panel, we need to trigger an
> >> JavaScript event every time the table dynamically loads new records to
> >> the grid/table.
> >>
> >> From examples in the Net I can ready that AjaxRequestTarget is used
> >> for that. However the Panel itself does not provide a method to
> >> overwrite or similar to catch such events globally for a the
> >> component.
> >>
> >> I guess this is a common issue in Wicket, how do folks solve it?
> >>
> >> Thanks!
> >> Sebastian
> >>
> >> --
> >> Sebastian Wagner
> >> https://twitter.com/#!/dead_lock
> >> http://www.webbase-design.de
> >> http://www.wagner-sebastian.com
> >> seba.wagner@gmail.com
> >>
> >
> >
> >
> > --
> > Timur Tleukenov
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
I have been able to resolve it. Result is not satisfying however that
is not because of Wicket but because how the jQuery plugin replaces
the header items of the table.
Will investigate further,
Thanks!
Sebastian
2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
> @Sebastian:
> I found this: The replacement code is:
> "AjaxRequestTarget is an interface now... The replacement code is:
> AjaxRequestTarget target = requestCycle.find(AjaxRequestTarget.class);"
> https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-AjaxRequestTargetisaninterface
>
> 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>
>> @Timur: Thanks but in Wicket 6.0.0 there is no static method
>> AjaxRequestTarget.get() anymore:
>>
>> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>>
>> Sebastian
>>
>> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
>> > Hello,
>> >
>> > Within AJAX request AjaxRequestTarget can be accessed via
>> > AjaxRequestTarget.get().
>> > Script can be appended, for example, in
>> > onBeforeReder/onRender/onAfterRender method of Component.
>> >
>> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>> >
>> >> Hi,
>> >>
>> >> we build a single page application and want to extend that with some
>> >> jQuery plugins.
>> >>
>> >> The issue is that "$(document).ready( function()" is not called (or
>> >> only the first time) a Panel is loaded via Ajax.
>> >>
>> >> Example1 "JavaScript in HTML wicket:head":
>> >>
>> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> >> Line 27ff
>> >> => Works, but only one time: The first time you initialize the Panel,
>> >> $(document).ready is executed, the second time you click on the menu
>> >> item / load the Panel via Ajax,the JavaScript is not executed
>> >>
>> >> Example2 "JavaScript pragmatically injected by overwriting
>> >> renderHead(HtmlHeaderContainer container)":
>> >>
>> >>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> >> Line 45ff
>> >> => Works but $(document).ready is executed before the table with the
>> >> id "example" is rendered in the UI, so you can't see any effect
>> >>
>> >> Additionally to the load of the Ajax Panel, we need to trigger an
>> >> JavaScript event every time the table dynamically loads new records to
>> >> the grid/table.
>> >>
>> >> From examples in the Net I can ready that AjaxRequestTarget is used
>> >> for that. However the Panel itself does not provide a method to
>> >> overwrite or similar to catch such events globally for a the
>> >> component.
>> >>
>> >> I guess this is a common issue in Wicket, how do folks solve it?
>> >>
>> >> Thanks!
>> >> Sebastian
>> >>
>> >> --
>> >> Sebastian Wagner
>> >> https://twitter.com/#!/dead_lock
>> >> http://www.webbase-design.de
>> >> http://www.wagner-sebastian.com
>> >> seba.wagner@gmail.com
>> >>
>> >
>> >
>> >
>> > --
>> > Timur Tleukenov
>>
>>
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> Timur Tleukenov
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: JavaScript execution on Ajax response in Wicket
Posted by Тимур Тлеукенов <ti...@gmail.com>.
@Sebastian:
I found this: The replacement code is:
"AjaxRequestTarget is an interface now... The replacement code is:
AjaxRequestTarget target = requestCycle.find(AjaxRequestTarget.class);"
https://cwiki.apache.org/WICKET/migration-to-wicket-60.html#MigrationtoWicket6.0-AjaxRequestTargetisaninterface
2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
> @Timur: Thanks but in Wicket 6.0.0 there is no static method
> AjaxRequestTarget.get() anymore:
>
> http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
>
> Sebastian
>
> 2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
> > Hello,
> >
> > Within AJAX request AjaxRequestTarget can be accessed via
> > AjaxRequestTarget.get().
> > Script can be appended, for example, in
> > onBeforeReder/onRender/onAfterRender method of Component.
> >
> > 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
> >
> >> Hi,
> >>
> >> we build a single page application and want to extend that with some
> >> jQuery plugins.
> >>
> >> The issue is that "$(document).ready( function()" is not called (or
> >> only the first time) a Panel is loaded via Ajax.
> >>
> >> Example1 "JavaScript in HTML wicket:head":
> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> >> Line 27ff
> >> => Works, but only one time: The first time you initialize the Panel,
> >> $(document).ready is executed, the second time you click on the menu
> >> item / load the Panel via Ajax,the JavaScript is not executed
> >>
> >> Example2 "JavaScript pragmatically injected by overwriting
> >> renderHead(HtmlHeaderContainer container)":
> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> >> Line 45ff
> >> => Works but $(document).ready is executed before the table with the
> >> id "example" is rendered in the UI, so you can't see any effect
> >>
> >> Additionally to the load of the Ajax Panel, we need to trigger an
> >> JavaScript event every time the table dynamically loads new records to
> >> the grid/table.
> >>
> >> From examples in the Net I can ready that AjaxRequestTarget is used
> >> for that. However the Panel itself does not provide a method to
> >> overwrite or similar to catch such events globally for a the
> >> component.
> >>
> >> I guess this is a common issue in Wicket, how do folks solve it?
> >>
> >> Thanks!
> >> Sebastian
> >>
> >> --
> >> Sebastian Wagner
> >> https://twitter.com/#!/dead_lock
> >> http://www.webbase-design.de
> >> http://www.wagner-sebastian.com
> >> seba.wagner@gmail.com
> >>
> >
> >
> >
> > --
> > Timur Tleukenov
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
Timur Tleukenov
Re: JavaScript execution on Ajax response in Wicket
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
@Timur: Thanks but in Wicket 6.0.0 there is no static method
AjaxRequestTarget.get() anymore:
http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/ajax/AjaxRequestTarget.html
Sebastian
2012/9/16 Тимур Тлеукенов <ti...@gmail.com>:
> Hello,
>
> Within AJAX request AjaxRequestTarget can be accessed via
> AjaxRequestTarget.get().
> Script can be appended, for example, in
> onBeforeReder/onRender/onAfterRender method of Component.
>
> 2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
>
>> Hi,
>>
>> we build a single page application and want to extend that with some
>> jQuery plugins.
>>
>> The issue is that "$(document).ready( function()" is not called (or
>> only the first time) a Panel is loaded via Ajax.
>>
>> Example1 "JavaScript in HTML wicket:head":
>>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> Line 27ff
>> => Works, but only one time: The first time you initialize the Panel,
>> $(document).ready is executed, the second time you click on the menu
>> item / load the Panel via Ajax,the JavaScript is not executed
>>
>> Example2 "JavaScript pragmatically injected by overwriting
>> renderHead(HtmlHeaderContainer container)":
>>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> Line 45ff
>> => Works but $(document).ready is executed before the table with the
>> id "example" is rendered in the UI, so you can't see any effect
>>
>> Additionally to the load of the Ajax Panel, we need to trigger an
>> JavaScript event every time the table dynamically loads new records to
>> the grid/table.
>>
>> From examples in the Net I can ready that AjaxRequestTarget is used
>> for that. However the Panel itself does not provide a method to
>> overwrite or similar to catch such events globally for a the
>> component.
>>
>> I guess this is a common issue in Wicket, how do folks solve it?
>>
>> Thanks!
>> Sebastian
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> Timur Tleukenov
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: JavaScript execution on Ajax response in Wicket
Posted by Тимур Тлеукенов <ti...@gmail.com>.
Hello,
Within AJAX request AjaxRequestTarget can be accessed via
AjaxRequestTarget.get().
Script can be appended, for example, in
onBeforeReder/onRender/onAfterRender method of Component.
2012/9/16 seba.wagner@gmail.com <se...@gmail.com>
> Hi,
>
> we build a single page application and want to extend that with some
> jQuery plugins.
>
> The issue is that "$(document).ready( function()" is not called (or
> only the first time) a Panel is loaded via Ajax.
>
> Example1 "JavaScript in HTML wicket:head":
>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> Line 27ff
> => Works, but only one time: The first time you initialize the Panel,
> $(document).ready is executed, the second time you click on the menu
> item / load the Panel via Ajax,the JavaScript is not executed
>
> Example2 "JavaScript pragmatically injected by overwriting
> renderHead(HtmlHeaderContainer container)":
>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> Line 45ff
> => Works but $(document).ready is executed before the table with the
> id "example" is rendered in the UI, so you can't see any effect
>
> Additionally to the load of the Ajax Panel, we need to trigger an
> JavaScript event every time the table dynamically loads new records to
> the grid/table.
>
> From examples in the Net I can ready that AjaxRequestTarget is used
> for that. However the Panel itself does not provide a method to
> overwrite or similar to catch such events globally for a the
> component.
>
> I guess this is a common issue in Wicket, how do folks solve it?
>
> Thanks!
> Sebastian
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
Timur Tleukenov
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
I'm currently debugging it
it works as expected (am using Chome, can check with FF)
On Sun, Sep 16, 2012 at 11:40 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> @Maxim: In the calendar component in wicket there is the same issue.
> If you load the panel a second time the calender is just a white
> screen.
>
> Sebastian
>
> 2012/9/16 Maxim Solodovnik <so...@gmail.com>:
> > $(function() {
> > });
> >
> > works for me on every panel
> >
> > On Sun, Sep 16, 2012 at 3:25 PM, seba.wagner@gmail.com <
> > seba.wagner@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> we build a single page application and want to extend that with some
> >> jQuery plugins.
> >>
> >> The issue is that "$(document).ready( function()" is not called (or
> >> only the first time) a Panel is loaded via Ajax.
> >>
> >> Example1 "JavaScript in HTML wicket:head":
> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> >> Line 27ff
> >> => Works, but only one time: The first time you initialize the Panel,
> >> $(document).ready is executed, the second time you click on the menu
> >> item / load the Panel via Ajax,the JavaScript is not executed
> >>
> >> Example2 "JavaScript pragmatically injected by overwriting
> >> renderHead(HtmlHeaderContainer container)":
> >>
> >>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> >> Line 45ff
> >> => Works but $(document).ready is executed before the table with the
> >> id "example" is rendered in the UI, so you can't see any effect
> >>
> >> Additionally to the load of the Ajax Panel, we need to trigger an
> >> JavaScript event every time the table dynamically loads new records to
> >> the grid/table.
> >>
> >> From examples in the Net I can ready that AjaxRequestTarget is used
> >> for that. However the Panel itself does not provide a method to
> >> overwrite or similar to catch such events globally for a the
> >> component.
> >>
> >> I guess this is a common issue in Wicket, how do folks solve it?
> >>
> >> Thanks!
> >> Sebastian
> >>
> >> --
> >> Sebastian Wagner
> >> https://twitter.com/#!/dead_lock
> >> http://www.webbase-design.de
> >> http://www.wagner-sebastian.com
> >> seba.wagner@gmail.com
> >>
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
WBR
Maxim aka solomax
Re: JavaScript execution on Ajax response in Wicket
Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
@Maxim: In the calendar component in wicket there is the same issue.
If you load the panel a second time the calender is just a white
screen.
Sebastian
2012/9/16 Maxim Solodovnik <so...@gmail.com>:
> $(function() {
> });
>
> works for me on every panel
>
> On Sun, Sep 16, 2012 at 3:25 PM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
>> Hi,
>>
>> we build a single page application and want to extend that with some
>> jQuery plugins.
>>
>> The issue is that "$(document).ready( function()" is not called (or
>> only the first time) a Panel is loaded via Ajax.
>>
>> Example1 "JavaScript in HTML wicket:head":
>>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
>> Line 27ff
>> => Works, but only one time: The first time you initialize the Panel,
>> $(document).ready is executed, the second time you click on the menu
>> item / load the Panel via Ajax,the JavaScript is not executed
>>
>> Example2 "JavaScript pragmatically injected by overwriting
>> renderHead(HtmlHeaderContainer container)":
>>
>> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
>> Line 45ff
>> => Works but $(document).ready is executed before the table with the
>> id "example" is rendered in the UI, so you can't see any effect
>>
>> Additionally to the load of the Ajax Panel, we need to trigger an
>> JavaScript event every time the table dynamically loads new records to
>> the grid/table.
>>
>> From examples in the Net I can ready that AjaxRequestTarget is used
>> for that. However the Panel itself does not provide a method to
>> overwrite or similar to catch such events globally for a the
>> component.
>>
>> I guess this is a common issue in Wicket, how do folks solve it?
>>
>> Thanks!
>> Sebastian
>>
>> --
>> Sebastian Wagner
>> https://twitter.com/#!/dead_lock
>> http://www.webbase-design.de
>> http://www.wagner-sebastian.com
>> seba.wagner@gmail.com
>>
>
>
>
> --
> WBR
> Maxim aka solomax
--
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com
Re: JavaScript execution on Ajax response in Wicket
Posted by Maxim Solodovnik <so...@gmail.com>.
$(function() {
});
works for me on every panel
On Sun, Sep 16, 2012 at 3:25 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:
> Hi,
>
> we build a single page application and want to extend that with some
> jQuery plugins.
>
> The issue is that "$(document).ready( function()" is not called (or
> only the first time) a Panel is loaded via Ajax.
>
> Example1 "JavaScript in HTML wicket:head":
>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.html?view=markup
> Line 27ff
> => Works, but only one time: The first time you initialize the Panel,
> $(document).ready is executed, the second time you click on the menu
> item / load the Panel via Ajax,the JavaScript is not executed
>
> Example2 "JavaScript pragmatically injected by overwriting
> renderHead(HtmlHeaderContainer container)":
>
> https://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/configurations/ConfigsPanel.java?view=markup
> Line 45ff
> => Works but $(document).ready is executed before the table with the
> id "example" is rendered in the UI, so you can't see any effect
>
> Additionally to the load of the Ajax Panel, we need to trigger an
> JavaScript event every time the table dynamically loads new records to
> the grid/table.
>
> From examples in the Net I can ready that AjaxRequestTarget is used
> for that. However the Panel itself does not provide a method to
> overwrite or similar to catch such events globally for a the
> component.
>
> I guess this is a common issue in Wicket, how do folks solve it?
>
> Thanks!
> Sebastian
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>
--
WBR
Maxim aka solomax