Re: JQuery - best practice

2013-02-02 Thread Martin Grigorov
Hi Sebastien,

I'll take a look at it soon.


On Sat, Feb 2, 2013 at 2:59 PM, Sebastien  wrote:

> Hi Martin,
>
> Thank you so much!
>
> Then, I guess I am ready... All is located here (and sorry for the long
> preamble):
> https://github.com/sebfz1/wicket-jquery-ui/issues/17
>
> Thanks & best regards,
> Sebastien.
>
> On Thu, Jan 31, 2013 at 12:28 AM, Martin Grigorov  >wrote:
>
> > Sebastien,
> >
> > I'll be glad to help you if I can!
> > Just let me know when you are ready.
> >
> >
> > On Wed, Jan 30, 2013 at 9:19 PM, Sebastien  wrote:
> >
> > > Hi,
> > >
> > > @Pieter,
> > > Yes, a Panel was definitely not the best idea, it would have been
> better
> > to
> > > have - for the moment at least - a WebMarkupContainer as I planned as
> the
> > > beginning.
> > > I did a try on Martin's and Ernesto's suggestion(s) (handling callbacks
> > in
> > > behaviors, in addition to a Listener/Adapter). I need to think a little
> > bit
> > > more on this...
> > > Anyway, I am also glad that you solved your problem. If, for any
> reason,
> > > you encounter unexptected issue with your solution, I can revert the
> > Panel
> > > to a WebMarkupContainer at no cost, so it will be easy to use it in
> your
> > > use case.
> > >
> > > @Ernesto,
> > > About your concerns related to the age and to earn some money at the
> end
> > of
> > > the month, I know exactly what your are talking about! :)
> > >
> > > @Martin,
> > > As said above, I did a try with your suggestion with a solution that
> > works
> > > nicely. But I was not able to apply it as you wrote it (for reasons I
> can
> > > explain). So, I will continue to think a little bit to this to be sure
> I
> > do
> > > not "miss" something, and, if you don't mind (I don't want to bother
> you
> > > with wicket-jquery-ui dev), I would like to commit a "new designed
> > > behavior" in github, telling you what was the original approach and
> what
> > is
> > > the new one, and if you could tell me if the new one is
> > > good/relevant/wicket-way, I will really appreciate!
> > >
> > > Best regards to you all,
> > > Sebastien.
> > >
> >
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


Re: JQuery - best practice

2013-02-02 Thread Sebastien
Hi Martin,

Thank you so much!

Then, I guess I am ready... All is located here (and sorry for the long
preamble):
https://github.com/sebfz1/wicket-jquery-ui/issues/17

Thanks & best regards,
Sebastien.

On Thu, Jan 31, 2013 at 12:28 AM, Martin Grigorov wrote:

> Sebastien,
>
> I'll be glad to help you if I can!
> Just let me know when you are ready.
>
>
> On Wed, Jan 30, 2013 at 9:19 PM, Sebastien  wrote:
>
> > Hi,
> >
> > @Pieter,
> > Yes, a Panel was definitely not the best idea, it would have been better
> to
> > have - for the moment at least - a WebMarkupContainer as I planned as the
> > beginning.
> > I did a try on Martin's and Ernesto's suggestion(s) (handling callbacks
> in
> > behaviors, in addition to a Listener/Adapter). I need to think a little
> bit
> > more on this...
> > Anyway, I am also glad that you solved your problem. If, for any reason,
> > you encounter unexptected issue with your solution, I can revert the
> Panel
> > to a WebMarkupContainer at no cost, so it will be easy to use it in your
> > use case.
> >
> > @Ernesto,
> > About your concerns related to the age and to earn some money at the end
> of
> > the month, I know exactly what your are talking about! :)
> >
> > @Martin,
> > As said above, I did a try with your suggestion with a solution that
> works
> > nicely. But I was not able to apply it as you wrote it (for reasons I can
> > explain). So, I will continue to think a little bit to this to be sure I
> do
> > not "miss" something, and, if you don't mind (I don't want to bother you
> > with wicket-jquery-ui dev), I would like to commit a "new designed
> > behavior" in github, telling you what was the original approach and what
> is
> > the new one, and if you could tell me if the new one is
> > good/relevant/wicket-way, I will really appreciate!
> >
> > Best regards to you all,
> > Sebastien.
> >
>


Re: JQuery - best practice

2013-01-30 Thread Martin Grigorov
Sebastien,

I'll be glad to help you if I can!
Just let me know when you are ready.


On Wed, Jan 30, 2013 at 9:19 PM, Sebastien  wrote:

> Hi,
>
> @Pieter,
> Yes, a Panel was definitely not the best idea, it would have been better to
> have - for the moment at least - a WebMarkupContainer as I planned as the
> beginning.
> I did a try on Martin's and Ernesto's suggestion(s) (handling callbacks in
> behaviors, in addition to a Listener/Adapter). I need to think a little bit
> more on this...
> Anyway, I am also glad that you solved your problem. If, for any reason,
> you encounter unexptected issue with your solution, I can revert the Panel
> to a WebMarkupContainer at no cost, so it will be easy to use it in your
> use case.
>
> @Ernesto,
> About your concerns related to the age and to earn some money at the end of
> the month, I know exactly what your are talking about! :)
>
> @Martin,
> As said above, I did a try with your suggestion with a solution that works
> nicely. But I was not able to apply it as you wrote it (for reasons I can
> explain). So, I will continue to think a little bit to this to be sure I do
> not "miss" something, and, if you don't mind (I don't want to bother you
> with wicket-jquery-ui dev), I would like to commit a "new designed
> behavior" in github, telling you what was the original approach and what is
> the new one, and if you could tell me if the new one is
> good/relevant/wicket-way, I will really appreciate!
>
> Best regards to you all,
> Sebastien.
>
> On Wed, Jan 30, 2013 at 4:08 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Good that you where able to solve your problem!
> >
> > On Wed, Jan 30, 2013 at 3:53 PM, Pieter Claassen 
> > wrote:
> >
> > > Ok, I just implemented my own. Seems to work.
> > >
> > > In my code
> > > MyResizableBehavior resizableBehavior = new
> > MyResizableBehavior();
> > > resizableBehavior.setStopEvent(new
> > > MyResizableBehavior.AjaxResizeStopCallback() {
> > > @Override
> > > protected void resize(AjaxRequestTarget target, Component
> > > source, int resizeHeight, int resizeWidth) {
> > > 
> > > }
> > >
> > > });
> > >
> > >
> > > public class MyResizableBehavior extends ResizableBehavior {
> > > public abstract static class AjaxResizeStopCallback extends
> > > AbstractAjaxEventCallback
> > > {
> > > private static final long serialVersionUID = 1L;
> > >
> > > public AjaxResizeStopCallback()
> > > {
> > > super("stop");
> > > }
> > >
> > > @Override
> > > protected List getExtraParameters()
> > > {
> > > List ret = super.getExtraParameters();
> > > ret.add(CallbackParameter.resolved("resizeHeight",
> > > ResizableBehavior.UI_SIZE
> > > + ".height"));
> > > ret.add(CallbackParameter.resolved("resizeWidth",
> > > ResizableBehavior.UI_SIZE + ".width"));
> > > return ret;
> > > }
> > >
> > > @Override
> > > public final void call(AjaxRequestTarget target, Component
> > source)
> > > {
> > > IRequestParameters req =
> > > RequestCycle.get().getRequest().getRequestParameters();
> > >
> > > int resizeHeight =
> > > req.getParameterValue("resizeHeight").toInt(-1);
> > > int resizeWidth =
> > > req.getParameterValue("resizeWidth").toInt(-1);
> > > resize(target, source, resizeHeight, resizeWidth);
> > > }
> > >
> > > protected abstract void resize(AjaxRequestTarget target,
> > Component
> > > source,
> > >int resizeHeight, int
> > resizeWidth);
> > > }
> > >
> > >
> > > public MyResizableBehavior
> > > setStopEvent(MyResizableBehavior.AjaxResizeStopCallback callback){
> > >
> > > setEventListener(callback);
> > > return this;
> > > }
> > > }
> > >
> > >
> > > On Wed, Jan 30, 2013 at 3:15 PM, Pieter Claassen 
> > > wrote:
> > >
> > > > Ernesto,
> > > >
> > > > I cannot find any code in wiquery-6.2.0. that hooks into the
> stopEvent.
> > > > The example you provided seems to still force a round trip on any
> > change,
> > > > not just on stopEvent.
> > > >
> > > > Maybe I am daft, but I don't see any code that does this? I assume
> one
> > > can
> > > > extend ResizableBehaviour and add the stopEvent code to hook into a
> > > > callback, but I don't want to do this if this functionality already
> > > exists
> > > > and I just can't find it.
> > > >
> > > > Thanks for the help.
> > > > Pieter
> > > >
> > > >
> > > > On Wed, Jan 30, 2013 at 3:00 PM, Ernesto Reinaldo Barreiro <
> > > > reier...@gmail.com> wrote:
> > > >
> > > >> Pieter,
> > > >>
> > > >> Look at this example.
> > > >>
> > > >>
> > > >>
> > >
> >
> http://antiliasoft.com/wiquery-plugins/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ResizablePage
> > > >>
> > > >> and click on the ? at the left corn

Re: JQuery - best practice

2013-01-30 Thread Sebastien
Hi,

@Pieter,
Yes, a Panel was definitely not the best idea, it would have been better to
have - for the moment at least - a WebMarkupContainer as I planned as the
beginning.
I did a try on Martin's and Ernesto's suggestion(s) (handling callbacks in
behaviors, in addition to a Listener/Adapter). I need to think a little bit
more on this...
Anyway, I am also glad that you solved your problem. If, for any reason,
you encounter unexptected issue with your solution, I can revert the Panel
to a WebMarkupContainer at no cost, so it will be easy to use it in your
use case.

@Ernesto,
About your concerns related to the age and to earn some money at the end of
the month, I know exactly what your are talking about! :)

@Martin,
As said above, I did a try with your suggestion with a solution that works
nicely. But I was not able to apply it as you wrote it (for reasons I can
explain). So, I will continue to think a little bit to this to be sure I do
not "miss" something, and, if you don't mind (I don't want to bother you
with wicket-jquery-ui dev), I would like to commit a "new designed
behavior" in github, telling you what was the original approach and what is
the new one, and if you could tell me if the new one is
good/relevant/wicket-way, I will really appreciate!

Best regards to you all,
Sebastien.

