On 1/31/07, Daniele Dellafiore <[EMAIL PROTECTED]> wrote:
> I will try to understand better how things works.
> What I really need is to get the new browser size after a search form
> has been submitted so I can try to send the size properties in the
> search form  (as you do in thee postback form) and then update the
> ClientProperties in... some way.

Just make sure your form submits the current width and size. Nest some
hidden fields in your form (but back them up with Wicket components)
and have something like this in your page's header:

          document.myForm.widthField.value =  window.innerWidth ||
document.body.offsetWidth;
          document.myForm.heightField.value =  window.innerHeight ||
document.body.offsetHeight;

where myForm is the id of your Wicket form, and widthField and
heightField are the ids of the hidden fields on your form.

When those values come in, you can just update your client properties
object; they are cached throughout the whole session. Though you don't
have to use that object in the first place; you can just use those
values directly and be done with it, or put them in your session as
separate properties. Whatever you like :)

> This would be a specific solution and maybe does not really need the
> ClientProperties to handle browser size cause I will have direct
> access to the form submitted value.

Yep.

> If I have correctly understood, what you suggest is a more general
> solution where I could put some javascript in the main template page
> of my webapp that continuously send information about changes. Such a
> solution would send a lot of event from client to server and the most
> will not be considered... this is the way a swing app works but maybe
> it is "too much" for a webapp, isn't it?

Yep. The duty of a framework is to provide generic solutions, but if
you don't need it, go for the simplest thing that works! :)

Eelco

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to