Ernesto, This is very strange. When I use your snapshot code in a quickstart project, it functions fine. But when I include it in my project, I always get the old x and y values (of one resize ago) in my callback.
Can you think of any reason why this would be happening? Could this be an issue with the javascript code? I see my wicket ajax debug window does not show my function parameters being used in the call so I can't see if it is JS or wicket issue. How do I start to debug this? Regards, Pieter On Sun, Mar 10, 2013 at 10:02 AM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > Pieter, > > Can you create a quickstart or "something" I can give it a try? Or give it > a try to what I have added to wiquery: test panel I have created there > seems to be working fine. If those changes work fine for you I can as other > team member to roll out a new version of wiquery next week;-) > > On Sun, Mar 10, 2013 at 8:56 AM, Pieter Claassen <pie...@musmato.com> > wrote: > > > Ernesto, > > > > Ok, I implemented your changes but something very strange is happening. > In > > my callback, I get the resizeHeight and resizeWidth values of the > previous > > window resize event, not the current one. > > > > I don't really know how to debug this other than drag the window smaller > > and larger and checking whether the values increase or decrease. > > > > Any suggestion for how to debug this? > > > > Regards, > > Pieter > > > > > > > > On Sat, Mar 9, 2013 at 4:56 PM, Ernesto Reinaldo Barreiro < > > reier...@gmail.com> wrote: > > > > > Pieter, > > > > > > I have just fixed wiquery to support the stop event. See commit > > > > > > > > > > > > https://github.com/WiQuery/wiquery/commit/c2e8242c9d1aba9ae64f7c67654e0e6539d36b78 > > > > > > On problem there is that parameter coming form client are float > values. I > > > have added a test panel and ResizableStopAjaxBehavior seems to be > working > > > as expected. > > > > > > Hope this helps. > > > > > > Cheers. > > > > > > Ernesto > > > > > > > > > On Sat, Mar 9, 2013 at 2:55 PM, Pieter Claassen <pie...@musmato.com> > > > wrote: > > > > > > > I am still only interested in getting the size of a component on > resize > > > > stop. > > > > > > > > Below is my code that I use to try and implement a call back to only > > call > > > > on "stop". However, the x and y sizes I get are all over the place. > Not > > > at > > > > all corresponding with the window sizes I actually see when > resizing. > > > > > > > > I am using wiquery 6.2.0 and wicket 6.5.0. > > > > > > > > Any advice as to what I am doing wrong? > > > > > > > > Regards, > > > > Pieter > > > > > > > > MyResizableBehavior resizableBehavior = new > > > MyResizableBehavior(); > > > > resizableBehavior.setStopEvent(new > > > > MyResizableBehavior.AjaxResizeStopCallback() { > > > > @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); > > > > System.out.println("Width:"+resizeWidth+" > > > > Height:"+resizeHeight); > > > > advancedFormatterFactory.save(advancedFormatter); > > > > } > > > > > > > > }); > > > > > > > > resizableBehavior.setAutoHide(true).setGhost(true).setAnimate(true); > > > > resizableBehavior.setGrid(50, 50); > > > > > > > > .... > > > > > > > > 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<CallbackParameter> getExtraParameters() > > > > { > > > > List<CallbackParameter> 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; > > > > } > > > > } > > > > > > > > > > > > > > > > -- > > > > - - - - - - - - - - - - - - - - - - - - > > > > Pieter Claassen > > > > Musmato B.V. > > > > e: pieter.claas...@musmato.com > > > > t NL: +31 (20) 893 4337 > > > > t ZA: + 27 (0) 81 826 8166 > > > > w: http://musmato.com > > > > - - - - - - - - - - - - - - - - - - - - > > > > > > > > > > > > > > > > -- > > > Regards - Ernesto Reinaldo Barreiro > > > Antilia Soft > > > http://antiliasoft.com/ <http://antiliasoft.com/antilia> > > > > > > > > > > > -- > > - - - - - - - - - - - - - - - - - - - - > > Pieter Claassen > > Musmato B.V. > > e: pieter.claas...@musmato.com > > t NL: +31 (20) 893 4337 > > t ZA: + 27 (0) 81 826 8166 > > w: http://musmato.com > > - - - - - - - - - - - - - - - - - - - - > > > > > > -- > Regards - Ernesto Reinaldo Barreiro > Antilia Soft > http://antiliasoft.com/ <http://antiliasoft.com/antilia> > -- - - - - - - - - - - - - - - - - - - - - Pieter Claassen Musmato B.V. e: pieter.claas...@musmato.com t NL: +31 (20) 893 4337 t ZA: + 27 (0) 81 826 8166 w: http://musmato.com - - - - - - - - - - - - - - - - - - - -