On Wed, Jan 30, 2013 at 4:08 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Good that you where able to solve your problem!
>
> On Wed, Jan 30, 2013 at 3:53 PM, Pieter Claassen 
> wrote:
>
> > Ok, I just implemented my own. Seems to work.
> >
> > In my code
> > MyResizableBehavior resizableBehavior = new
> MyResizableBehavior();
> > resizableBehavior.setStopEvent(new
> > MyResizableBehavior.AjaxResizeStopCallback() {
> > @Override
> > protected void resize(AjaxRequestTarget target, Component
> > source, int resizeHeight, int resizeWidth) {
> > 
> > }
> >
> > });
> >
> >
> > public class MyResizableBehavior extends ResizableBehavior {
> > public abstract static class AjaxResizeStopCallback extends
> > AbstractAjaxEventCallback
> > {
> > private static final long serialVersionUID = 1L;
> >
> > public AjaxResizeStopCallback()
> > {
> > super("stop");
> > }
> >
> > @Override
> > protected List getExtraParameters()
> > {
> > List ret = super.getExtraParameters();
> > ret.add(CallbackParameter.resolved("resizeHeight",
> > ResizableBehavior.UI_SIZE
> > + ".height"));
> > ret.add(CallbackParameter.resolved("resizeWidth",
> > ResizableBehavior.UI_SIZE + ".width"));
> > return ret;
> > }
> >
> > @Override
> > public final void call(AjaxRequestTarget target, Component
> source)
> > {
> > IRequestParameters req =
> > RequestCycle.get().getRequest().getRequestParameters();
> >
> > int resizeHeight =
> > req.getParameterValue("resizeHeight").toInt(-1);
> > int resizeWidth =
> > req.getParameterValue("resizeWidth").toInt(-1);
> > resize(target, source, resizeHeight, resizeWidth);
> > }
> >
> > protected abstract void resize(AjaxRequestTarget target,
> Component
> > source,
> >int resizeHeight, int
> resizeWidth);
> > }
> >
> >
> > public MyResizableBehavior
> > setStopEvent(MyResizableBehavior.AjaxResizeStopCallback callback){
> >
> > setEventListener(callback);
> > return this;
> > }
> > }
> >
> >
> > On Wed, Jan 30, 2013 at 3:15 PM, Pieter Claassen 
> > wrote:
> >
> > > Ernesto,
> > >
> > > I cannot find any code in wiquery-6.2.0. that hooks into the stopEvent.
> > > The example you provided seems to still force a round trip on any
> change,
> > > not just on stopEvent.
> > >
> > > Maybe I am daft, but I don't see any code that does this? I assume one
> > can
> > > extend ResizableBehaviour and add the stopEvent code to hook into a
> > > callback, but I don't want to do this if this functionality already
> > exists
> > > and I just can't find it.
> > >
> > > Thanks for the help.
> > > Pieter
> > >
> > >
> > > On Wed, Jan 30, 2013 at 3:00 PM, Ernesto Reinaldo Barreiro <
> > > reier...@gmail.com> wrote:
> > >
> > >> Pieter,
> > >>
> > >> Look at this example.
> > >>
> > >>
> > >>
> >
> http://antiliasoft.com/wiquery-plugins/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ResizablePage
> > >>
> > >> and click on the ? at the left corner/. It is exactly what you want...
> > >> Wiquery  already have a ResizableAjaxBehavior that hooks into
> stopEvent.
> > >> Fell free to copy or adapt it to your needs;-). Let me know if I can
> > >> further help you somehow.
> > >>
> > >> On Wed, Jan 30, 2013 at 2:46 PM, Pieter Claassen 
> > >> wrote:
> > >>
> > >> > Ernesto/Sebastien,
> > >> >
> > >> > I am stuck :-(
> > >> >
> > >> > Firstly, thanks for the resizable

Re: JQuery - best practice

2013-01-30 Thread Ernesto Reinaldo Barreiro
Good that you where able to solve your problem!

On Wed, Jan 30, 2013 at 3:53 PM, Pieter Claassen  wrote:

> Ok, I just implemented my own. Seems to work.
>
> In my code
> MyResizableBehavior resizableBehavior = new MyResizableBehavior();
> resizableBehavior.setStopEvent(new
> MyResizableBehavior.AjaxResizeStopCallback() {
> @Override
> protected void resize(AjaxRequestTarget target, Component
> source, int resizeHeight, int resizeWidth) {
> 
> }
>
> });
>
>
> public class MyResizableBehavior extends ResizableBehavior {
> public abstract static class AjaxResizeStopCallback extends
> AbstractAjaxEventCallback
> {
> private static final long serialVersionUID = 1L;
>
> public AjaxResizeStopCallback()
> {
> super("stop");
> }
>
> @Override
> protected List getExtraParameters()
> {
> List ret = super.getExtraParameters();
> ret.add(CallbackParameter.resolved("resizeHeight",
> ResizableBehavior.UI_SIZE
> + ".height"));
> ret.add(CallbackParameter.resolved("resizeWidth",
> ResizableBehavior.UI_SIZE + ".width"));
> return ret;
> }
>
> @Override
> public final void call(AjaxRequestTarget target, Component source)
> {
> IRequestParameters req =
> RequestCycle.get().getRequest().getRequestParameters();
>
> int resizeHeight =
> req.getParameterValue("resizeHeight").toInt(-1);
> int resizeWidth =
> req.getParameterValue("resizeWidth").toInt(-1);
> resize(target, source, resizeHeight, resizeWidth);
> }
>
> protected abstract void resize(AjaxRequestTarget target, Component
> source,
>int resizeHeight, int resizeWidth);
> }
>
>
> public MyResizableBehavior
> setStopEvent(MyResizableBehavior.AjaxResizeStopCallback callback){
>
> setEventListener(callback);
> return this;
> }
> }
>
>
> On Wed, Jan 30, 2013 at 3:15 PM, Pieter Claassen 
> wrote:
>
> > Ernesto,
> >
> > I cannot find any code in wiquery-6.2.0. that hooks into the stopEvent.
> > The example you provided seems to still force a round trip on any change,
> > not just on stopEvent.
> >
> > Maybe I am daft, but I don't see any code that does this? I assume one
> can
> > extend ResizableBehaviour and add the stopEvent code to hook into a
> > callback, but I don't want to do this if this functionality already
> exists
> > and I just can't find it.
> >
> > Thanks for the help.
> > Pieter
> >
> >
> > On Wed, Jan 30, 2013 at 3:00 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> >> Pieter,
> >>
> >> Look at this example.
> >>
> >>
> >>
> http://antiliasoft.com/wiquery-plugins/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ResizablePage
> >>
> >> and click on the ? at the left corner/. It is exactly what you want...
> >> Wiquery  already have a ResizableAjaxBehavior that hooks into stopEvent.
> >> Fell free to copy or adapt it to your needs;-). Let me know if I can
> >> further help you somehow.
> >>
> >> On Wed, Jan 30, 2013 at 2:46 PM, Pieter Claassen 
> >> wrote:
> >>
> >> > Ernesto/Sebastien,
> >> >
> >> > I am stuck :-(
> >> >
> >> > Firstly, thanks for the resizablePanel in wicket-jquery-ui, but I have
> >> to
> >> > hold off until this code is implemented in a behavior since my
> >> inheritance
> >> > doesn't match your project (I cannot inherit from resizablePanel).
> >> >
> >> > I looked at what was available in wiquery and found the functionality
> >> > there, except.
> >> >
> >> > When I implement the code below, I force an ajax round-trip to the
> >> service
> >> > whenever the re-size event is triggered which is a lot during a
> >> > panel re-size  This is not practical with the the model updates.
> Ideally
> >> > one would like to only update the position on stopEvents but the API
> >> > provides only for the setting of a JavaScript callback on stopEvents.
> >> >
> >> > Does anybody have a suggestion on how to make this behavior
> practically
> >> > usable?
> >> >
> >> > Thanks,
> >> > Pieter
> >> >
> >> >
> >> >  ResizableBehavior resizableBehavior = new ResizableBehavior();
> >> > resizableBehavior.setResizeEvent(new
> >> > ResizableBehavior.AjaxResizeCallback() {
> >> > @Override
> >> > protected void resize(AjaxRequestTarget target, Component
> >> > source, int resizeHeight, int resizeWidth) {
> >> > AdvancedFormatter advancedFormatter =
> >> > questionBaseWebModel.getEntity().getStatement().getFormatter();
> >> > advancedFormatter.setWidth((float)resizeWidth / 800 *
> >> 100);
> >> > advancedFormatter.setHeight((float)resizeHeight);
> >> > advancedFormatterFactory.save(advancedFormatter);
> >> > }
> >> >
> >> > });
> >> >
> >> > This is available but on

Re: JQuery - best practice

2013-01-30 Thread Ernesto Reinaldo Barreiro
Hi,

On Wed, Jan 30, 2013 at 3:15 PM, Pieter Claassen  wrote:

> Ernesto,
>
> I cannot find any code in wiquery-6.2.0. that hooks into the stopEvent. The
> example you provided seems to still force a round trip on any change, not
> just on stopEvent.
>
> Maybe I am daft, but I don't see any code that does this? I assume one can
> extend ResizableBehaviour and add the stopEvent code to hook into a
> callback, but I don't want to do this if this functionality already exists
> and I just can't find it.
>
>
Uhm... Maybe that behavior was only part of
http://code.google.com/p/wiquery-plugins/? I thought that was already
included on wiquery... at least it is on 1.5.x branch. I will have a look
at 6.x branch and if it is not there I will  add it.



> Thanks for the help.
> Pieter
>
>
> On Wed, Jan 30, 2013 at 3:00 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Pieter,
> >
> > Look at this example.
> >
> >
> >
> http://antiliasoft.com/wiquery-plugins/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ResizablePage
> >
> > and click on the ? at the left corner/. It is exactly what you want...
> > Wiquery  already have a ResizableAjaxBehavior that hooks into stopEvent.
> > Fell free to copy or adapt it to your needs;-). Let me know if I can
> > further help you somehow.
> >
> > On Wed, Jan 30, 2013 at 2:46 PM, Pieter Claassen 
> > wrote:
> >
> > > Ernesto/Sebastien,
> > >
> > > I am stuck :-(
> > >
> > > Firstly, thanks for the resizablePanel in wicket-jquery-ui, but I have
> to
> > > hold off until this code is implemented in a behavior since my
> > inheritance
> > > doesn't match your project (I cannot inherit from resizablePanel).
> > >
> > > I looked at what was available in wiquery and found the functionality
> > > there, except.
> > >
> > > When I implement the code below, I force an ajax round-trip to the
> > service
> > > whenever the re-size event is triggered which is a lot during a
> > > panel re-size  This is not practical with the the model updates.
> Ideally
> > > one would like to only update the position on stopEvents but the API
> > > provides only for the setting of a JavaScript callback on stopEvents.
> > >
> > > Does anybody have a suggestion on how to make this behavior practically
> > > usable?
> > >
> > > Thanks,
> > > Pieter
> > >
> > >
> > >  ResizableBehavior resizableBehavior = new ResizableBehavior();
> > > resizableBehavior.setResizeEvent(new
> > > ResizableBehavior.AjaxResizeCallback() {
> > > @Override
> > > protected void resize(AjaxRequestTarget target, Component
> > > source, int resizeHeight, int resizeWidth) {
> > > AdvancedFormatter advancedFormatter =
> > > questionBaseWebModel.getEntity().getStatement().getFormatter();
> > > advancedFormatter.setWidth((float)resizeWidth / 800 *
> > 100);
> > > advancedFormatter.setHeight((float)resizeHeight);
> > > advancedFormatterFactory.save(advancedFormatter);
> > > }
> > >
> > > });
> > >
> > > This is available but only for JavaScript callbacks
> > >
> > >  resizableBehavior.setStopEvent(JsScopeUiEvent.quickScope("alert();"));
> > >
> > >
> > >
> > >
> > >
> > > On Mon, Jan 28, 2013 at 8:28 AM, Ernesto Reinaldo Barreiro <
> > > reier...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen  >
> > > > wrote:
> > > >
> > > > > This is a general best practice question. I am using
> wicket-jquery-ui
> > > > > because I don't seem to be able to find a resizable panel in the
> > > > > internal wicket ajax widgets.
> > > > >
> > > > > 1. Is there no problem loading new jquery libraries over the wicket
> > > > > implementation? What is best practice?
> > > > >
> > > >
> > > > Look at the existing jquery integrations and see what people do?
> > > >
> > > >
> > > >
> > > > > 2. I am looking for a way to get the resized panels' x and y size
> > > > > parameters into my wicket code? Any suggestions how to do this?
> > > > >
> > > > > You have to:
> > > >
> > > > 1-Hook onto the client side events triggered by resize and use
> > > > Wicket.AJA.get/post to stream back the parameters.
> > > > 2-Attach and AJAX behavior at server side component and on respond
> get
> > > and
> > > > parse those parameter.
> > > >
> > > > Examples?
> > > >
> > > >
> > > >
> > >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
> > > >
> > > >
> > >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
> > > >
> > > > or event better
> > > >
> > > >
> > > >
> > >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/resizable/ResizableBehavior.java
> > > >
> > > > wihc already have that functionality (see AjaxResizeCallback)
> > > >
> > > >
> > > >
> > > > > Thanks,
> > > > > Pieter
> > > > >
> 

Re: JQuery - best practice

2013-01-30 Thread Pieter Claassen
Ok, I just implemented my own. Seems to work.

In my code
MyResizableBehavior resizableBehavior = new MyResizableBehavior();
resizableBehavior.setStopEvent(new
MyResizableBehavior.AjaxResizeStopCallback() {
@Override
protected void resize(AjaxRequestTarget target, Component
source, int resizeHeight, int resizeWidth) {

}

});


public class MyResizableBehavior extends ResizableBehavior {
public abstract static class AjaxResizeStopCallback extends
AbstractAjaxEventCallback
{
private static final long serialVersionUID = 1L;

public AjaxResizeStopCallback()
{
super("stop");
}

@Override
protected List getExtraParameters()
{
List ret = super.getExtraParameters();
ret.add(CallbackParameter.resolved("resizeHeight",
ResizableBehavior.UI_SIZE
+ ".height"));
ret.add(CallbackParameter.resolved("resizeWidth",
ResizableBehavior.UI_SIZE + ".width"));
return ret;
}

@Override
public final void call(AjaxRequestTarget target, Component source)
{
IRequestParameters req =
RequestCycle.get().getRequest().getRequestParameters();

int resizeHeight =
req.getParameterValue("resizeHeight").toInt(-1);
int resizeWidth =
req.getParameterValue("resizeWidth").toInt(-1);
resize(target, source, resizeHeight, resizeWidth);
}

protected abstract void resize(AjaxRequestTarget target, Component
source,
   int resizeHeight, int resizeWidth);
}


public MyResizableBehavior
setStopEvent(MyResizableBehavior.AjaxResizeStopCallback callback){

setEventListener(callback);
return this;
}
}


On Wed, Jan 30, 2013 at 3:15 PM, Pieter Claassen  wrote:

> Ernesto,
>
> I cannot find any code in wiquery-6.2.0. that hooks into the stopEvent.
> The example you provided seems to still force a round trip on any change,
> not just on stopEvent.
>
> Maybe I am daft, but I don't see any code that does this? I assume one can
> extend ResizableBehaviour and add the stopEvent code to hook into a
> callback, but I don't want to do this if this functionality already exists
> and I just can't find it.
>
> Thanks for the help.
> Pieter
>
>
> On Wed, Jan 30, 2013 at 3:00 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> Pieter,
>>
>> Look at this example.
>>
>>
>> http://antiliasoft.com/wiquery-plugins/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ResizablePage
>>
>> and click on the ? at the left corner/. It is exactly what you want...
>> Wiquery  already have a ResizableAjaxBehavior that hooks into stopEvent.
>> Fell free to copy or adapt it to your needs;-). Let me know if I can
>> further help you somehow.
>>
>> On Wed, Jan 30, 2013 at 2:46 PM, Pieter Claassen 
>> wrote:
>>
>> > Ernesto/Sebastien,
>> >
>> > I am stuck :-(
>> >
>> > Firstly, thanks for the resizablePanel in wicket-jquery-ui, but I have
>> to
>> > hold off until this code is implemented in a behavior since my
>> inheritance
>> > doesn't match your project (I cannot inherit from resizablePanel).
>> >
>> > I looked at what was available in wiquery and found the functionality
>> > there, except.
>> >
>> > When I implement the code below, I force an ajax round-trip to the
>> service
>> > whenever the re-size event is triggered which is a lot during a
>> > panel re-size  This is not practical with the the model updates. Ideally
>> > one would like to only update the position on stopEvents but the API
>> > provides only for the setting of a JavaScript callback on stopEvents.
>> >
>> > Does anybody have a suggestion on how to make this behavior practically
>> > usable?
>> >
>> > Thanks,
>> > Pieter
>> >
>> >
>> >  ResizableBehavior resizableBehavior = new ResizableBehavior();
>> > resizableBehavior.setResizeEvent(new
>> > ResizableBehavior.AjaxResizeCallback() {
>> > @Override
>> > protected void resize(AjaxRequestTarget target, Component
>> > source, int resizeHeight, int resizeWidth) {
>> > AdvancedFormatter advancedFormatter =
>> > questionBaseWebModel.getEntity().getStatement().getFormatter();
>> > advancedFormatter.setWidth((float)resizeWidth / 800 *
>> 100);
>> > advancedFormatter.setHeight((float)resizeHeight);
>> > advancedFormatterFactory.save(advancedFormatter);
>> > }
>> >
>> > });
>> >
>> > This is available but only for JavaScript callbacks
>> >
>> >  resizableBehavior.setStopEvent(JsScopeUiEvent.quickScope("alert();"));
>> >
>> >
>> >
>> >
>> >
>> > On Mon, Jan 28, 2013 at 8:28 AM, Ernesto Reinaldo Barreiro <
>> > reier...@gmail.com> wrote:
>> >
>> > > Hi,
>> > >
>> > > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen 
>> > > wrote:
>> > >
>> > > > This is a general best practice question. I am usin

Re: JQuery - best practice

2013-01-30 Thread Pieter Claassen
Ernesto,

I cannot find any code in wiquery-6.2.0. that hooks into the stopEvent. The
example you provided seems to still force a round trip on any change, not
just on stopEvent.

Maybe I am daft, but I don't see any code that does this? I assume one can
extend ResizableBehaviour and add the stopEvent code to hook into a
callback, but I don't want to do this if this functionality already exists
and I just can't find it.

Thanks for the help.
Pieter


On Wed, Jan 30, 2013 at 3:00 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Pieter,
>
> Look at this example.
>
>
> http://antiliasoft.com/wiquery-plugins/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ResizablePage
>
> and click on the ? at the left corner/. It is exactly what you want...
> Wiquery  already have a ResizableAjaxBehavior that hooks into stopEvent.
> Fell free to copy or adapt it to your needs;-). Let me know if I can
> further help you somehow.
>
> On Wed, Jan 30, 2013 at 2:46 PM, Pieter Claassen 
> wrote:
>
> > Ernesto/Sebastien,
> >
> > I am stuck :-(
> >
> > Firstly, thanks for the resizablePanel in wicket-jquery-ui, but I have to
> > hold off until this code is implemented in a behavior since my
> inheritance
> > doesn't match your project (I cannot inherit from resizablePanel).
> >
> > I looked at what was available in wiquery and found the functionality
> > there, except.
> >
> > When I implement the code below, I force an ajax round-trip to the
> service
> > whenever the re-size event is triggered which is a lot during a
> > panel re-size  This is not practical with the the model updates. Ideally
> > one would like to only update the position on stopEvents but the API
> > provides only for the setting of a JavaScript callback on stopEvents.
> >
> > Does anybody have a suggestion on how to make this behavior practically
> > usable?
> >
> > Thanks,
> > Pieter
> >
> >
> >  ResizableBehavior resizableBehavior = new ResizableBehavior();
> > resizableBehavior.setResizeEvent(new
> > ResizableBehavior.AjaxResizeCallback() {
> > @Override
> > protected void resize(AjaxRequestTarget target, Component
> > source, int resizeHeight, int resizeWidth) {
> > AdvancedFormatter advancedFormatter =
> > questionBaseWebModel.getEntity().getStatement().getFormatter();
> > advancedFormatter.setWidth((float)resizeWidth / 800 *
> 100);
> > advancedFormatter.setHeight((float)resizeHeight);
> > advancedFormatterFactory.save(advancedFormatter);
> > }
> >
> > });
> >
> > This is available but only for JavaScript callbacks
> >
> >  resizableBehavior.setStopEvent(JsScopeUiEvent.quickScope("alert();"));
> >
> >
> >
> >
> >
> > On Mon, Jan 28, 2013 at 8:28 AM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen 
> > > wrote:
> > >
> > > > This is a general best practice question. I am using wicket-jquery-ui
> > > > because I don't seem to be able to find a resizable panel in the
> > > > internal wicket ajax widgets.
> > > >
> > > > 1. Is there no problem loading new jquery libraries over the wicket
> > > > implementation? What is best practice?
> > > >
> > >
> > > Look at the existing jquery integrations and see what people do?
> > >
> > >
> > >
> > > > 2. I am looking for a way to get the resized panels' x and y size
> > > > parameters into my wicket code? Any suggestions how to do this?
> > > >
> > > > You have to:
> > >
> > > 1-Hook onto the client side events triggered by resize and use
> > > Wicket.AJA.get/post to stream back the parameters.
> > > 2-Attach and AJAX behavior at server side component and on respond get
> > and
> > > parse those parameter.
> > >
> > > Examples?
> > >
> > >
> > >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
> > >
> > >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
> > >
> > > or event better
> > >
> > >
> > >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/resizable/ResizableBehavior.java
> > >
> > > wihc already have that functionality (see AjaxResizeCallback)
> > >
> > >
> > >
> > > > Thanks,
> > > > Pieter
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > > For additional commands, e-mail: users-h...@wicket.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Regards - Ernesto Reinaldo Barreiro
> > > Antilia Soft
> > > http://antiliasoft.com/ 
> > >
> >
> >
> >
> > --
> > - - - - - - - - - - - - - - - - - - - -
> >   Pieter Claassen
> >   Musmato B.V.
> >   e: pieter.claas...@musmato.com
> >   t: +31 877 848259
> >   w: http://musmato.com
> > - - - - - - - - - - -

Re: JQuery - best practice

2013-01-30 Thread Ernesto Reinaldo Barreiro
Pieter,

Look at this example.

http://antiliasoft.com/wiquery-plugins/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ResizablePage

and click on the ? at the left corner/. It is exactly what you want...
Wiquery  already have a ResizableAjaxBehavior that hooks into stopEvent.
Fell free to copy or adapt it to your needs;-). Let me know if I can
further help you somehow.

