Re: Autosize modal window

2010-01-07 Thread Ilja Pavkovic
Hi,

> Ok, great, the height is indeed autosizing nicely now. Is there any way to
>  have the width autosize as well?
no, as you need either a height or a width to calculate on out of the other  
automatically with respect to the window content (content dimension and aspect 
ratio would be sufficient, but we don't have that :))

You could get the width from ClientProperties after enabling 
gatherExtendedBrowserInfo in the Application settings

ApplicationClass.init() {
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
}

But you will have one flickering extra page that is used to gather this 
information.

Perhaps when you could use something like 

int width = ((WebClientInfo) 
getRequestCycle().getClientInfo()).getProperties().getBrowserWidth();

width = width/3;


Easier would be to use a reasonable width.

Best Regards,
Ilja


> Thanks, Jonck
> 
> 
> -Original Message-
> From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de]
> Sent: donderdag 7 januari 2010 13:51
> To: users@wicket.apache.org
> Cc: Kogel, Jonck-van-der
> Subject: Re: Autosize modal window
> 
> Hi,
> 
> I forgot the following line: modalWindow.setUseInitialHeight(false);
> 
> Best Regards,
>   Ilja Pavkovic
> 
> Am Donnerstag, 7. Januar 2010 12:40:25 schrieb Kogel, Jonck-van-der:
> > Hi Ilja,
> > Ok, that's good, I'm not using PageCreator. But how do I then make the
> > ModalWindow autosize? Perhaps I'm missing something in the JavaDocs
> > but I  can't find it anywhere.
> >
> > Thanks, Jonck
> >
> > -Original Message-
> > From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de]
> > Sent: woensdag 6 januari 2010 17:23
> > To: users@wicket.apache.org
> > Subject: Re: Autosize modal window
> >
> > Hi,
> >
> > according to the inline documentation of ModalWindow you can only
> > autosize  if you add components and don't use  ModalWindow.PageCreator
> >
> > something like
> >
> > ModalWindow modalWindow = new ModalWindow(); modalWindow.add(new
> > MyPanel(modalWindow.getComponentId());
> >
> > 
> >
> > Best Regards,
> > Ilja Pavkovic
> >
> > Am Mittwoch, 6. Januar 2010 17:12:05 schrieb Kogel, Jonck-van-der:
> > > Hi,
> > > Is it possible to have a modal window auto-size depending on its
> > > contents? I've been fiddling with header contributions and such but
> > > can't get it to work.
> > >
> > > Thanks!
> > >
> > > Jonck
> >
> > --
> > binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin
> >
> >+49 · 171 · 9342 465
> >
> > Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
> > Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost
> > Becker
> >
> > -
> > 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
> 
> --
> binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin
> 
>+49 · 171 · 9342 465
> 
> Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
> Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 

-- 
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker

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



RE: Autosize modal window

2010-01-07 Thread Kogel, Jonck-van-der
Ok, great, the height is indeed autosizing nicely now. Is there any way to have 
the width autosize as well?

Thanks, Jonck


-Original Message-
From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de] 
Sent: donderdag 7 januari 2010 13:51
To: users@wicket.apache.org
Cc: Kogel, Jonck-van-der
Subject: Re: Autosize modal window

Hi,

I forgot the following line: modalWindow.setUseInitialHeight(false);

Best Regards,
Ilja Pavkovic

Am Donnerstag, 7. Januar 2010 12:40:25 schrieb Kogel, Jonck-van-der:
> Hi Ilja,
> Ok, that's good, I'm not using PageCreator. But how do I then make the  
> ModalWindow autosize? Perhaps I'm missing something in the JavaDocs 
> but I  can't find it anywhere.
> 
> Thanks, Jonck
> 
> -Original Message-
> From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de]
> Sent: woensdag 6 januari 2010 17:23
> To: users@wicket.apache.org
> Subject: Re: Autosize modal window
> 
> Hi,
> 
> according to the inline documentation of ModalWindow you can only 
> autosize  if you add components and don't use  ModalWindow.PageCreator
> 
> something like
> 
> ModalWindow modalWindow = new ModalWindow(); modalWindow.add(new  
> MyPanel(modalWindow.getComponentId());
> 
> 
> 
> Best Regards,
>   Ilja Pavkovic
> 
> Am Mittwoch, 6. Januar 2010 17:12:05 schrieb Kogel, Jonck-van-der:
> > Hi,
> > Is it possible to have a modal window auto-size depending on its 
> > contents? I've been fiddling with header contributions and such but 
> > can't get it to work.
> >
> > Thanks!
> >
> > Jonck
> 
> --
> binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin
> 
>+49 · 171 · 9342 465
> 
> Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
> Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost 
> Becker
> 
> -
> 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
> 

--
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker



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



Re: Autosize modal window

2010-01-07 Thread Stefan Jozsa
Forgot:

public MyModalWindow  extends ModalWindow {

   public MyModalWindow(String id) {
   super(id);
   setResizable(false);
   setWidthUnit("em");
   setHeightUnit("em");
   setContent(new MyWindowPanel(this.getContentId()));
   // ...
   }
}

Stefan



  

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



Re: Autosize modal window

2010-01-07 Thread Stefan Jozsa
Yes, it can be resized.
Do something like this:

public void show(AjaxRequestTarget target, ...) {
// ...
super.show(target);
// ...
int height = YOUR_COMPUTED_HEIGHT;
int width = YOUR_COMPUTED_WIDTH;
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"//
+ "}"//
);
}

