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 <
[email protected]> wrote:
> Hi,
>
> On Mon, Jan 28, 2013 at 7:45 AM, Pieter Claassen <[email protected]>
> 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: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ <http://antiliasoft.com/antilia>
>
--
- - - - - - - - - - - - - - - - - - - -
Pieter Claassen
Musmato B.V.
e: [email protected]
t: +31 877 848259
w: http://musmato.com
- - - - - - - - - - - - - - - - - - - -