On Wed, Jan 30, 2013 at 2:46 PM, Pieter Claassen  wrote:

> Ernesto/Sebastien,
>
> I am stuck :-(
>
> Firstly, thanks for the resizablePanel in wicket-jquery-ui, but I have to
> hold off until this code is implemented in a behavior since my inheritance
> doesn't match your project (I cannot inherit from resizablePanel).
>
> I looked at what was available in wiquery and found the functionality
> there, except.
>
> When I implement the code below, I force an ajax round-trip to the service
> whenever the re-size event is triggered which is a lot during a
> panel re-size  This is not practical with the the model updates. Ideally
> one would like to only update the position on stopEvents but the API
> provides only for the setting of a JavaScript callback on stopEvents.
>
> Does anybody have a suggestion on how to make this behavior practically
> usable?
>
> Thanks,
> Pieter
>
>
>  ResizableBehavior resizableBehavior = new ResizableBehavior();
> resizableBehavior.setResizeEvent(new
> ResizableBehavior.AjaxResizeCallback() {
> @Override
> protected void resize(AjaxRequestTarget target, Component
> source, int resizeHeight, int resizeWidth) {
> AdvancedFormatter advancedFormatter =
> questionBaseWebModel.getEntity().getStatement().getFormatter();
> advancedFormatter.setWidth((float)resizeWidth / 800 * 100);
> advancedFormatter.setHeight((float)resizeHeight);
> advancedFormatterFactory.save(advancedFormatter);
> }
>
> });
>
> This is available but only for JavaScript callbacks
>
>  resizableBehavior.setStopEvent(JsScopeUiEvent.quickScope("alert();"));
>
>
>
>
>
> On Mon, Jan 28, 2013 at 8:28 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Hi,
> >
> > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen 
> > wrote:
> >
> > > This is a general best practice question. I am using wicket-jquery-ui
> > > because I don't seem to be able to find a resizable panel in the
> > > internal wicket ajax widgets.
> > >
> > > 1. Is there no problem loading new jquery libraries over the wicket
> > > implementation? What is best practice?
> > >
> >
> > Look at the existing jquery integrations and see what people do?
> >
> >
> >
> > > 2. I am looking for a way to get the resized panels' x and y size
> > > parameters into my wicket code? Any suggestions how to do this?
> > >
> > > You have to:
> >
> > 1-Hook onto the client side events triggered by resize and use
> > Wicket.AJA.get/post to stream back the parameters.
> > 2-Attach and AJAX behavior at server side component and on respond get
> and
> > parse those parameter.
> >
> > Examples?
> >
> >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
> >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
> >
> > or event better
> >
> >
> >
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/resizable/ResizableBehavior.java
> >
> > wihc already have that functionality (see AjaxResizeCallback)
> >
> >
> >
> > > Thanks,
> > > Pieter
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> > Antilia Soft
> > http://antiliasoft.com/ 
> >
>
>
>
> --
> - - - - - - - - - - - - - - - - - - - -
>   Pieter Claassen
>   Musmato B.V.
>   e: pieter.claas...@musmato.com
>   t: +31 877 848259
>   w: http://musmato.com
> - - - - - - - - - - - - - - - - - - - -
>



-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Re: JQuery - best practice

2013-01-30 Thread Pieter Claassen
Ernesto/Sebastien,

I am stuck :-(

Firstly, thanks for the resizablePanel in wicket-jquery-ui, but I have to
hold off until this code is implemented in a behavior since my inheritance
doesn't match your project (I cannot inherit from resizablePanel).

I looked at what was available in wiquery and found the functionality
there, except.

When I implement the code below, I force an ajax round-trip to the service
whenever the re-size event is triggered which is a lot during a
panel re-size  This is not practical with the the model updates. Ideally
one would like to only update the position on stopEvents but the API
provides only for the setting of a JavaScript callback on stopEvents.

Does anybody have a suggestion on how to make this behavior practically
usable?

Thanks,
Pieter


 ResizableBehavior resizableBehavior = new ResizableBehavior();
resizableBehavior.setResizeEvent(new
ResizableBehavior.AjaxResizeCallback() {
@Override
protected void resize(AjaxRequestTarget target, Component
source, int resizeHeight, int resizeWidth) {
AdvancedFormatter advancedFormatter =
questionBaseWebModel.getEntity().getStatement().getFormatter();
advancedFormatter.setWidth((float)resizeWidth / 800 * 100);
advancedFormatter.setHeight((float)resizeHeight);
advancedFormatterFactory.save(advancedFormatter);
}

});

This is available but only for JavaScript callbacks

 resizableBehavior.setStopEvent(JsScopeUiEvent.quickScope("alert();"));





On Mon, Jan 28, 2013 at 8:28 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen 
> wrote:
>
> > This is a general best practice question. I am using wicket-jquery-ui
> > because I don't seem to be able to find a resizable panel in the
> > internal wicket ajax widgets.
> >
> > 1. Is there no problem loading new jquery libraries over the wicket
> > implementation? What is best practice?
> >
>
> Look at the existing jquery integrations and see what people do?
>
>
>
> > 2. I am looking for a way to get the resized panels' x and y size
> > parameters into my wicket code? Any suggestions how to do this?
> >
> > You have to:
>
> 1-Hook onto the client side events triggered by resize and use
> Wicket.AJA.get/post to stream back the parameters.
> 2-Attach and AJAX behavior at server side component and on respond get and
> parse those parameter.
>
> Examples?
>
>
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
>
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java
>
> or event better
>
>
> https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/resizable/ResizableBehavior.java
>
> wihc already have that functionality (see AjaxResizeCallback)
>
>
>
> > Thanks,
> > Pieter
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ 
>



-- 
- - - - - - - - - - - - - - - - - - - -
  Pieter Claassen
  Musmato B.V.
  e: pieter.claas...@musmato.com
  t: +31 877 848259
  w: http://musmato.com
- - - - - - - - - - - - - - - - - - - -


Re: JQuery - best practice

2013-01-29 Thread Ernesto Reinaldo Barreiro
Hi,

On Tue, Jan 29, 2013 at 1:16 PM, Sebastien  wrote:

> Hi Ernesto, Hi Martin,
>
> Thank you very much for your inputs!! Then, I agree on the architecture,
> and will generalize this, as part of the upgrade to jQuery UI 1.10.
>
> @Ernesto, glad to read you like the demo app! :) I would like to redesign
> it in a little bit more sexy way, but I don't do what I want with the
> time... (unfortunately)
>


Demo is already quite nice as it is!


> What does prevent you to make a demo of wiquery components? Lack of time?
>

Lack of time mainly: I'm twice father, once husband, I'm also getting old
and I need to earn some money by the end of the month;-)... Seriously,
whenever I have a bit of free time I do prefer to fix something or add a
new feature than creating a demo...