Stefan



  

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



Re: Autosize modal window

2010-01-07 Thread Ilja Pavkovic
Hi,

I forgot the following line: modalWindow.setUseInitialHeight(false);

Best Regards,
Ilja Pavkovic

Am Donnerstag, 7. Januar 2010 12:40:25 schrieb Kogel, Jonck-van-der:
> Hi Ilja,
> Ok, that's good, I'm not using PageCreator. But how do I then make the
>  ModalWindow autosize? Perhaps I'm missing something in the JavaDocs but I
>  can't find it anywhere.
> 
> Thanks, Jonck
> 
> -Original Message-
> From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de]
> Sent: woensdag 6 januari 2010 17:23
> To: users@wicket.apache.org
> Subject: Re: Autosize modal window
> 
> Hi,
> 
> according to the inline documentation of ModalWindow you can only autosize
>  if you add components and don't use  ModalWindow.PageCreator
> 
> something like
> 
> ModalWindow modalWindow = new ModalWindow(); modalWindow.add(new
>  MyPanel(modalWindow.getComponentId());
> 
> 
> 
> Best Regards,
>   Ilja Pavkovic
> 
> Am Mittwoch, 6. Januar 2010 17:12:05 schrieb Kogel, Jonck-van-der:
> > Hi,
> > Is it possible to have a modal window auto-size depending on its
> > contents? I've been fiddling with header contributions and such but
> > can't get it to work.
> >
> > Thanks!
> >
> > Jonck
> 
> --
> binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin
> 
>+49 · 171 · 9342 465
> 
> Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
> Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker
> 
> -
> 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
> 

-- 
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker

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



RE: Autosize modal window

2010-01-07 Thread Kogel, Jonck-van-der
Hi Ilja,
Ok, that's good, I'm not using PageCreator. But how do I then make the 
ModalWindow autosize? Perhaps I'm missing something in the JavaDocs but I can't 
find it anywhere.

Thanks, Jonck 

-Original Message-
From: Ilja Pavkovic [mailto:ilja.pavko...@binaere-bauten.de] 
Sent: woensdag 6 januari 2010 17:23
To: users@wicket.apache.org
Subject: Re: Autosize modal window

Hi,

according to the inline documentation of ModalWindow you can only autosize if 
you add components and don't use  ModalWindow.PageCreator

something like

ModalWindow modalWindow = new ModalWindow(); modalWindow.add(new 
MyPanel(modalWindow.getComponentId());



Best Regards,
Ilja Pavkovic

Am Mittwoch, 6. Januar 2010 17:12:05 schrieb Kogel, Jonck-van-der:
> Hi,
> Is it possible to have a modal window auto-size depending on its 
> contents? I've been fiddling with header contributions and such but 
> can't get it to work.
> 
> Thanks!
> 
> Jonck
> 

--
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker

-
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: Autosize modal window

2010-01-06 Thread Ilja Pavkovic
Hi,

according to the inline documentation of ModalWindow you can only autosize if 
you add components and don't use  ModalWindow.PageCreator

something like

ModalWindow modalWindow = new ModalWindow();
modalWindow.add(new MyPanel(modalWindow.getComponentId());



Best Regards,
Ilja Pavkovic

Am Mittwoch, 6. Januar 2010 17:12:05 schrieb Kogel, Jonck-van-der:
> Hi,
> Is it possible to have a modal window auto-size depending on its
> contents? I've been fiddling with header contributions and such but
> can't get it to work.
> 
> Thanks!
> 
> Jonck
> 

-- 
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker

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