Re: ModalWindow update size

2010-11-27 Thread Steve Swinsburg
I just noticed that autosizing ModalWindows has made it into Wicket 1.5, heres 
the JIRA:
https://issues.apache.org/jira/secure/attachment/12456436/fix-WICKET-1.4.x.patch

Take a look at the patches, there is a method that sets the size of the window, 
might be something to borrow.

cheers,
Steve


On 19/11/2010, at 8:52 AM, andrea del bene wrote:

 Hi meduolis,
 
 in order to resize modal window you could try to use some JavaScript. Wicket 
 keeps track of modal window on client side with variable 
 Wicket.Window.current. To resize modal window you could write something like:
 
 var targetWindow = Wicket.Window.current.window;
 var targetContent = Wicket.Window.current.content;
 
 targetContent.style.height = '120px';
 targetWindow.style.width = '200px';
 
 You can run this script using appendJavascript method of ajax target.
 Just remember that this script could not work with IE 6 (sigh!) and that the 
 actual window height is the sum of content height and caption height. You 
 coul access to caption's fields through variable Wicket.Window.current.caption
 
 Bye.
 
 
 
 I have tried it already, but it does not help.
 
 on my panel I do this:
 
 
 modal.setInitialWidth(image.getWidth());
 modal.setInitialHeight(image.getHeigth());
  
 target.addComponent(modal);
 
 
 but on click nothing happens, no exceptions
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


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



Re: ModalWindow update size

2010-11-27 Thread andrea del bene
Oh yes, I've forgotten to mention patch file. But keep in mind that it 
could not work under IE6...

I just noticed that autosizing ModalWindows has made it into Wicket 1.5, heres 
the JIRA:
https://issues.apache.org/jira/secure/attachment/12456436/fix-WICKET-1.4.x.patch

Take a look at the patches, there is a method that sets the size of the window, 
might be something to borrow.

cheers,
Steve


On 19/11/2010, at 8:52 AM, andrea del bene wrote:





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



Re: ModalWindow update size

2010-11-22 Thread Istvan Jozsa
// add to your ModalWindow constructor:
setWidthUnit(em);
setHeightUnit(em);
setResizable(false);
setOutputMarkupId(true);

@Override
public void show(AjaxRequestTarget target) {
super.show(target);
// ...
int width = ...;
int height = ...;
target.appendJavascript(//
+ var thisWindow = Wicket.Window.get();\n//
+ if (thisWindow) {\n//
+ thisWindow.window.style.width = \ + width + em\;\n//
+ thisWindow.content.style.height = \ + height + em\;\n//
+ thisWindow.center();\n//
+ }//
);
}