> Or is it a technical issue? (your server seems to be IIS7 - with a nice 404
> at root by the way)


Yes! I have to fix that when I find some time. It should point to

http://antiliasoft.com/antilia/

which isn't finished either...


>

If this is this second case, and if you do not have your own server
> already, maybe can I host your webapp if you need/wish... Feel free to
> contact me in PM about this.
>


Thank you very much for your offer! I'm already paying for  that
(modest) hosting myself.

-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Re: JQuery - best practice

2013-01-29 Thread Sebastien
Hi Ernesto, Hi Martin,

Thank you very much for your inputs!! Then, I agree on the architecture,
and will generalize this, as part of the upgrade to jQuery UI 1.10.

@Ernesto, glad to read you like the demo app! :) I would like to redesign
it in a little bit more sexy way, but I don't do what I want with the
time... (unfortunately)
What does prevent you to make a demo of wiquery components? Lack of time?
Or is it a technical issue? (your server seems to be IIS7 - with a nice 404
at root by the way)
If this is this second case, and if you do not have your own server
already, maybe can I host your webapp if you need/wish... Feel free to
contact me in PM about this.

Best regards,
Sebastien.

On Tue, Jan 29, 2013 at 10:48 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> On Tue, Jan 29, 2013 at 10:26 AM, Sebastien  wrote:
>
> > Hi Ernesto, Hi Martin,
> >
> > > IMHO, it would make more sense to have that feature as a behavior
> instead
> > of a panel... that way you are not forcing an inheritance
> > For this point, I was not sure whether to make a WebMarkupContainer or a
> > Panel that, you are true, force the inheritance.
> >
> > But actually the main discussion here is... Is it the role of a Behavior
> to
> > handle callbacks or it is the role of a Wicket component to handle these,
> > or both.
> > I thought about this at the beginning of the project. I wanted to have a
> > component oriented API, as Wicket is, and to be the closest as possible
> in
> > term of phylosophy and coding pratice. My conclusion was that, but maybe
> am
> > I wrong, that it is the responsibility of the Component to handle
> > callbacks, not the Behavior. (but in another hand, Wicket's Behavior are
> > exposing callback sometimes, but mainly Components are doing so)
> >
> > Sure, it is not a big redesign to make both the Component and the
> Behavior
> > to handle callback, but I would like to be sure it fit Wicket's
> philosophy.
> >
> > Ernesto, thanks for your input. I would like other inputs on that subject
> > before changing the way the API is designed.
> >
> >
> As Martin already pointed out Behavior approach is more flexible and
> reusable... This approach is used all over wicket core. E.g.
>
> public AjaxCheckBox(final String id)
> {
> this(id, null);
> }
>
> public AjaxCheckBox(final String id, final IModel model)
> {
> super(id, model);
>
> setOutputMarkupId(true);
>
> add(new AjaxFormComponentUpdatingBehavior("click")
> {
> private static final long serialVersionUID = 1L;
>
> @Override
> protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
> {
> super.updateAjaxAttributes(attributes);
> AjaxCheckBox.this.updateAjaxAttributes(attributes);
> }
>
> @Override
> protected void onUpdate(AjaxRequestTarget target)
> {
> AjaxCheckBox.this.onUpdate(target);
> }
> });
> }
>
> protected void updateAjaxAttributes(final AjaxRequestAttributes attributes)
> {
> }
> protected abstract void onUpdate(AjaxRequestTarget target);
>
>
> In your case I would use something like
>
> add(new ResizableBehavior().addEndResizeListener( new IResiseListener() {
>
>  public void onResize(AjaxRequestTarget targe) {
>  }
> }));
>
> This way listening to resize is just a decorator you added to resize
> behavior... The JAVAScrip and server side hooks to process resize will only
> be added if you register a listener.
>
> Having  this behavior implementing ResizablePanel can be left to the
> users... or just be an example on your page
>
> By the way nice demo app! We lack something like that for wiquery! I have
> tried to roll out some demo for some wiquery extensions here
>
> http://antiliasoft.com/wiquery-plugins/
>
> But never got to include core UI componets.
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ 
>


Re: JQuery - best practice

2013-01-29 Thread Ernesto Reinaldo Barreiro
Hi,

On Tue, Jan 29, 2013 at 10:26 AM, Sebastien  wrote:

> Hi Ernesto, Hi Martin,
>
> > IMHO, it would make more sense to have that feature as a behavior instead
> of a panel... that way you are not forcing an inheritance
> For this point, I was not sure whether to make a WebMarkupContainer or a
> Panel that, you are true, force the inheritance.
>
> But actually the main discussion here is... Is it the role of a Behavior to
> handle callbacks or it is the role of a Wicket component to handle these,
> or both.
> I thought about this at the beginning of the project. I wanted to have a
> component oriented API, as Wicket is, and to be the closest as possible in
> term of phylosophy and coding pratice. My conclusion was that, but maybe am
> I wrong, that it is the responsibility of the Component to handle
> callbacks, not the Behavior. (but in another hand, Wicket's Behavior are
> exposing callback sometimes, but mainly Components are doing so)
>
> Sure, it is not a big redesign to make both the Component and the Behavior
> to handle callback, but I would like to be sure it fit Wicket's philosophy.
>
> Ernesto, thanks for your input. I would like other inputs on that subject
> before changing the way the API is designed.
>
>
As Martin already pointed out Behavior approach is more flexible and
reusable... This approach is used all over wicket core. E.g.

public AjaxCheckBox(final String id)
{
this(id, null);
}

public AjaxCheckBox(final String id, final IModel model)
{
super(id, model);

setOutputMarkupId(true);

add(new AjaxFormComponentUpdatingBehavior("click")
{
private static final long serialVersionUID = 1L;

@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
{
super.updateAjaxAttributes(attributes);
AjaxCheckBox.this.updateAjaxAttributes(attributes);
}

@Override
protected void onUpdate(AjaxRequestTarget target)
{
AjaxCheckBox.this.onUpdate(target);
}
});
}

protected void updateAjaxAttributes(final AjaxRequestAttributes attributes)
{
}
protected abstract void onUpdate(AjaxRequestTarget target);


In your case I would use something like

add(new ResizableBehavior().addEndResizeListener( new IResiseListener() {

 public void onResize(AjaxRequestTarget targe) {
 }
}));

This way listening to resize is just a decorator you added to resize
behavior... The JAVAScrip and server side hooks to process resize will only
be added if you register a listener.

Having  this behavior implementing ResizablePanel can be left to the
users... or just be an example on your page

By the way nice demo app! We lack something like that for wiquery! I have
tried to roll out some demo for some wiquery extensions here

http://antiliasoft.com/wiquery-plugins/

But never got to include core UI componets.

-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Re: JQuery - best practice

2013-01-29 Thread Martin Grigorov
Hi Sebastien,

I think the more flexible way is to have the callbacks in the behavior:

class ResizeableBehavior extends JQueryAjaxBehavior {

   protected void onAjax(AjaxRequestTarget target) {
   int top, left, width, height = ...; // use the request parameters to
extract the values
  onResize(target, top, left, width, height)
   }

   protected /*abstract*/ void onResize(AjaxRequestTarget target, int top,
int left, int width, int height) {}
}

This way any component can make use of it:

class MyComponent extends AnyOtherComponent {

  add(new ReziseBehavior() {
   @Override protected void onResize(...) {
  MyComponent.this.onResize(...)
   }
  })

   protected void onResize(AjaxRequestTarget target, int top, int left, int
width, int height) {}
}



On Tue, Jan 29, 2013 at 10:26 AM, Sebastien  wrote:

> Hi Ernesto, Hi Martin,
>
> > IMHO, it would make more sense to have that feature as a behavior instead
> of a panel... that way you are not forcing an inheritance
> For this point, I was not sure whether to make a WebMarkupContainer or a
> Panel that, you are true, force the inheritance.
>
> But actually the main discussion here is... Is it the role of a Behavior to
> handle callbacks or it is the role of a Wicket component to handle these,
> or both.
> I thought about this at the beginning of the project. I wanted to have a
> component oriented API, as Wicket is, and to be the closest as possible in
> term of phylosophy and coding pratice. My conclusion was that, but maybe am
> I wrong, that it is the responsibility of the Component to handle
> callbacks, not the Behavior. (but in another hand, Wicket's Behavior are
> exposing callback sometimes, but mainly Components are doing so)
>
> Sure, it is not a big redesign to make both the Component and the Behavior
> to handle callback, but I would like to be sure it fit Wicket's philosophy.
>
> Ernesto, thanks for your input. I would like other inputs on that subject
> before changing the way the API is designed.
>
> Best regards,
> Sebastien.
>
> On Tue, Jan 29, 2013 at 8:09 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > HI
> >
> > On Tue, Jan 29, 2013 at 8:05 AM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > On Tue, Jan 29, 2013 at 7:55 AM, Martin Grigorov  > >wrote:
> > >
> > >> On Tue, Jan 29, 2013 at 7:31 AM, Ernesto Reinaldo Barreiro <
> > >> reier...@gmail.com> wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > On Tue, Jan 29, 2013 at 12:38 AM, Sebastien 
> wrote:
> > >> >
> > >> > > Hi Pieter,
> > >> > >
> > >> > > I added the ResizablePanel component and deployed the snapshot
> > release
> > >> > > (wicket-jquery-ui-core-6.2.1-SNAPSHOT)
> > >> > >
> > >> > > You may find how it works on the demo site:
> > >> > >
> http://www.7thweb.net/wicket-jquery-ui/resizable/ResizablePanelPage
> > >> > >
> > >> > >
> > >> > IMHO, it would make more sense to have that feature as a behavior
> > >> instead
> > >> > of a panel... that way you are not forcing an inheritance. On
> wiquery
> > >> this
> > >> > is done as an "adapter" that is passed to a behavior.
> > >> >
> > >> >
> > >> There is a behavior is as well:
> > >> http://www.7thweb.net/wicket-jquery-ui/resizable/DefaultResizablePage
> > >>
> > >
> >
> > does seem ---> DOES NOT SEEM.  below... mornings:-()
> >
> >
> > > Yes I have looked at the behavior example as well... but behavior does
> > >> seem to support (at least at the example) to plug in anything to make
> it
> > >> listen to resize call backs. Maybe it does and it isn't shown at the
> > >> code...
> > >>
> > >
> > > Well my point is that it makes more sense to have this as "an adapter"
> > > added to a behavior than having a panel. E.g. You a have a data table
> > that
> > > you want to make resizable and want to remember new sizes at server
> > side...
> > > Panel won't help you there.
> > >
> > > >
> > >> >
> > >> > > I hope it will suit your use case, do not hesitate to come back to
> > me
> > >> if
> > >> > > you have any questions...
> > >> > >
> > >> > > Best regards,
> > >> > > Sebastien.
> > >> > >
> > >> > > On Mon, Jan 28, 2013 at 1:19 PM, Sebastien 
> > wrote:
> > >> > >
> > >> > > > Hi Pieter, hi Martin,
> > >> > > >
> > >> > > > As you are using wicket 6 and wicket-jquery-ui 6, there is no
> > >> version
> > >> > > > conflict because wicket-jquery-ui relies on wicket's embedded
> > jquery
> > >> > > core,
> > >> > > > so there is only one reference of jquery-js
> > >> > > >
> > >> > > > But a problem may arise:
> > >> > > > - if you are youself using a version of jquery core javascript,
> > for
> > >> > other
> > >> > > > needs.
> > >> > > > - if you are using severals jquery ui integrations. The conflict
> > may
> > >> > > > occurs with jquery-ui javascript library (probably not with the
> > >> jquery
> > >> > > > core), you have to provide you own jquery-ui JSRR, as Martin
> > >> mentioned,
> > >> > > and
> > >> > > > remove these used by the integrations. Cau

Re: JQuery - best practice

2013-01-29 Thread Sebastien
Hi Ernesto, Hi Martin,

> IMHO, it would make more sense to have that feature as a behavior instead
of a panel... that way you are not forcing an inheritance
For this point, I was not sure whether to make a WebMarkupContainer or a
Panel that, you are true, force the inheritance.

But actually the main discussion here is... Is it the role of a Behavior to
handle callbacks or it is the role of a Wicket component to handle these,
or both.
I thought about this at the beginning of the project. I wanted to have a
component oriented API, as Wicket is, and to be the closest as possible in
term of phylosophy and coding pratice. My conclusion was that, but maybe am
I wrong, that it is the responsibility of the Component to handle
callbacks, not the Behavior. (but in another hand, Wicket's Behavior are
exposing callback sometimes, but mainly Components are doing so)

Sure, it is not a big redesign to make both the Component and the Behavior
to handle callback, but I would like to be sure it fit Wicket's philosophy.

