You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by meduolis <me...@gmail.com> on 2010/11/17 21:24:06 UTC
ModalWindow update size
Let say we got page with button, we click the button, it shows the modal
window. Inside modal window we got panel with button "resize me, please!".
We click that button, modal windows AJAX'ly updates and resizes from 600x400
to 320x240 :), the end
Any help?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3047558.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow update size
Posted by andrea del bene <an...@libero.it>.
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow update size
Posted by Steve Swinsburg <st...@gmail.com>.
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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow update size
Posted by andrea del bene <an...@libero.it>.
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: PageMap, setMaxPageMaps()
Posted by meduolis <me...@gmail.com>.
Stefan Lindner, maby you know that thread where this problem is talked? I
really want to have that feature on my application
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3049389.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: PageMap, setMaxPageMaps()
Posted by meduolis <me...@gmail.com>.
So, there is no way to update modal window size, damn :), I thought wicket is
almighty :)
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3049278.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: PageMap, setMaxPageMaps()
Posted by meduolis <me...@gmail.com>.
I set maxPageMaps to 10, but it does not solve my problem :/
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3049198.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
PageMap, setMaxPageMaps()
Posted by MZ...@osc.state.ny.us.
Given this;
SecondLevelCachePageMap uses SecondLevelCacheSessionStore (this is default
in Wicket 1.3) which stores pages on disk except for the most recently
accessed one which is stored in http session. (
https://cwiki.apache.org/WICKET/page-maps.html)
What effect would getSessionSettings().setMaxPageMaps(5) have if only one
page map is stored in session and the remainder are in DiskStore (per
description above)? In other words, Wicket is storing pagemap n-1 in
session, so n-2 should be in DiskStore, in which case setMaxPageMaps(5)
has had no effect...
JavaDoc for setMaxPageMaps(int)
/**
* Sets maximum number of page maps allowed in this session
*
* @param maxPageMaps
* Maximum number of page maps
*/
void setMaxPageMaps(int maxPageMaps);
From: meduolis <me...@gmail.com>
To: users@wicket.apache.org
Date: 11/18/2010 12:04 PM
Subject: Re: ModalWindow update size
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
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3049132.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Notice: This communication, including any attachments, is intended solely
for the use of the individual or entity to which it is addressed. This
communication may contain information that is protected from disclosure
under State and/or Federal law. Please notify the sender immediately if
you have received this communication in error and delete this email from
your system. If you are not the intended recipient, you are requested not
to disclose, copy, distribute or take any action in reliance on the
contents of this information.
Re: ModalWindow update size
Posted by meduolis <me...@gmail.com>.
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
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3049132.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow update size
Posted by Steve Swinsburg <st...@gmail.com>.
You could pass the modal window as an argument in the MyPanel constructor.
e.g.
ModalWindow modal = new ModalWindow("myWindow");
then later:
modal.setContent(new MyPanel(someProps, modal));
then in your Panel you can manipulate the ModalWindow.
On 18/11/2010, at 8:14 AM, meduolis wrote:
>
> I'm little confused here,
>
> Let say this is my page
>
>
> MyPage {
>
> widthProp;
> heightProp;
>
> // setters getters stuff
>
> //button shows modal with MyPanel inside it
> // modal content
> modal.setContent(new MyPanel(someProps));
>
> }
>
>
> And thats a panel
>
>
> MyPanel {
>
> MyPanel(props) {
> //?? Eclipse makes those props final here, so i cannot modify it
> }
>
> //button to resize the modal window
>
> }
>
>
> I think I can not set those properties width and height from MyPanel, we
> dont know about them here, do we?? :)
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3047662.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
Re: ModalWindow update size
Posted by meduolis <me...@gmail.com>.
I'm little confused here,
Let say this is my page
MyPage {
widthProp;
heightProp;
// setters getters stuff
//button shows modal with MyPanel inside it
// modal content
modal.setContent(new MyPanel(someProps));
}
And thats a panel
MyPanel {
MyPanel(props) {
//?? Eclipse makes those props final here, so i cannot modify it
}
//button to resize the modal window
}
I think I can not set those properties width and height from MyPanel, we
dont know about them here, do we?? :)
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3047662.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow update size
Posted by meduolis <me...@gmail.com>.
Something like that?
AttributeModifier widthAttributeModifier = new AttributeModifier("width",
new PropertyModel<Integer>(this, "modalWidth"));
AttributeModifier heightAttributeModifier = new
AttributeModifier("height", new PropertyModel<Integer>(this,
"modalHeight"));
imageModal.add(widthAttributeModifier);
imageModal.add(heightAttributeModifier);
And later just update those property models?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3047601.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow update size
Posted by Poko Booth <po...@gmail.com>.
Add attribute modifier to the modal with a model for the class attribute's value and on the click event change the model value to the class with the desirable size.
Regards,
poko
On Nov 17, 2010, at 10:24 PM, meduolis wrote:
>
> Let say we got page with button, we click the button, it shows the modal
> window. Inside modal window we got panel with button "resize me, please!".
> We click that button, modal windows AJAX'ly updates and resizes from 600x400
> to 320x240 :), the end
>
> Any help?
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/ModalWindow-update-size-tp3047558p3047558.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: ModalWindow update size
Posted by Istvan Jozsa <jo...@gmail.com>.
// 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"//
+ "}"//
);
}