You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John Carlson <jo...@iwesttech.com> on 2007/09/25 01:46:43 UTC

wicket-ajax.js not added

I have had several pages that will not initially load the wicket-ajax
functionality.  The page will load but the throttler is missing or it
will complain that submitFormById is undefined.  Refreshing the page
loads the ajax scripts and everything works fine.  I did alittle
snooping and found that on the first load wicket doesn't add the
wicket-ajax.js to the markup.  That's why some functions are undefined.
I setoutputmarkupid(true) on all the related things as far I can tell.
Does the order of setting markup Id and adding things to the page
matter?  ie.

...

form.setoutputmarkupid(true);

add(form);

...

versus

...

add(form);

form.setoutputmarkupid(true);

...

 

As a hack I added the script include myself...

 

<script type="text/javascript"
src="/quickstart/app/resources/wicket.ajax.AbstractDefaultAjaxBehavior/w
icket-ajax.js"></script>

 

and then it worked on page load.  What step am I skipping that keeps
wicket from doing this for me initially?

 

Thanks In Advance.

 

John Carlson


Re: wicket-ajax.js not added

Posted by Michael Preiss <mp...@11mp.de>.

John Carlson-5 wrote:
> 
> I have had several pages that will not initially load the wicket-ajax
> functionality.  [...] I did alittle snooping and found that on the first
> load 
> wicket doesn't add the wicket-ajax.js to the markup.
> 
You should try the header contributor. Example:

public somecomponent (String myid) {
   super (myid);
   add (HeaderContributor.forJavaScript(somecomponent.class, 
       "javascriptfile.js"));
   ...
} 


John Carlson-5 wrote:
> 
> I setoutputmarkupid(true) on all the related things as far I can tell.
> Does the order of setting markup Id and adding things to the page
> matter?  ie.
> 
setOutputMarkupId is needed to enable wicket to update a 
component after requests are returned to the client. It has no
effect here.
-- 
View this message in context: http://www.nabble.com/wicket-ajax.js-not-added-tf4512483.html#a12878783
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket-ajax.js not added

Posted by Matej Knopp <ma...@gmail.com>.
I believe that's a known bug that should be fixed in 1.2.7. It's
definitely fixed in 1.3.

-Matej

On 9/25/07, John Carlson <jo...@iwesttech.com> wrote:
> Eelco,
>
> I'm using 1.2.5
>
> John
>
> On 9/24/07, John Carlson <jo...@iwesttech.com> wrote:
> > I have had several pages that will not initially load the wicket-ajax
> > functionality.  The page will load but the throttler is missing or it
> > will complain that submitFormById is undefined.  Refreshing the page
> > loads the ajax scripts and everything works fine.  I did alittle
> > snooping and found that on the first load wicket doesn't add the
> > wicket-ajax.js to the markup.  That's why some functions are
> undefined.
> > I setoutputmarkupid(true) on all the related things as far I can tell.
> > Does the order of setting markup Id and adding things to the page
> > matter?  ie.
>
> No, it shouldn't. What version of Wicket are you using? The first
> component or behavior that does a header contribution of
> wicket-ajax.js (any AjaxBehavior that is shipped with the wicket core
> projects) should cause the script to be loaded.
>
> Whether you call setOutputMarkupId is unrelated to whether scripts are
> loaded.
>
> Eelco
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: wicket-ajax.js not added

Posted by John Carlson <jo...@iwesttech.com>.
Eelco,

I'm using 1.2.5

John

On 9/24/07, John Carlson <jo...@iwesttech.com> wrote:
> I have had several pages that will not initially load the wicket-ajax
> functionality.  The page will load but the throttler is missing or it
> will complain that submitFormById is undefined.  Refreshing the page
> loads the ajax scripts and everything works fine.  I did alittle
> snooping and found that on the first load wicket doesn't add the
> wicket-ajax.js to the markup.  That's why some functions are
undefined.
> I setoutputmarkupid(true) on all the related things as far I can tell.
> Does the order of setting markup Id and adding things to the page
> matter?  ie.

No, it shouldn't. What version of Wicket are you using? The first
component or behavior that does a header contribution of
wicket-ajax.js (any AjaxBehavior that is shipped with the wicket core
projects) should cause the script to be loaded.

Whether you call setOutputMarkupId is unrelated to whether scripts are
loaded.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket-ajax.js not added

Posted by Eelco Hillenius <ee...@gmail.com>.
On 9/24/07, John Carlson <jo...@iwesttech.com> wrote:
> I have had several pages that will not initially load the wicket-ajax
> functionality.  The page will load but the throttler is missing or it
> will complain that submitFormById is undefined.  Refreshing the page
> loads the ajax scripts and everything works fine.  I did alittle
> snooping and found that on the first load wicket doesn't add the
> wicket-ajax.js to the markup.  That's why some functions are undefined.
> I setoutputmarkupid(true) on all the related things as far I can tell.
> Does the order of setting markup Id and adding things to the page
> matter?  ie.

No, it shouldn't. What version of Wicket are you using? The first
component or behavior that does a header contribution of
wicket-ajax.js (any AjaxBehavior that is shipped with the wicket core
projects) should cause the script to be loaded.

Whether you call setOutputMarkupId is unrelated to whether scripts are loaded.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org