Ernesto, thanks for your input. I would like other inputs on that subject
before changing the way the API is designed.

Best regards,
Sebastien.

On Tue, Jan 29, 2013 at 8:09 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> HI
>
> On Tue, Jan 29, 2013 at 8:05 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Hi,
> >
> > On Tue, Jan 29, 2013 at 7:55 AM, Martin Grigorov  >wrote:
> >
> >> On Tue, Jan 29, 2013 at 7:31 AM, Ernesto Reinaldo Barreiro <
> >> reier...@gmail.com> wrote:
> >>
> >> > Hi,
> >> >
> >> > On Tue, Jan 29, 2013 at 12:38 AM, Sebastien  wrote:
> >> >
> >> > > Hi Pieter,
> >> > >
> >> > > I added the ResizablePanel component and deployed the snapshot
> release
> >> > > (wicket-jquery-ui-core-6.2.1-SNAPSHOT)
> >> > >
> >> > > You may find how it works on the demo site:
> >> > > http://www.7thweb.net/wicket-jquery-ui/resizable/ResizablePanelPage
> >> > >
> >> > >
> >> > IMHO, it would make more sense to have that feature as a behavior
> >> instead
> >> > of a panel... that way you are not forcing an inheritance. On wiquery
> >> this
> >> > is done as an "adapter" that is passed to a behavior.
> >> >
> >> >
> >> There is a behavior is as well:
> >> http://www.7thweb.net/wicket-jquery-ui/resizable/DefaultResizablePage
> >>
> >
>
> does seem ---> DOES NOT SEEM.  below... mornings:-()
>
>
> > Yes I have looked at the behavior example as well... but behavior does
> >> seem to support (at least at the example) to plug in anything to make it
> >> listen to resize call backs. Maybe it does and it isn't shown at the
> >> code...
> >>
> >
> > Well my point is that it makes more sense to have this as "an adapter"
> > added to a behavior than having a panel. E.g. You a have a data table
> that
> > you want to make resizable and want to remember new sizes at server
> side...
> > Panel won't help you there.
> >
> > >
> >> >
> >> > > I hope it will suit your use case, do not hesitate to come back to
> me
> >> if
> >> > > you have any questions...
> >> > >
> >> > > Best regards,
> >> > > Sebastien.
> >> > >
> >> > > On Mon, Jan 28, 2013 at 1:19 PM, Sebastien 
> wrote:
> >> > >
> >> > > > Hi Pieter, hi Martin,
> >> > > >
> >> > > > As you are using wicket 6 and wicket-jquery-ui 6, there is no
> >> version
> >> > > > conflict because wicket-jquery-ui relies on wicket's embedded
> jquery
> >> > > core,
> >> > > > so there is only one reference of jquery-js
> >> > > >
> >> > > > But a problem may arise:
> >> > > > - if you are youself using a version of jquery core javascript,
> for
> >> > other
> >> > > > needs.
> >> > > > - if you are using severals jquery ui integrations. The conflict
> may
> >> > > > occurs with jquery-ui javascript library (probably not with the
> >> jquery
> >> > > > core), you have to provide you own jquery-ui JSRR, as Martin
> >> mentioned,
> >> > > and
> >> > > > remove these used by the integrations. Caution, if you prefer to
> >> remove
> >> > > the
> >> > > > JSRR of only one integration (using the code I provide earlier)
> and
> >> let
> >> > > the
> >> > > > one of another integration, you will get into trouble if you use a
> >> > > > component of the first integration but none of the second
> >> integration
> >> > on
> >> > > a
> >> > > > same page, because no jquery-ui javascript library will be
> rendered
> >> in
> >> > > that
> >> > > > case...
> >> > > >
> >> > > > Best regards,
> >> > > > Sebastien.
> >> > > >
> >> > > >
> >> > > > On Mon, Jan 28, 2013 at 12:58 PM, Martin Grigorov <
> >> > mgrigo...@apache.org
> >> > > >wrote:
> >> > > >
> >> > > >> Hi Pieter,
> >> > > >>
> >> > > >> Both Wicket and the libraries which integrate with jQuery UI
> >> provide
> >> > > ways
> >> > > >> to setup custom JavaScriptResourceReference (JSRR) that loads
> >> > jquery.js.
> >> > > >> The easiest way is to tell the jquery-ui integration library to
> not
> >> > > >> contribute its JSRR at all. Only Wicket will contribute it.
> >> > > >>
> >> > > >> If fo

Re: JQuery - best practice

2013-01-28 Thread Ernesto Reinaldo Barreiro
HI

On Tue, Jan 29, 2013 at 8:05 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> On Tue, Jan 29, 2013 at 7:55 AM, Martin Grigorov wrote:
>
>> On Tue, Jan 29, 2013 at 7:31 AM, Ernesto Reinaldo Barreiro <
>> reier...@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > On Tue, Jan 29, 2013 at 12:38 AM, Sebastien  wrote:
>> >
>> > > Hi Pieter,
>> > >
>> > > I added the ResizablePanel component and deployed the snapshot release
>> > > (wicket-jquery-ui-core-6.2.1-SNAPSHOT)
>> > >
>> > > You may find how it works on the demo site:
>> > > http://www.7thweb.net/wicket-jquery-ui/resizable/ResizablePanelPage
>> > >
>> > >
>> > IMHO, it would make more sense to have that feature as a behavior
>> instead
>> > of a panel... that way you are not forcing an inheritance. On wiquery
>> this
>> > is done as an "adapter" that is passed to a behavior.
>> >
>> >
>> There is a behavior is as well:
>> http://www.7thweb.net/wicket-jquery-ui/resizable/DefaultResizablePage
>>
>

does seem ---> DOES NOT SEEM.  below... mornings:-()


> Yes I have looked at the behavior example as well... but behavior does
>> seem to support (at least at the example) to plug in anything to make it
>> listen to resize call backs. Maybe it does and it isn't shown at the
>> code...
>>
>
> Well my point is that it makes more sense to have this as "an adapter"
> added to a behavior than having a panel. E.g. You a have a data table that
> you want to make resizable and want to remember new sizes at server side...
> Panel won't help you there.
>
> >
>> >
>> > > I hope it will suit your use case, do not hesitate to come back to me
>> if
>> > > you have any questions...
>> > >
>> > > Best regards,
>> > > Sebastien.
>> > >
>> > > On Mon, Jan 28, 2013 at 1:19 PM, Sebastien  wrote:
>> > >
>> > > > Hi Pieter, hi Martin,
>> > > >
>> > > > As you are using wicket 6 and wicket-jquery-ui 6, there is no
>> version
>> > > > conflict because wicket-jquery-ui relies on wicket's embedded jquery
>> > > core,
>> > > > so there is only one reference of jquery-js
>> > > >
>> > > > But a problem may arise:
>> > > > - if you are youself using a version of jquery core javascript, for
>> > other
>> > > > needs.
>> > > > - if you are using severals jquery ui integrations. The conflict may
>> > > > occurs with jquery-ui javascript library (probably not with the
>> jquery
>> > > > core), you have to provide you own jquery-ui JSRR, as Martin
>> mentioned,
>> > > and
>> > > > remove these used by the integrations. Caution, if you prefer to
>> remove
>> > > the
>> > > > JSRR of only one integration (using the code I provide earlier) and
>> let
>> > > the
>> > > > one of another integration, you will get into trouble if you use a
>> > > > component of the first integration but none of the second
>> integration
>> > on
>> > > a
>> > > > same page, because no jquery-ui javascript library will be rendered
>> in
>> > > that
>> > > > case...
>> > > >
>> > > > Best regards,
>> > > > Sebastien.
>> > > >
>> > > >
>> > > > On Mon, Jan 28, 2013 at 12:58 PM, Martin Grigorov <
>> > mgrigo...@apache.org
>> > > >wrote:
>> > > >
>> > > >> Hi Pieter,
>> > > >>
>> > > >> Both Wicket and the libraries which integrate with jQuery UI
>> provide
>> > > ways
>> > > >> to setup custom JavaScriptResourceReference (JSRR) that loads
>> > jquery.js.
>> > > >> The easiest way is to tell the jquery-ui integration library to not
>> > > >> contribute its JSRR at all. Only Wicket will contribute it.
>> > > >>
>> > > >> If for some reason you need different version of jquery.js than the
>> > one
>> > > >> that comes with Wicket itself then you can use the APIs explained
>> by
>> > > >> Sebastien to use your custom JSRR.
>> > > >> Wicket is smart enough to filter several contributions of the same
>> > > >> resource
>> > > >> and actually render it just once.
>> > > >>
>> > > >>
>> > > >> On Mon, Jan 28, 2013 at 1:35 PM, Pieter Claassen <
>> pie...@musmato.com>
>> > > >> wrote:
>> > > >>
>> > > >> > Sebastien,
>> > > >> >
>> > > >> > So by including the wicket-jquery-ui (if I follow the
>> installation
>> > > >> > instructions), does that not conflict with the jquery core
>> library?
>> > > >> >
>> > > >> > Regards,
>> > > >> > Pieter
>> > > >> >
>> > > >> > On Mon, Jan 28, 2013 at 11:38 AM, Sebastien 
>> > wrote:
>> > > >> >
>> > > >> > > Hi Pieter,
>> > > >> > >
>> > > >> > > Yes, wicket is embedding jquery core library. If you include
>> > another
>> > > >> > jquery
>> > > >> > > core well yes, you will probably get into troubles.
>> > > >> > >
>> > > >> > > If you really want to do that, you can specify your own jQuery
>> > core
>> > > >> > library
>> > > >> > > version, in Wicket Application#init():
>> > > >> > >
>> > > >> > > IJavaScriptLibrarySettings settings =
>> > > getJavaScriptLibrarySettings();
>> > > >> > > settings.setJQueryReference(new MyJQueryReference());
>> > > >> > >
>> > > >> > > About conflicts with existing Wicket / jQuery UI
>> implementation,
>> > > >> that's
>> > > >> > the
>>

Re: JQuery - best practice

2013-01-28 Thread Ernesto Reinaldo Barreiro
Hi,

On Tue, Jan 29, 2013 at 7:55 AM, Martin Grigorov wrote:

> On Tue, Jan 29, 2013 at 7:31 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Hi,
> >
> > On Tue, Jan 29, 2013 at 12:38 AM, Sebastien  wrote:
> >
> > > Hi Pieter,
> > >
> > > I added the ResizablePanel component and deployed the snapshot release
> > > (wicket-jquery-ui-core-6.2.1-SNAPSHOT)
> > >
> > > You may find how it works on the demo site:
> > > http://www.7thweb.net/wicket-jquery-ui/resizable/ResizablePanelPage
> > >
> > >
> > IMHO, it would make more sense to have that feature as a behavior instead
> > of a panel... that way you are not forcing an inheritance. On wiquery
> this
> > is done as an "adapter" that is passed to a behavior.
> >
> >
> There is a behavior is as well:
> http://www.7thweb.net/wicket-jquery-ui/resizable/DefaultResizablePage
>
>
Yes I have looked at the behavior example as well... but behavior does seem
to support (at least at the example) to plug in anything to make it listen
to resize call backs. Maybe it does and it isn't shown at the code...

Well my point is that it makes more sense to have this as "an adapter"
added to a behavior than having a panel. E.g. You a have a data table that
you want to make resizable and want to remember new sizes at server side...
Panel won't help you there.

