You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tom Norton <to...@gmail.com> on 2015/06/16 22:40:16 UTC

Use thrid party JQuery Plugin in Wicket Panel

We are in the process of upgrading from wicket 5 to wicket 6 and we are
having trouble with some of our panels that load custom JQuery plugins.
Because wicket 6 writes the script tags for child components before parent
components, our components that use third party jquery plugins get wiped
out when the wicket application adds the main jquery javascript.

Is there a way to configure wicket to load jquery first, and then to load
the individual jquery plugin javascript files afterwards?

Thanks,
Tom

Re: Use thrid party JQuery Plugin in Wicket Panel

Posted by Tom Norton <to...@gmail.com>.
This worked.

Thanks a bunch!
Tom

On Wed, Jun 17, 2015 at 12:27 PM, andrea del bene <an...@gmail.com>
wrote:

> Hi,
>
> maybe this paragraph of the user guide can help you:
> http://ci.apache.org/projects/wicket/guide/6.x/guide/single.html#resources_6
> You can read your js file both as an URL or as a context-relative
> resources (see
> http://ci.apache.org/projects/wicket/guide/6.x/guide/single.html#resources_5
> )
>
>
> On 17/06/2015 17:53, Tom Norton wrote:
>
>> Our web site is only partially developed with wicket, so the the
>> javascript
>> file in question can't be retrieved using a package-based approach.  Is
>> there a way to add an absolute reference for a javascript plugin?
>>
>> Thanks,
>> Tom
>>
>> On Tue, Jun 16, 2015 at 4:50 PM, Martin Grigorov <mg...@apache.org>
>> wrote:
>>
>>  Hi,
>>>
>>> Yes, use: response.render(JavaScriptHeaderItem.forReference(new
>>> *JQueryPluginResourceReference*(YourScope.class, "your-plugin.js")))
>>>
>>> Martin Grigorov
>>> Freelancer. Available for hire!
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Tue, Jun 16, 2015 at 11:40 PM, Tom Norton <
>>> tomwnorton.mailing.lists@gmail.com> wrote:
>>>
>>>  We are in the process of upgrading from wicket 5 to wicket 6 and we are
>>>> having trouble with some of our panels that load custom JQuery plugins.
>>>> Because wicket 6 writes the script tags for child components before
>>>>
>>> parent
>>>
>>>> components, our components that use third party jquery plugins get wiped
>>>> out when the wicket application adds the main jquery javascript.
>>>>
>>>> Is there a way to configure wicket to load jquery first, and then to
>>>> load
>>>> the individual jquery plugin javascript files afterwards?
>>>>
>>>> Thanks,
>>>> Tom
>>>>
>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Use thrid party JQuery Plugin in Wicket Panel

Posted by andrea del bene <an...@gmail.com>.
Hi,

