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

2014-02-19 Thread Andrea Del Bene
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 fireda...@gmail.comwrote:

 Thank you, Martin


 On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov 
 mgrigo...@apache.orgwrote:

 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 fireda...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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

2014-02-19 Thread Farrukh SATTOROV
step by step debugging help me understand )


On Wed, Feb 19, 2014 at 4:52 PM, Andrea Del Bene an.delb...@gmail.comwrote:

 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 fireda...@gmail.com
 wrote:
 
  Thank you, Martin
 
 
  On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov mgrigo...@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 fireda...@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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Regards, Farrukh


3rd party JS+Wicket 6.6.0=MyWidget ?

2014-02-18 Thread Farrukh SATTOROV
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 ?

2014-02-18 Thread Ernesto Reinaldo Barreiro
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, IModelString 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 fireda...@gmail.comwrote:

 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 ?

2014-02-18 Thread Farrukh SATTOROV
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 
reier...@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, IModelString 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 fireda...@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 ?

2014-02-18 Thread Martin Grigorov
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 fireda...@gmail.comwrote:

 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 ?

2014-02-18 Thread Farrukh SATTOROV
Thank you, Martin


On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 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 fireda...@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 ?

2014-02-18 Thread Farrukh SATTOROV
I just delving in these libraries


On Wed, Feb 19, 2014 at 11:51 AM, Farrukh SATTOROV fireda...@gmail.comwrote:

 Thank you, Martin


 On Wed, Feb 19, 2014 at 11:42 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 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 fireda...@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