>
> >
> > > I hope it will suit your use case, do not hesitate to come back to me
> if
> > > you have any questions...
> > >
> > > Best regards,
> > > Sebastien.
> > >
> > > On Mon, Jan 28, 2013 at 1:19 PM, Sebastien  wrote:
> > >
> > > > Hi Pieter, hi Martin,
> > > >
> > > > As you are using wicket 6 and wicket-jquery-ui 6, there is no version
> > > > conflict because wicket-jquery-ui relies on wicket's embedded jquery
> > > core,
> > > > so there is only one reference of jquery-js
> > > >
> > > > But a problem may arise:
> > > > - if you are youself using a version of jquery core javascript, for
> > other
> > > > needs.
> > > > - if you are using severals jquery ui integrations. The conflict may
> > > > occurs with jquery-ui javascript library (probably not with the
> jquery
> > > > core), you have to provide you own jquery-ui JSRR, as Martin
> mentioned,
> > > and
> > > > remove these used by the integrations. Caution, if you prefer to
> remove
> > > the
> > > > JSRR of only one integration (using the code I provide earlier) and
> let
> > > the
> > > > one of another integration, you will get into trouble if you use a
> > > > component of the first integration but none of the second integration
> > on
> > > a
> > > > same page, because no jquery-ui javascript library will be rendered
> in
> > > that
> > > > case...
> > > >
> > > > Best regards,
> > > > Sebastien.
> > > >
> > > >
> > > > On Mon, Jan 28, 2013 at 12:58 PM, Martin Grigorov <
> > mgrigo...@apache.org
> > > >wrote:
> > > >
> > > >> Hi Pieter,
> > > >>
> > > >> Both Wicket and the libraries which integrate with jQuery UI provide
> > > ways
> > > >> to setup custom JavaScriptResourceReference (JSRR) that loads
> > jquery.js.
> > > >> The easiest way is to tell the jquery-ui integration library to not
> > > >> contribute its JSRR at all. Only Wicket will contribute it.
> > > >>
> > > >> If for some reason you need different version of jquery.js than the
> > one
> > > >> that comes with Wicket itself then you can use the APIs explained by
> > > >> Sebastien to use your custom JSRR.
> > > >> Wicket is smart enough to filter several contributions of the same
> > > >> resource
> > > >> and actually render it just once.
> > > >>
> > > >>
> > > >> On Mon, Jan 28, 2013 at 1:35 PM, Pieter Claassen <
> pie...@musmato.com>
> > > >> wrote:
> > > >>
> > > >> > Sebastien,
> > > >> >
> > > >> > So by including the wicket-jquery-ui (if I follow the installation
> > > >> > instructions), does that not conflict with the jquery core
> library?
> > > >> >
> > > >> > Regards,
> > > >> > Pieter
> > > >> >
> > > >> > On Mon, Jan 28, 2013 at 11:38 AM, Sebastien 
> > wrote:
> > > >> >
> > > >> > > Hi Pieter,
> > > >> > >
> > > >> > > Yes, wicket is embedding jquery core library. If you include
> > another
> > > >> > jquery
> > > >> > > core well yes, you will probably get into troubles.
> > > >> > >
> > > >> > > If you really want to do that, you can specify your own jQuery
> > core
> > > >> > library
> > > >> > > version, in Wicket Application#init():
> > > >> > >
> > > >> > > IJavaScriptLibrarySettings settings =
> > > getJavaScriptLibrarySettings();
> > > >> > > settings.setJQueryReference(new MyJQueryReference());
> > > >> > >
> > > >> > > About conflicts with existing Wicket / jQuery UI implementation,
> > > >> that's
> > > >> > the
> > > >> > > same, only one jQuery UI library version should be loaded at a
> > time.
> > > >> > > In wicket-jquery-ui, you can change or remove the shipped
> library
> > in
> > > >> the
> > > >> > > same way:
> > > >> > >
> > > >> > > IJQueryLibrarySettings settings = new JQueryLibrarySettings();
> > > >> > >
> > > >> > > settings.setJQu

Re: JQuery - best practice

2013-01-28 Thread Martin Grigorov
On Tue, Jan 29, 2013 at 7:31 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> On Tue, Jan 29, 2013 at 12:38 AM, Sebastien  wrote:
>
> > Hi Pieter,
> >
> > I added the ResizablePanel component and deployed the snapshot release
> > (wicket-jquery-ui-core-6.2.1-SNAPSHOT)
> >
> > You may find how it works on the demo site:
> > http://www.7thweb.net/wicket-jquery-ui/resizable/ResizablePanelPage
> >
> >
> IMHO, it would make more sense to have that feature as a behavior instead
> of a panel... that way you are not forcing an inheritance. On wiquery this
> is done as an "adapter" that is passed to a behavior.
>
>
There is a behavior is as well:
http://www.7thweb.net/wicket-jquery-ui/resizable/DefaultResizablePage


>
>
> > I hope it will suit your use case, do not hesitate to come back to me if
> > you have any questions...
> >
> > Best regards,
> > Sebastien.
> >
> > On Mon, Jan 28, 2013 at 1:19 PM, Sebastien  wrote:
> >
> > > Hi Pieter, hi Martin,
> > >
> > > As you are using wicket 6 and wicket-jquery-ui 6, there is no version
> > > conflict because wicket-jquery-ui relies on wicket's embedded jquery
> > core,
> > > so there is only one reference of jquery-js
> > >
> > > But a problem may arise:
> > > - if you are youself using a version of jquery core javascript, for
> other
> > > needs.
> > > - if you are using severals jquery ui integrations. The conflict may
> > > occurs with jquery-ui javascript library (probably not with the jquery
> > > core), you have to provide you own jquery-ui JSRR, as Martin mentioned,
> > and
> > > remove these used by the integrations. Caution, if you prefer to remove
> > the
> > > JSRR of only one integration (using the code I provide earlier) and let
> > the
> > > one of another integration, you will get into trouble if you use a
> > > component of the first integration but none of the second integration
> on
> > a
> > > same page, because no jquery-ui javascript library will be rendered in
> > that
> > > case...
> > >
> > > Best regards,
> > > Sebastien.
> > >
> > >
> > > On Mon, Jan 28, 2013 at 12:58 PM, Martin Grigorov <
> mgrigo...@apache.org
> > >wrote:
> > >
> > >> Hi Pieter,
> > >>
> > >> Both Wicket and the libraries which integrate with jQuery UI provide
> > ways
> > >> to setup custom JavaScriptResourceReference (JSRR) that loads
> jquery.js.
> > >> The easiest way is to tell the jquery-ui integration library to not
> > >> contribute its JSRR at all. Only Wicket will contribute it.
> > >>
> > >> If for some reason you need different version of jquery.js than the
> one
> > >> that comes with Wicket itself then you can use the APIs explained by
> > >> Sebastien to use your custom JSRR.
> > >> Wicket is smart enough to filter several contributions of the same
> > >> resource
> > >> and actually render it just once.
> > >>
> > >>
> > >> On Mon, Jan 28, 2013 at 1:35 PM, Pieter Claassen 
> > >> wrote:
> > >>
> > >> > Sebastien,
> > >> >
> > >> > So by including the wicket-jquery-ui (if I follow the installation
> > >> > instructions), does that not conflict with the jquery core library?
> > >> >
> > >> > Regards,
> > >> > Pieter
> > >> >
> > >> > On Mon, Jan 28, 2013 at 11:38 AM, Sebastien 
> wrote:
> > >> >
> > >> > > Hi Pieter,
> > >> > >
> > >> > > Yes, wicket is embedding jquery core library. If you include
> another
> > >> > jquery
> > >> > > core well yes, you will probably get into troubles.
> > >> > >
> > >> > > If you really want to do that, you can specify your own jQuery
> core
> > >> > library
> > >> > > version, in Wicket Application#init():
> > >> > >
> > >> > > IJavaScriptLibrarySettings settings =
> > getJavaScriptLibrarySettings();
> > >> > > settings.setJQueryReference(new MyJQueryReference());
> > >> > >
> > >> > > About conflicts with existing Wicket / jQuery UI implementation,
> > >> that's
> > >> > the
> > >> > > same, only one jQuery UI library version should be loaded at a
> time.
> > >> > > In wicket-jquery-ui, you can change or remove the shipped library
> in
> > >> the
> > >> > > same way:
> > >> > >
> > >> > > IJQueryLibrarySettings settings = new JQueryLibrarySettings();
> > >> > >
> > >> > > settings.setJQueryReference(new MyJQueryReference()); // (jquery
> > core,
> > >> > same
> > >> > > code as above)
> > >> > > settings.setJQueryUIReference(new
> > >> > > JQueryPluginResourceReference(MyApplication.class,
> > >> > > "jquery-ui-x.x.x.min.js")); //new jquery ui version
> > >> > > or
> > >> > > settings.setJQueryUIReference(null) //removes jquery ui library
> > >> > >
> > >> > > this.setJavaScriptLibrarySettings(settings);
> > >> > >
> > >> > > Hope this helps,
> > >> > > Sebastien.
> > >> > >
> > >> > > On Mon, Jan 28, 2013 at 10:31 AM, Pieter Claassen <
> > pie...@musmato.com
> > >> > > >wrote:
> > >> > >
> > >> > > > Hi Sebastian,
> > >> > > >
> > >> > > > Thanks. Wicket 6.5 is what I am using.
> > >> > > >
> > >> > > > As to your question:
> > >> > > >
> > >> > > > I am referring to the fact that Wicket documentation m

Re: JQuery - best practice

2013-01-28 Thread Ernesto Reinaldo Barreiro
Hi,

On Tue, Jan 29, 2013 at 12:38 AM, Sebastien  wrote:

> Hi Pieter,
>
> I added the ResizablePanel component and deployed the snapshot release
> (wicket-jquery-ui-core-6.2.1-SNAPSHOT)
>
> You may find how it works on the demo site:
> http://www.7thweb.net/wicket-jquery-ui/resizable/ResizablePanelPage
>
>
IMHO, it would make more sense to have that feature as a behavior instead
of a panel... that way you are not forcing an inheritance. On wiquery this
is done as an "adapter" that is passed to a behavior.



> I hope it will suit your use case, do not hesitate to come back to me if
> you have any questions...
>
> Best regards,
> Sebastien.
>
> On Mon, Jan 28, 2013 at 1:19 PM, Sebastien  wrote:
>
> > Hi Pieter, hi Martin,
> >
> > As you are using wicket 6 and wicket-jquery-ui 6, there is no version
> > conflict because wicket-jquery-ui relies on wicket's embedded jquery
> core,
> > so there is only one reference of jquery-js
> >
> > But a problem may arise:
> > - if you are youself using a version of jquery core javascript, for other
> > needs.
> > - if you are using severals jquery ui integrations. The conflict may
> > occurs with jquery-ui javascript library (probably not with the jquery
> > core), you have to provide you own jquery-ui JSRR, as Martin mentioned,
> and
> > remove these used by the integrations. Caution, if you prefer to remove
> the
> > JSRR of only one integration (using the code I provide earlier) and let
> the
> > one of another integration, you will get into trouble if you use a
> > component of the first integration but none of the second integration on
> a
> > same page, because no jquery-ui javascript library will be rendered in
> that
> > case...
> >
> > Best regards,
> > Sebastien.
> >
> >
> > On Mon, Jan 28, 2013 at 12:58 PM, Martin Grigorov  >wrote:
> >
> >> Hi Pieter,
> >>
> >> Both Wicket and the libraries which integrate with jQuery UI provide
> ways
> >> to setup custom JavaScriptResourceReference (JSRR) that loads jquery.js.
> >> The easiest way is to tell the jquery-ui integration library to not
> >> contribute its JSRR at all. Only Wicket will contribute it.
> >>
> >> If for some reason you need different version of jquery.js than the one
> >> that comes with Wicket itself then you can use the APIs explained by
> >> Sebastien to use your custom JSRR.
> >> Wicket is smart enough to filter several contributions of the same
> >> resource
> >> and actually render it just once.
> >>
> >>
> >> On Mon, Jan 28, 2013 at 1:35 PM, Pieter Claassen 
> >> wrote:
> >>
> >> > Sebastien,
> >> >
> >> > So by including the wicket-jquery-ui (if I follow the installation
> >> > instructions), does that not conflict with the jquery core library?
> >> >
> >> > Regards,
> >> > Pieter
> >> >
> >> > On Mon, Jan 28, 2013 at 11:38 AM, Sebastien  wrote:
> >> >
> >> > > Hi Pieter,
> >> > >
> >> > > Yes, wicket is embedding jquery core library. If you include another
> >> > jquery
> >> > > core well yes, you will probably get into troubles.
> >> > >
> >> > > If you really want to do that, you can specify your own jQuery core
> >> > library
> >> > > version, in Wicket Application#init():
> >> > >
> >> > > IJavaScriptLibrarySettings settings =
> getJavaScriptLibrarySettings();
> >> > > settings.setJQueryReference(new MyJQueryReference());
> >> > >
> >> > > About conflicts with existing Wicket / jQuery UI implementation,
> >> that's
> >> > the
> >> > > same, only one jQuery UI library version should be loaded at a time.
> >> > > In wicket-jquery-ui, you can change or remove the shipped library in
> >> the
> >> > > same way:
> >> > >
> >> > > IJQueryLibrarySettings settings = new JQueryLibrarySettings();
> >> > >
> >> > > settings.setJQueryReference(new MyJQueryReference()); // (jquery
> core,
> >> > same
> >> > > code as above)
> >> > > settings.setJQueryUIReference(new
> >> > > JQueryPluginResourceReference(MyApplication.class,
> >> > > "jquery-ui-x.x.x.min.js")); //new jquery ui version
> >> > > or
> >> > > settings.setJQueryUIReference(null) //removes jquery ui library
> >> > >
> >> > > this.setJavaScriptLibrarySettings(settings);
> >> > >
> >> > > Hope this helps,
> >> > > Sebastien.
> >> > >
> >> > > On Mon, Jan 28, 2013 at 10:31 AM, Pieter Claassen <
> pie...@musmato.com
> >> > > >wrote:
> >> > >
> >> > > > Hi Sebastian,
> >> > > >
> >> > > > Thanks. Wicket 6.5 is what I am using.
> >> > > >
> >> > > > As to your question:
> >> > > >
> >> > > > I am referring to the fact that Wicket documentation mentioned
> that
> >> > > JQuery
> >> > > > has been selected for the internal AJax implementation in Wicket.
> I
> >> > take
> >> > > > that means that there is a JQuery JS library that ships with
> >> > Wicket-core
> >> > > > and also wicket code that makes use of that library. If I now
> >> include
> >> > my
> >> > > > own JQuery library and CSS, is there not a risk that both these
> >> > > libraries,
> >> > > > with mostly the same functions but potentially version skew, could
> >> be
> >> > > > loaded

Re: JQuery - best practice

2013-01-28 Thread Sebastien
Hi Pieter,

I added the ResizablePanel component and deployed the snapshot release
(wicket-jquery-ui-core-6.2.1-SNAPSHOT)

