You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Farrukh SATTOROV <fi...@gmail.com> on 2014/02/19 07:45:30 UTC

3rd party JS+Wicket 6.6.0=MyWidget ?

Hi all, is there any recipes how integrate 3rd party javascript component
to wicket component. For example i have Timeline js class and i need to
bind it to WebComponent as container, what steps i need to do.

-- 
Regards, Farrukh

Re: 3rd party JS+Wicket 6.6.0=MyWidget ?

Posted by Farrukh SATTOROV <fi...@gmail.com>.
i mean this js library visjs.org and timeline is
http://visjs.org/examples/timeline/01_basic.html


On Wed, Feb 19, 2014 at 11:13 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Is this JS library the one what you mean?
>
> http://timeline.knightlab.com/
>
> if so,
>
> <iframe wicket:id="timeline" width='100%' height='650'
> frameborder='0'></iframe>
>
> Java
>
> /**
>  * @author reiern70
>  *
>  */
> public class TimeLineContainer extends WebMarkupContainer {
>
>
> public TimeLineContainer(String id, IModel<String> url) {
> super(id, url);
> }
>  @Override
> protected void onComponentTag(ComponentTag tag) {
> checkComponentTag(tag, "iframe");
>
> CharSequence url = getURL();
>
> // generate the src attribute
> tag.put("src", Strings.replaceAll(url, "&", "&amp;"));
>
> super.onComponentTag(tag);
> }
>
> private CharSequence getURL() {
> return getDefaultModelObjectAsString();
> }
> }
>
> I haven't tried the above but it might work
>
>
> On Wed, Feb 19, 2014 at 7:45 AM, Farrukh SATTOROV <firedandy@gmail.com
> >wrote:
>
> > Hi all, is there any recipes how integrate 3rd party javascript component
> > to wicket component. For example i have Timeline js class and i need to
> > bind it to WebComponent as container, what steps i need to do.
> >
> > --
> > Regards, Farrukh
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards, Farrukh

Re: 3rd party JS+Wicket 6.6.0=MyWidget ?

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Is this JS library the one what you mean?

http://timeline.knightlab.com/

if so,

<iframe wicket:id="timeline" width='100%' height='650'
frameborder='0'></iframe>

Java

/**
 * @author reiern70
 *
 */
public class TimeLineContainer extends WebMarkupContainer {


public TimeLineContainer(String id, IModel<String> url) {
super(id, url);
}
 @Override
protected void onComponentTag(ComponentTag tag) {
checkComponentTag(tag, "iframe");

CharSequence url = getURL();

// generate the src attribute
tag.put("src", Strings.replaceAll(url, "&", "&amp;"));

super.onComponentTag(tag);
}

private CharSequence getURL() {
return getDefaultModelObjectAsString();
}
}

I haven't tried the above but it might work


On Wed, Feb 19, 2014 at 7:45 AM, Farrukh SATTOROV <fi...@gmail.com>wrote:

> Hi all, is there any recipes how integrate 3rd party javascript component
> to wicket component. For example i have Timeline js class and i need to
> bind it to WebComponent as container, what steps i need to do.
>
> --
> Regards, Farrukh
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: 3rd party JS+Wicket 6.6.0=MyWidget ?

Posted by Farrukh SATTOROV <fi...@gmail.com>.
step by step debugging help me understand )


On Wed, Feb 19, 2014 at 4:52 PM, Andrea Del Bene <an...@gmail.com>wrote:

> Hi,
>
> for a "gentle" introduction to JavaScript integration you can also refer
> to the official guide:
>
> http://wicket.apache.org/guide/guide/single.html#jsintegration
> > I just delving in these libraries
> >
> >
> > On Wed, Feb 19, 2014 at 11:51 AM, Farrukh SATTOROV <firedandy@gmail.com
> >wrote:
> >
> >> Thank you, Martin
> >>
> >>
> >> On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
> >>
> >>> Hi,
> >>>
> >>> Usually the steps to integrate any JS widget with Wicket are:
> >>> 1) create a custom Component or Behavior that will contribute the .js
> (and
> >>> any .css, images, ... if needed) in #renderHead()
> >>> 2) if the JS widget needs configuration (e.g. some JSON object passed
> to
> >>> the widget's constructor) then use again #renderHead() to write it to
> the
> >>> response
> >>> 3) if the JS widget provides functionality to send data back to the
> server
> >>> then use either Ajax Behavior, IResourceListener or mounted resource
> >>>
> >>> I recommend you to check the source of some integrations:
> >>> - https://github.com/sebfz1/wicket-jquery-ui
> >>> - https://github.com/l0rdn1kk0n/wicket-bootstrap
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>>
> >>>
> >>> On Wed, Feb 19, 2014 at 8:45 AM, Farrukh SATTOROV <firedandy@gmail.com
> >>>> wrote:
> >>>> Hi all, is there any recipes how integrate 3rd party javascript
> >>> component
> >>>> to wicket component. For example i have Timeline js class and i need
> to
> >>>> bind it to WebComponent as container, what steps i need to do.
> >>>>
> >>>> --
> >>>> Regards, Farrukh
> >>>>
> >>
> >>
> >> --
> >> Regards, Farrukh
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards, Farrukh

Re: 3rd party JS+Wicket 6.6.0=MyWidget ?

Posted by Andrea Del Bene <an...@gmail.com>.
Hi,

for a "gentle" introduction to JavaScript integration you can also refer
to the official guide:

http://wicket.apache.org/guide/guide/single.html#jsintegration
> I just delving in these libraries
>
>
> On Wed, Feb 19, 2014 at 11:51 AM, Farrukh SATTOROV <fi...@gmail.com>wrote:
>
>> Thank you, Martin
>>
>>
>> On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov <mg...@apache.org>wrote:
>>
>>> Hi,
>>>
>>> Usually the steps to integrate any JS widget with Wicket are:
>>> 1) create a custom Component or Behavior that will contribute the .js (and
>>> any .css, images, ... if needed) in #renderHead()
>>> 2) if the JS widget needs configuration (e.g. some JSON object passed to
>>> the widget's constructor) then use again #renderHead() to write it to the
>>> response
>>> 3) if the JS widget provides functionality to send data back to the server
>>> then use either Ajax Behavior, IResourceListener or mounted resource
>>>
>>> I recommend you to check the source of some integrations:
>>> - https://github.com/sebfz1/wicket-jquery-ui
>>> - https://github.com/l0rdn1kk0n/wicket-bootstrap
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>>
>>>
>>> On Wed, Feb 19, 2014 at 8:45 AM, Farrukh SATTOROV <firedandy@gmail.com
>>>> wrote:
>>>> Hi all, is there any recipes how integrate 3rd party javascript
>>> component
>>>> to wicket component. For example i have Timeline js class and i need to
>>>> bind it to WebComponent as container, what steps i need to do.
>>>>
>>>> --
>>>> Regards, Farrukh
>>>>
>>
>>
>> --
>> Regards, Farrukh
>>
>
>


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


Re: 3rd party JS+Wicket 6.6.0=MyWidget ?

Posted by Farrukh SATTOROV <fi...@gmail.com>.
I just delving in these libraries


On Wed, Feb 19, 2014 at 11:51 AM, Farrukh SATTOROV <fi...@gmail.com>wrote:

> Thank you, Martin
>
>
> On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov <mg...@apache.org>wrote:
>
>> Hi,
>>
>> Usually the steps to integrate any JS widget with Wicket are:
>> 1) create a custom Component or Behavior that will contribute the .js (and
>> any .css, images, ... if needed) in #renderHead()
>> 2) if the JS widget needs configuration (e.g. some JSON object passed to
>> the widget's constructor) then use again #renderHead() to write it to the
>> response
>> 3) if the JS widget provides functionality to send data back to the server
>> then use either Ajax Behavior, IResourceListener or mounted resource
>>
>> I recommend you to check the source of some integrations:
>> - https://github.com/sebfz1/wicket-jquery-ui
>> - https://github.com/l0rdn1kk0n/wicket-bootstrap
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>>
>>
>> On Wed, Feb 19, 2014 at 8:45 AM, Farrukh SATTOROV <firedandy@gmail.com
>> >wrote:
>>
>> > Hi all, is there any recipes how integrate 3rd party javascript
>> component
>> > to wicket component. For example i have Timeline js class and i need to
>> > bind it to WebComponent as container, what steps i need to do.
>> >
>> > --
>> > Regards, Farrukh
>> >
>>
>
>
>
> --
> Regards, Farrukh
>



-- 
Regards, Farrukh

Re: 3rd party JS+Wicket 6.6.0=MyWidget ?

Posted by Farrukh SATTOROV <fi...@gmail.com>.
Thank you, Martin


On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> Usually the steps to integrate any JS widget with Wicket are:
> 1) create a custom Component or Behavior that will contribute the .js (and
> any .css, images, ... if needed) in #renderHead()
> 2) if the JS widget needs configuration (e.g. some JSON object passed to
> the widget's constructor) then use again #renderHead() to write it to the
> response
> 3) if the JS widget provides functionality to send data back to the server
> then use either Ajax Behavior, IResourceListener or mounted resource
>
> I recommend you to check the source of some integrations:
> - https://github.com/sebfz1/wicket-jquery-ui
> - https://github.com/l0rdn1kk0n/wicket-bootstrap
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Wed, Feb 19, 2014 at 8:45 AM, Farrukh SATTOROV <firedandy@gmail.com
> >wrote:
>
> > Hi all, is there any recipes how integrate 3rd party javascript component
> > to wicket component. For example i have Timeline js class and i need to
> > bind it to WebComponent as container, what steps i need to do.
> >
> > --
> > Regards, Farrukh
> >
>



-- 
Regards, Farrukh

Re: 3rd party JS+Wicket 6.6.0=MyWidget ?

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

Usually the steps to integrate any JS widget with Wicket are:
1) create a custom Component or Behavior that will contribute the .js (and
any .css, images, ... if needed) in #renderHead()
2) if the JS widget needs configuration (e.g. some JSON object passed to
the widget's constructor) then use again #renderHead() to write it to the
response
3) if the JS widget provides functionality to send data back to the server
then use either Ajax Behavior, IResourceListener or mounted resource

I recommend you to check the source of some integrations:
- https://github.com/sebfz1/wicket-jquery-ui
- https://github.com/l0rdn1kk0n/wicket-bootstrap

Martin Grigorov
Wicket Training and Consulting


On Wed, Feb 19, 2014 at 8:45 AM, Farrukh SATTOROV <fi...@gmail.com>wrote:

> Hi all, is there any recipes how integrate 3rd party javascript component
> to wicket component. For example i have Timeline js class and i need to
> bind it to WebComponent as container, what steps i need to do.
>
> --
> Regards, Farrukh
>