I think we discussed this before, but isn't there a way to configure javascript or something equivilent which will notify the server right before the client window closes?
Gili
Eelco Hillenius wrote:
Hi,
Dan Gould wrote:
Three quick questions getting started with Wicket (I'm sure I'll have more
later, but I'm glad to document what I learn on the Wiki--I like
documenting what I discover). I've only started playing around but,
assuming that a few things can be handled, I think I'm going to choose
Wicket:
1) In one place, my site needs to use frames. (Yes, I know they're
unpopular, but it is important here). There will only be one nav/control
frame while the other will just contain content). Will this cause any
problems with Wicket? Can I use the existing Models to do this?
Using frames won't cause problems with models etc. It can however cause problems with 'expired' pages. Wicket holds a list (or actually a map) of page instances in your session (how many depends on your configuration, ApplicationSettings.maxPages), but defaults to 10 - which is problably higher than you need. Anyway, in some cases, like when working with frames, you want to have seperate lists. This is supported by Wicket by using the 'pagemap' parameter. If this parameter is not used, it will use it's default pagemap (that's probably what you want to use for your 'main' frame).
Here's an example of how you could set up your frames:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A simple frameset document</TITLE>
</HEAD>
<FRAMESET cols="20%, 80%">
<FRAMESET rows="100, 200">
<FRAME src="myapp?pagemap=leftframe&bookmarkablePage=mypackage.MyNavigationPage">
<FRAME src="myapp?bookmarkablePage=mypackage.MyMainPage">
</FRAMESET>
<FRAME src="myapp?pagemap=bottomframe&bookmarkablePage=mypackage.MyStatusBarPage">
</FRAMESET>
</HTML>
That's it. Page maps are created automatically, and all links etc of a page that was created for a certain page map will keep on refering that page map.
I'll put this example on our Wiki.
2) I am going to be doing some basic AJAX stuff. I know that Wicket
doesn't yet have formal support for it, but I presume that loading some
"mini-pages" via XmlHttpRequest from some Javascript in my pgaes won't
break anything? Correct.
I haven't tried this myself, but that should work. Please join our discussion (on the Wiki/ in issue db) about AJAX :) We'll probably start working on this in the beginning of June.
3) I want to maintain state for my users when the come back, but I don't want them to have to register. I assume I should get/set a cookie using the RequestCycle's WebResponse?
I think Wicket even has a more sophisticated support for cookies. Juergen knows all about it (but I think he's still in Egypt?), but you can take a look at the signin panel of wicket-examples, and class wicket.markup.html.form.persistence.CookieValuePersister.
If I understand and read well, you can persist any form component you want, using any persistence strategy you want - thus including using cookies. This is in FormComponent:
/** * Whether this form component should save and restore state between * sessions. This is false by default. */ private boolean persistent = false;
and this is in Form:
/** * Gets the form component persistence manager; it is lazy loaded. * * @return The form component value persister */ protected IValuePersister getValuePersister() { return new CookieValuePersister(); }
So, it looks like the only thing you have to do is mark the fields you want to have persisted with a cookie is setting the 'persistent' property to true.
[BTW: When you do work on AJAX support, I highly recommend using the
DojoToolkit. It's just getting underway, but it has a huge amount of
support in the Javascript/DHTML world and will probably become the de
facto standard. I also mentioned this on the Issue Tracker.]
Thanks. From what I've seen, I like DojoToolkit.
Thank you very much!
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