You may find how it works on the demo site:
http://www.7thweb.net/wicket-jquery-ui/resizable/ResizablePanelPage

I hope it will suit your use case, do not hesitate to come back to me if
you have any questions...

Best regards,
Sebastien.

On Mon, Jan 28, 2013 at 1:19 PM, Sebastien  wrote:

> Hi Pieter, hi Martin,
>
> As you are using wicket 6 and wicket-jquery-ui 6, there is no version
> conflict because wicket-jquery-ui relies on wicket's embedded jquery core,
> so there is only one reference of jquery-js
>
> But a problem may arise:
> - if you are youself using a version of jquery core javascript, for other
> needs.
> - if you are using severals jquery ui integrations. The conflict may
> occurs with jquery-ui javascript library (probably not with the jquery
> core), you have to provide you own jquery-ui JSRR, as Martin mentioned, and
> remove these used by the integrations. Caution, if you prefer to remove the
> JSRR of only one integration (using the code I provide earlier) and let the
> one of another integration, you will get into trouble if you use a
> component of the first integration but none of the second integration on a
> same page, because no jquery-ui javascript library will be rendered in that
> case...
>
> Best regards,
> Sebastien.
>
>
> On Mon, Jan 28, 2013 at 12:58 PM, Martin Grigorov wrote:
>
>> Hi Pieter,
>>
>> Both Wicket and the libraries which integrate with jQuery UI provide ways
>> to setup custom JavaScriptResourceReference (JSRR) that loads jquery.js.
>> The easiest way is to tell the jquery-ui integration library to not
>> contribute its JSRR at all. Only Wicket will contribute it.
>>
>> If for some reason you need different version of jquery.js than the one
>> that comes with Wicket itself then you can use the APIs explained by
>> Sebastien to use your custom JSRR.
>> Wicket is smart enough to filter several contributions of the same
>> resource
>> and actually render it just once.
>>
>>
>> On Mon, Jan 28, 2013 at 1:35 PM, Pieter Claassen 
>> wrote:
>>
>> > Sebastien,
>> >
>> > So by including the wicket-jquery-ui (if I follow the installation
>> > instructions), does that not conflict with the jquery core library?
>> >
>> > Regards,
>> > Pieter
>> >
>> > On Mon, Jan 28, 2013 at 11:38 AM, Sebastien  wrote:
>> >
>> > > Hi Pieter,
>> > >
>> > > Yes, wicket is embedding jquery core library. If you include another
>> > jquery
>> > > core well yes, you will probably get into troubles.
>> > >
>> > > If you really want to do that, you can specify your own jQuery core
>> > library
>> > > version, in Wicket Application#init():
>> > >
>> > > IJavaScriptLibrarySettings settings = getJavaScriptLibrarySettings();
>> > > settings.setJQueryReference(new MyJQueryReference());
>> > >
>> > > About conflicts with existing Wicket / jQuery UI implementation,
>> that's
>> > the
>> > > same, only one jQuery UI library version should be loaded at a time.
>> > > In wicket-jquery-ui, you can change or remove the shipped library in
>> the
>> > > same way:
>> > >
>> > > IJQueryLibrarySettings settings = new JQueryLibrarySettings();
>> > >
>> > > settings.setJQueryReference(new MyJQueryReference()); // (jquery core,
>> > same
>> > > code as above)
>> > > settings.setJQueryUIReference(new
>> > > JQueryPluginResourceReference(MyApplication.class,
>> > > "jquery-ui-x.x.x.min.js")); //new jquery ui version
>> > > or
>> > > settings.setJQueryUIReference(null) //removes jquery ui library
>> > >
>> > > this.setJavaScriptLibrarySettings(settings);
>> > >
>> > > Hope this helps,
>> > > Sebastien.
>> > >
>> > > On Mon, Jan 28, 2013 at 10:31 AM, Pieter Claassen > > > >wrote:
>> > >
>> > > > Hi Sebastian,
>> > > >
>> > > > Thanks. Wicket 6.5 is what I am using.
>> > > >
>> > > > As to your question:
>> > > >
>> > > > I am referring to the fact that Wicket documentation mentioned that
>> > > JQuery
>> > > > has been selected for the internal AJax implementation in Wicket. I
>> > take
>> > > > that means that there is a JQuery JS library that ships with
>> > Wicket-core
>> > > > and also wicket code that makes use of that library. If I now
>> include
>> > my
>> > > > own JQuery library and CSS, is there not a risk that both these
>> > > libraries,
>> > > > with mostly the same functions but potentially version skew, could
>> be
>> > > > loaded by the same page?
>> > > >
>> > > > Also, I note that there are a number wicket-jquery projects out
>> there.
>> > > How
>> > > > do they play together and not trample the internal Wicket
>> > implementation.
>> > > >
>> > > > Regards,
>> > > > Pieter
>> > > >
>> > > >
>> > > >
>> > > > On Mon, Jan 28, 2013 at 10:18 AM, Sebastien 
>> wrote:
>> > > >
>> > > > > Hi Pieter
>> > > > >
>> > > > > I am not sure to undestand your first point. What libraries are
>> you
>> > > > > refering to? Internal wicket's library? A jQuery plugin? Another?
>> > > > >
>> > > > > 

Re: JQuery - best practice

2013-01-28 Thread Sebastien
Hi Pieter, hi Martin,

As you are using wicket 6 and wicket-jquery-ui 6, there is no version
conflict because wicket-jquery-ui relies on wicket's embedded jquery core,
so there is only one reference of jquery-js

But a problem may arise:
- if you are youself using a version of jquery core javascript, for other
needs.
- if you are using severals jquery ui integrations. The conflict may occurs
with jquery-ui javascript library (probably not with the jquery core), you
have to provide you own jquery-ui JSRR, as Martin mentioned, and remove
these used by the integrations. Caution, if you prefer to remove the JSRR
of only one integration (using the code I provide earlier) and let the one
of another integration, you will get into trouble if you use a component of
the first integration but none of the second integration on a same page,
because no jquery-ui javascript library will be rendered in that case...

Best regards,
Sebastien.

On Mon, Jan 28, 2013 at 12:58 PM, Martin Grigorov wrote:

> Hi Pieter,
>
> Both Wicket and the libraries which integrate with jQuery UI provide ways
> to setup custom JavaScriptResourceReference (JSRR) that loads jquery.js.
> The easiest way is to tell the jquery-ui integration library to not
> contribute its JSRR at all. Only Wicket will contribute it.
>
> If for some reason you need different version of jquery.js than the one
> that comes with Wicket itself then you can use the APIs explained by
> Sebastien to use your custom JSRR.
> Wicket is smart enough to filter several contributions of the same resource
> and actually render it just once.
>
>
> On Mon, Jan 28, 2013 at 1:35 PM, Pieter Claassen 
> wrote:
>
> > Sebastien,
> >
> > So by including the wicket-jquery-ui (if I follow the installation
> > instructions), does that not conflict with the jquery core library?
> >
> > Regards,
> > Pieter
> >
> > On Mon, Jan 28, 2013 at 11:38 AM, Sebastien  wrote:
> >
> > > Hi Pieter,
> > >
> > > Yes, wicket is embedding jquery core library. If you include another
> > jquery
> > > core well yes, you will probably get into troubles.
> > >
> > > If you really want to do that, you can specify your own jQuery core
> > library
> > > version, in Wicket Application#init():
> > >
> > > IJavaScriptLibrarySettings settings = getJavaScriptLibrarySettings();
> > > settings.setJQueryReference(new MyJQueryReference());
> > >
> > > About conflicts with existing Wicket / jQuery UI implementation, that's
> > the
> > > same, only one jQuery UI library version should be loaded at a time.
> > > In wicket-jquery-ui, you can change or remove the shipped library in
> the
> > > same way:
> > >
> > > IJQueryLibrarySettings settings = new JQueryLibrarySettings();
> > >
> > > settings.setJQueryReference(new MyJQueryReference()); // (jquery core,
> > same
> > > code as above)
> > > settings.setJQueryUIReference(new
> > > JQueryPluginResourceReference(MyApplication.class,
> > > "jquery-ui-x.x.x.min.js")); //new jquery ui version
> > > or
> > > settings.setJQueryUIReference(null) //removes jquery ui library
> > >
> > > this.setJavaScriptLibrarySettings(settings);
> > >
> > > Hope this helps,
> > > Sebastien.
> > >
> > > On Mon, Jan 28, 2013 at 10:31 AM, Pieter Claassen  > > >wrote:
> > >
> > > > Hi Sebastian,
> > > >
> > > > Thanks. Wicket 6.5 is what I am using.
> > > >
> > > > As to your question:
> > > >
> > > > I am referring to the fact that Wicket documentation mentioned that
> > > JQuery
> > > > has been selected for the internal AJax implementation in Wicket. I
> > take
> > > > that means that there is a JQuery JS library that ships with
> > Wicket-core
> > > > and also wicket code that makes use of that library. If I now include
> > my
> > > > own JQuery library and CSS, is there not a risk that both these
> > > libraries,
> > > > with mostly the same functions but potentially version skew, could be
> > > > loaded by the same page?
> > > >
> > > > Also, I note that there are a number wicket-jquery projects out
> there.
> > > How
> > > > do they play together and not trample the internal Wicket
> > implementation.
> > > >
> > > > Regards,
> > > > Pieter
> > > >
> > > >
> > > >
> > > > On Mon, Jan 28, 2013 at 10:18 AM, Sebastien 
> wrote:
> > > >
> > > > > Hi Pieter
> > > > >
> > > > > I am not sure to undestand your first point. What libraries are you
> > > > > refering to? Internal wicket's library? A jQuery plugin? Another?
> > > > >
> > > > > About your second point, the ResizeBehavior does not currently
> > > implement
> > > > > the 'resize' event (which can retrieve size & position).
> > > > > To stay consistent with the current logic behind wicket-jquery-ui,
> I
> > > will
> > > > > do a ResizePanel which will support such event.
> > > > > That's not a big deal, I will look at this tonight...
> > > > >
> > > > > Are you using Wicket 1.5.x or 6.x?
> > > > >
> > > > > Thanks & best regards,
> > > > > Sebastien.
> > > > >
> > > > > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen <
> pie...@musmato.com
> > >
> 

Re: JQuery - best practice

2013-01-28 Thread Martin Grigorov
Hi Pieter,

Both Wicket and the libraries which integrate with jQuery UI provide ways
to setup custom JavaScriptResourceReference (JSRR) that loads jquery.js.
The easiest way is to tell the jquery-ui integration library to not
contribute its JSRR at all. Only Wicket will contribute it.

If for some reason you need different version of jquery.js than the one
that comes with Wicket itself then you can use the APIs explained by
Sebastien to use your custom JSRR.
Wicket is smart enough to filter several contributions of the same resource
and actually render it just once.


On Mon, Jan 28, 2013 at 1:35 PM, Pieter Claassen  wrote:

> Sebastien,
>
> So by including the wicket-jquery-ui (if I follow the installation
> instructions), does that not conflict with the jquery core library?
>
> Regards,
> Pieter
>
> On Mon, Jan 28, 2013 at 11:38 AM, Sebastien  wrote:
>
> > Hi Pieter,
> >
> > Yes, wicket is embedding jquery core library. If you include another
> jquery
> > core well yes, you will probably get into troubles.
> >
> > If you really want to do that, you can specify your own jQuery core
> library
> > version, in Wicket Application#init():
> >
> > IJavaScriptLibrarySettings settings = getJavaScriptLibrarySettings();
> > settings.setJQueryReference(new MyJQueryReference());
> >
> > About conflicts with existing Wicket / jQuery UI implementation, that's
> the
> > same, only one jQuery UI library version should be loaded at a time.
> > In wicket-jquery-ui, you can change or remove the shipped library in the
> > same way:
> >
> > IJQueryLibrarySettings settings = new JQueryLibrarySettings();
> >
> > settings.setJQueryReference(new MyJQueryReference()); // (jquery core,
> same
> > code as above)
> > settings.setJQueryUIReference(new
> > JQueryPluginResourceReference(MyApplication.class,
> > "jquery-ui-x.x.x.min.js")); //new jquery ui version
> > or
> > settings.setJQueryUIReference(null) //removes jquery ui library
> >
> > this.setJavaScriptLibrarySettings(settings);
> >
> > Hope this helps,
> > Sebastien.
> >
> > On Mon, Jan 28, 2013 at 10:31 AM, Pieter Claassen  > >wrote:
> >
> > > Hi Sebastian,
> > >
> > > Thanks. Wicket 6.5 is what I am using.
> > >
> > > As to your question:
> > >
> > > I am referring to the fact that Wicket documentation mentioned that
> > JQuery
> > > has been selected for the internal AJax implementation in Wicket. I
> take
> > > that means that there is a JQuery JS library that ships with
> Wicket-core
> > > and also wicket code that makes use of that library. If I now include
> my
> > > own JQuery library and CSS, is there not a risk that both these
> > libraries,
> > > with mostly the same functions but potentially version skew, could be
> > > loaded by the same page?
> > >
> > > Also, I note that there are a number wicket-jquery projects out there.
> > How
> > > do they play together and not trample the internal Wicket
> implementation.
> > >
> > > Regards,
> > > Pieter
> > >
> > >
> > >
> > > On Mon, Jan 28, 2013 at 10:18 AM, Sebastien  wrote:
> > >
> > > > Hi Pieter
> > > >
> > > > I am not sure to undestand your first point. What libraries are you
> > > > refering to? Internal wicket's library? A jQuery plugin? Another?
> > > >
> > > > About your second point, the ResizeBehavior does not currently
> > implement
> > > > the 'resize' event (which can retrieve size & position).
> > > > To stay consistent with the current logic behind wicket-jquery-ui, I
> > will
> > > > do a ResizePanel which will support such event.
> > > > That's not a big deal, I will look at this tonight...
> > > >
> > > > Are you using Wicket 1.5.x or 6.x?
> > > >
> > > > Thanks & best regards,
> > > > Sebastien.
> > > >
> > > > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen  >
> > > > wrote:
> > > >
> > > > > This is a general best practice question. I am using
> wicket-jquery-ui
> > > > > because I don't seem to be able to find a resizable panel in the
> > > > > internal wicket ajax widgets.
> > > > >
> > > > > 1. Is there no problem loading new jquery libraries over the wicket
> > > > > implementation? What is best practice?
> > > > > 2. I am looking for a way to get the resized panels' x and y size
> > > > > parameters into my wicket code? Any suggestions how to do this?
> > > > >
> > > > > Thanks,
> > > > > Pieter
> > > > >
> > > > >
> -
> > > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > > > For additional commands, e-mail: users-h...@wicket.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > - - - - - - - - - - - - - - - - - - - -
> > >   Pieter Claassen
> > >   Musmato B.V.
> > >   e: pieter.claas...@musmato.com
> > >   t: +31 877 848259
> > >   w: http://musmato.com
> > > - - - - - - - - - - - - - - - - - - - -
> > >
> >
>
>
>
> --
> - - - - - - - - - - - - - - - - - - - -
>   Pieter Claassen
>   Musmato B.V.
>   e: pieter.claas...@musmato.com
>   t: +31 877 848259
>   w: http://musmato.com
> -