maybe this paragraph of the user guide can help you: 
http://ci.apache.org/projects/wicket/guide/6.x/guide/single.html#resources_6
You can read your js file both as an URL or as a context-relative 
resources (see 
http://ci.apache.org/projects/wicket/guide/6.x/guide/single.html#resources_5)

On 17/06/2015 17:53, Tom Norton wrote:
> Our web site is only partially developed with wicket, so the the javascript
> file in question can't be retrieved using a package-based approach.  Is
> there a way to add an absolute reference for a javascript plugin?
>
> Thanks,
> Tom
>
> On Tue, Jun 16, 2015 at 4:50 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
>> Hi,
>>
>> Yes, use: response.render(JavaScriptHeaderItem.forReference(new
>> *JQueryPluginResourceReference*(YourScope.class, "your-plugin.js")))
>>
>> Martin Grigorov
>> Freelancer. Available for hire!
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Tue, Jun 16, 2015 at 11:40 PM, Tom Norton <
>> tomwnorton.mailing.lists@gmail.com> wrote:
>>
>>> We are in the process of upgrading from wicket 5 to wicket 6 and we are
>>> having trouble with some of our panels that load custom JQuery plugins.
>>> Because wicket 6 writes the script tags for child components before
>> parent
>>> components, our components that use third party jquery plugins get wiped
>>> out when the wicket application adds the main jquery javascript.
>>>
>>> Is there a way to configure wicket to load jquery first, and then to load
>>> the individual jquery plugin javascript files afterwards?
>>>
>>> Thanks,
>>> Tom
>>>


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


Re: Use thrid party JQuery Plugin in Wicket Panel

Posted by Martin Grigorov <mg...@apache.org>.
How exactly you contribute the js file?
On Jun 17, 2015 6:53 PM, "Tom Norton" <to...@gmail.com>
wrote:

> Our web site is only partially developed with wicket, so the the javascript
> file in question can't be retrieved using a package-based approach.  Is
> there a way to add an absolute reference for a javascript plugin?
>
> Thanks,
> Tom
>
> On Tue, Jun 16, 2015 at 4:50 PM, Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > Yes, use: response.render(JavaScriptHeaderItem.forReference(new
> > *JQueryPluginResourceReference*(YourScope.class, "your-plugin.js")))
> >
> > Martin Grigorov
> > Freelancer. Available for hire!
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Tue, Jun 16, 2015 at 11:40 PM, Tom Norton <
> > tomwnorton.mailing.lists@gmail.com> wrote:
> >
> > > We are in the process of upgrading from wicket 5 to wicket 6 and we are
> > > having trouble with some of our panels that load custom JQuery plugins.
> > > Because wicket 6 writes the script tags for child components before
> > parent
> > > components, our components that use third party jquery plugins get
> wiped
> > > out when the wicket application adds the main jquery javascript.
> > >
> > > Is there a way to configure wicket to load jquery first, and then to
> load
> > > the individual jquery plugin javascript files afterwards?
> > >
> > > Thanks,
> > > Tom
> > >
> >
>

Re: Use thrid party JQuery Plugin in Wicket Panel

Posted by Tom Norton <to...@gmail.com>.
Our web site is only partially developed with wicket, so the the javascript
file in question can't be retrieved using a package-based approach.  Is
there a way to add an absolute reference for a javascript plugin?

Thanks,
Tom

On Tue, Jun 16, 2015 at 4:50 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> Yes, use: response.render(JavaScriptHeaderItem.forReference(new
> *JQueryPluginResourceReference*(YourScope.class, "your-plugin.js")))
>
> Martin Grigorov
> Freelancer. Available for hire!
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Jun 16, 2015 at 11:40 PM, Tom Norton <
> tomwnorton.mailing.lists@gmail.com> wrote:
>
> > We are in the process of upgrading from wicket 5 to wicket 6 and we are
> > having trouble with some of our panels that load custom JQuery plugins.
> > Because wicket 6 writes the script tags for child components before
> parent
> > components, our components that use third party jquery plugins get wiped
> > out when the wicket application adds the main jquery javascript.
> >
> > Is there a way to configure wicket to load jquery first, and then to load
> > the individual jquery plugin javascript files afterwards?
> >
> > Thanks,
> > Tom
> >
>

Re: Use thrid party JQuery Plugin in Wicket Panel

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Yes, use: response.render(JavaScriptHeaderItem.forReference(new
*JQueryPluginResourceReference*(YourScope.class, "your-plugin.js")))

Martin Grigorov
Freelancer. Available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Jun 16, 2015 at 11:40 PM, Tom Norton <
tomwnorton.mailing.lists@gmail.com> wrote:

> We are in the process of upgrading from wicket 5 to wicket 6 and we are
> having trouble with some of our panels that load custom JQuery plugins.
> Because wicket 6 writes the script tags for child components before parent
> components, our components that use third party jquery plugins get wiped
> out when the wicket application adds the main jquery javascript.
>
> Is there a way to configure wicket to load jquery first, and then to load
> the individual jquery plugin javascript files afterwards?
>
> Thanks,
> Tom
>