Re: JQuery - best practice

2013-01-28 Thread Pieter Claassen
Sebastien,

So by including the wicket-jquery-ui (if I follow the installation
instructions), does that not conflict with the jquery core library?

Regards,
Pieter

On Mon, Jan 28, 2013 at 11:38 AM, Sebastien  wrote:

> Hi Pieter,
>
> Yes, wicket is embedding jquery core library. If you include another jquery
> core well yes, you will probably get into troubles.
>
> If you really want to do that, you can specify your own jQuery core library
> version, in Wicket Application#init():
>
> IJavaScriptLibrarySettings settings = getJavaScriptLibrarySettings();
> settings.setJQueryReference(new MyJQueryReference());
>
> About conflicts with existing Wicket / jQuery UI implementation, that's the
> same, only one jQuery UI library version should be loaded at a time.
> In wicket-jquery-ui, you can change or remove the shipped library in the
> same way:
>
> IJQueryLibrarySettings settings = new JQueryLibrarySettings();
>
> settings.setJQueryReference(new MyJQueryReference()); // (jquery core, same
> code as above)
> settings.setJQueryUIReference(new
> JQueryPluginResourceReference(MyApplication.class,
> "jquery-ui-x.x.x.min.js")); //new jquery ui version
> or
> settings.setJQueryUIReference(null) //removes jquery ui library
>
> this.setJavaScriptLibrarySettings(settings);
>
> Hope this helps,
> Sebastien.
>
> On Mon, Jan 28, 2013 at 10:31 AM, Pieter Claassen  >wrote:
>
> > Hi Sebastian,
> >
> > Thanks. Wicket 6.5 is what I am using.
> >
> > As to your question:
> >
> > I am referring to the fact that Wicket documentation mentioned that
> JQuery
> > has been selected for the internal AJax implementation in Wicket. I take
> > that means that there is a JQuery JS library that ships with Wicket-core
> > and also wicket code that makes use of that library. If I now include my
> > own JQuery library and CSS, is there not a risk that both these
> libraries,
> > with mostly the same functions but potentially version skew, could be
> > loaded by the same page?
> >
> > Also, I note that there are a number wicket-jquery projects out there.
> How
> > do they play together and not trample the internal Wicket implementation.
> >
> > Regards,
> > Pieter
> >
> >
> >
> > On Mon, Jan 28, 2013 at 10:18 AM, Sebastien  wrote:
> >
> > > Hi Pieter
> > >
> > > I am not sure to undestand your first point. What libraries are you
> > > refering to? Internal wicket's library? A jQuery plugin? Another?
> > >
> > > About your second point, the ResizeBehavior does not currently
> implement
> > > the 'resize' event (which can retrieve size & position).
> > > To stay consistent with the current logic behind wicket-jquery-ui, I
> will
> > > do a ResizePanel which will support such event.
> > > That's not a big deal, I will look at this tonight...
> > >
> > > Are you using Wicket 1.5.x or 6.x?
> > >
> > > Thanks & best regards,
> > > Sebastien.
> > >
> > > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen 
> > > wrote:
> > >
> > > > This is a general best practice question. I am using wicket-jquery-ui
> > > > because I don't seem to be able to find a resizable panel in the
> > > > internal wicket ajax widgets.
> > > >
> > > > 1. Is there no problem loading new jquery libraries over the wicket
> > > > implementation? What is best practice?
> > > > 2. I am looking for a way to get the resized panels' x and y size
> > > > parameters into my wicket code? Any suggestions how to do this?
> > > >
> > > > Thanks,
> > > > Pieter
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > > For additional commands, e-mail: users-h...@wicket.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > - - - - - - - - - - - - - - - - - - - -
> >   Pieter Claassen
> >   Musmato B.V.
> >   e: pieter.claas...@musmato.com
> >   t: +31 877 848259
> >   w: http://musmato.com
> > - - - - - - - - - - - - - - - - - - - -
> >
>



-- 
- - - - - - - - - - - - - - - - - - - -
  Pieter Claassen
  Musmato B.V.
  e: pieter.claas...@musmato.com
  t: +31 877 848259
  w: http://musmato.com
- - - - - - - - - - - - - - - - - - - -


Re: JQuery - best practice

2013-01-28 Thread Sebastien
Hi Pieter,

Yes, wicket is embedding jquery core library. If you include another jquery
core well yes, you will probably get into troubles.

If you really want to do that, you can specify your own jQuery core library
version, in Wicket Application#init():

IJavaScriptLibrarySettings settings = getJavaScriptLibrarySettings();
settings.setJQueryReference(new MyJQueryReference());

About conflicts with existing Wicket / jQuery UI implementation, that's the
same, only one jQuery UI library version should be loaded at a time.
In wicket-jquery-ui, you can change or remove the shipped library in the
same way:

IJQueryLibrarySettings settings = new JQueryLibrarySettings();

settings.setJQueryReference(new MyJQueryReference()); // (jquery core, same
code as above)
settings.setJQueryUIReference(new
JQueryPluginResourceReference(MyApplication.class,
"jquery-ui-x.x.x.min.js")); //new jquery ui version
or
settings.setJQueryUIReference(null) //removes jquery ui library

this.setJavaScriptLibrarySettings(settings);

Hope this helps,
Sebastien.

On Mon, Jan 28, 2013 at 10:31 AM, Pieter Claassen wrote:

> Hi Sebastian,
>
> Thanks. Wicket 6.5 is what I am using.
>
> As to your question:
>
> I am referring to the fact that Wicket documentation mentioned that JQuery
> has been selected for the internal AJax implementation in Wicket. I take
> that means that there is a JQuery JS library that ships with Wicket-core
> and also wicket code that makes use of that library. If I now include my
> own JQuery library and CSS, is there not a risk that both these libraries,
> with mostly the same functions but potentially version skew, could be
> loaded by the same page?
>
> Also, I note that there are a number wicket-jquery projects out there. How
> do they play together and not trample the internal Wicket implementation.
>
> Regards,
> Pieter
>
>
>
> On Mon, Jan 28, 2013 at 10:18 AM, Sebastien  wrote:
>
> > Hi Pieter
> >
> > I am not sure to undestand your first point. What libraries are you
> > refering to? Internal wicket's library? A jQuery plugin? Another?
> >
> > About your second point, the ResizeBehavior does not currently implement
> > the 'resize' event (which can retrieve size & position).
> > To stay consistent with the current logic behind wicket-jquery-ui, I will
> > do a ResizePanel which will support such event.
> > That's not a big deal, I will look at this tonight...
> >
> > Are you using Wicket 1.5.x or 6.x?
> >
> > Thanks & best regards,
> > Sebastien.
> >
> > On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen 
> > wrote:
> >
> > > This is a general best practice question. I am using wicket-jquery-ui
> > > because I don't seem to be able to find a resizable panel in the
> > > internal wicket ajax widgets.
> > >
> > > 1. Is there no problem loading new jquery libraries over the wicket
> > > implementation? What is best practice?
> > > 2. I am looking for a way to get the resized panels' x and y size
> > > parameters into my wicket code? Any suggestions how to do this?
> > >
> > > Thanks,
> > > Pieter
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> >
>
>
>
> --
> - - - - - - - - - - - - - - - - - - - -
>   Pieter Claassen
>   Musmato B.V.
>   e: pieter.claas...@musmato.com
>   t: +31 877 848259
>   w: http://musmato.com
> - - - - - - - - - - - - - - - - - - - -
>


Re: JQuery - best practice

2013-01-28 Thread Pieter Claassen
Hi Sebastian,

Thanks. Wicket 6.5 is what I am using.

As to your question:

I am referring to the fact that Wicket documentation mentioned that JQuery
has been selected for the internal AJax implementation in Wicket. I take
that means that there is a JQuery JS library that ships with Wicket-core
and also wicket code that makes use of that library. If I now include my
own JQuery library and CSS, is there not a risk that both these libraries,
with mostly the same functions but potentially version skew, could be
loaded by the same page?

Also, I note that there are a number wicket-jquery projects out there. How
do they play together and not trample the internal Wicket implementation.

Regards,
Pieter



On Mon, Jan 28, 2013 at 10:18 AM, Sebastien  wrote:

> Hi Pieter
>
> I am not sure to undestand your first point. What libraries are you
> refering to? Internal wicket's library? A jQuery plugin? Another?
>
> About your second point, the ResizeBehavior does not currently implement
> the 'resize' event (which can retrieve size & position).
> To stay consistent with the current logic behind wicket-jquery-ui, I will
> do a ResizePanel which will support such event.
> That's not a big deal, I will look at this tonight...
>
> Are you using Wicket 1.5.x or 6.x?
>
> Thanks & best regards,
> Sebastien.
>
> On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen 
> wrote:
>
> > This is a general best practice question. I am using wicket-jquery-ui
> > because I don't seem to be able to find a resizable panel in the
> > internal wicket ajax widgets.
> >
> > 1. Is there no problem loading new jquery libraries over the wicket
> > implementation? What is best practice?
> > 2. I am looking for a way to get the resized panels' x and y size
> > parameters into my wicket code? Any suggestions how to do this?
> >
> > Thanks,
> > Pieter
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 
- - - - - - - - - - - - - - - - - - - -
  Pieter Claassen
  Musmato B.V.
  e: pieter.claas...@musmato.com
  t: +31 877 848259
  w: http://musmato.com
- - - - - - - - - - - - - - - - - - - -


Re: JQuery - best practice

2013-01-28 Thread Sebastien
Hi Pieter

I am not sure to undestand your first point. What libraries are you
refering to? Internal wicket's library? A jQuery plugin? Another?

About your second point, the ResizeBehavior does not currently implement
the 'resize' event (which can retrieve size & position).
To stay consistent with the current logic behind wicket-jquery-ui, I will
do a ResizePanel which will support such event.
That's not a big deal, I will look at this tonight...

Are you using Wicket 1.5.x or 6.x?

Thanks & best regards,
Sebastien.

On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen  wrote:

> This is a general best practice question. I am using wicket-jquery-ui
> because I don't seem to be able to find a resizable panel in the
> internal wicket ajax widgets.
>
> 1. Is there no problem loading new jquery libraries over the wicket
> implementation? What is best practice?
> 2. I am looking for a way to get the resized panels' x and y size
> parameters into my wicket code? Any suggestions how to do this?
>
> Thanks,
> Pieter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: JQuery - best practice

2013-01-27 Thread Ernesto Reinaldo Barreiro
Hi,

On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen  wrote:

> This is a general best practice question. I am using wicket-jquery-ui
> because I don't seem to be able to find a resizable panel in the
> internal wicket ajax widgets.
>
> 1. Is there no problem loading new jquery libraries over the wicket
> implementation? What is best practice?
>

Look at the existing jquery integrations and see what people do?



> 2. I am looking for a way to get the resized panels' x and y size
> parameters into my wicket code? Any suggestions how to do this?
>
> You have to:

1-Hook onto the client side events triggered by resize and use
Wicket.AJA.get/post to stream back the parameters.
2-Attach and AJAX behavior at server side component and on respond get and
parse those parameter.

Examples?

https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java

or event better

https://github.com/WiQuery/wiquery/blob/master/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/resizable/ResizableBehavior.java

wihc already have that functionality (see AjaxResizeCallback)



> Thanks,
> Pieter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/