[Wicket-user] DefaultPageFactory

2005-05-18 Thread Jonathan Carlson
Could DefaultPageFactory be made Serializable?  

I'm trying to delay page creation, but for me that includes having a
PageFactory in the Session instead of a Page.

Am I doing something that probably shouldn't be done?

Thanks,

- Jonathan

__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

Katun Corporation -- www.katun.com 
_


---
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] AbstractChoice

2005-05-18 Thread Jonathan Carlson
It appears there is no way to set the choices in AbstractChoice except
via the constructor.

Can someone add a setChoices() method or let me know if there is a
workaround?

My problem is that I have a subclass of DropDownChoice that needs to
add a choice to the list of Choices passed into the constructor,
however, it doesn't appear that I can do that: super(...) has to be
called first.

Thanks!



__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

Katun Corporation -- www.katun.com 
_


---
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Page expired error

2005-05-18 Thread Matej Knopp
Hi.
I'm getting a page expired error and I don't know why. I'm using wicket 
RC2. Every page expires on 10th reload. This only happens with internet 
explorer. Mozilla and Opera can reload the page as many times as needed 
with no problems.

No other pages are created or reloaded, but the page still expires. This 
doesn't happen with wicket examples.

I'm kind of confused, as far as I can tell my Application class and Page 
classes don't do anything differend then classes in wicket example, but 
the expiration happens no matter what.

Any hints?
Thanks.
-Matej
---
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] AbstractChoice

2005-05-18 Thread Eelco Hillenius
You want it? You got it!
It's in HEAD, but as it will take a couple of hours for ssh cvs to sync 
with pserver cvs, I attached the fixed file.

Eelco
Jonathan Carlson wrote:
It appears there is no way to set the choices in AbstractChoice except
via the constructor.
Can someone add a setChoices() method or let me know if there is a
workaround?
My problem is that I have a subclass of DropDownChoice that needs to
add a choice to the list of Choices passed into the constructor,
however, it doesn't appear that I can do that: super(...) has to be
called first.
Thanks!

__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
Katun Corporation -- www.katun.com 
_

---
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
 


/*
 * $Id: AbstractChoice.java,v 1.15 2005/05/18 19:04:20 eelco12 Exp $
 * $Revision: 1.15 $ $Date: 2005/05/18 19:04:20 $
 * 
 * 
==
 * Licensed under the Apache License, Version 2.0 (the License); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package wicket.markup.html.form;

import java.util.Collection;

import wicket.markup.ComponentTag;
import wicket.markup.MarkupStream;
import wicket.markup.html.form.model.ChoiceList;
import wicket.markup.html.form.model.IChoice;
import wicket.markup.html.form.model.IChoiceList;
import wicket.model.IModel;
import wicket.version.undo.Change;

/**
 * Abstract base class for all choice (html select) options.
 * 
 * @author Jonathan Locke
 * @author Eelco Hillenius
 * @author Johan Compagner
 */
abstract class AbstractChoice extends FormComponent
{
/** The list of choices. */
private IChoiceList choices;

/**
 * @param id
 *See Component
 * @param choices
 *The collection of choices in the dropdown
 * @see wicket.Component#Component(String)
 */
public AbstractChoice(final String id, final Collection choices)
{
this(id, new ChoiceList(choices));
}

/**
 * @param id
 *See Component
 * @param choices
 *The collection of choices in the dropdown
 * @see wicket.Component#Component(String)
 */
public AbstractChoice(final String id, final IChoiceList choices)
{
super(id);
this.choices = choices;
}

/**
 * @param id
 *See Component
 * @param model
 *See Component
 * @param choices
 *The collection of choices in the dropdown
 * @see wicket.Component#Component(String, IModel)
 */
public AbstractChoice(final String id, IModel model, final Collection 
choices)
{
this(id, model, new ChoiceList(choices));
}

/**
 * @param id
 *See Component
 * @param model
 *See Component
 * @param choices
 *The drop down choices
 * @see wicket.Component#Component(String, IModel)
 */
public AbstractChoice(final String id, IModel model, final IChoiceList 
choices)
{
super(id, model);
this.choices = choices;
}

/**
 * Gets the list of choices.
 * 
 * @return The list of choices
 */
public IChoiceList getChoices()
{
if(choices != null) choices.attach();
return this.choices;
}

/**
 * Sets the list of choices.
 *
 * @param choices the list of choices
 */
public final void setChoices(IChoiceList choices)
{
if(this.choices != null  (this.choices != choices))
{
   

Re: [Wicket-user] Page expired error

2005-05-18 Thread Eelco Hillenius
Hmmm. I have no idea... could you send me (some of your) code to my 
personal email address?

Eelco
Matej Knopp wrote:
Hi.
I'm getting a page expired error and I don't know why. I'm using 
wicket RC2. Every page expires on 10th reload. This only happens with 
internet explorer. Mozilla and Opera can reload the page as many times 
as needed with no problems.

No other pages are created or reloaded, but the page still expires. 
This doesn't happen with wicket examples.

I'm kind of confused, as far as I can tell my Application class and 
Page classes don't do anything differend then classes in wicket 
example, but the expiration happens no matter what.

Any hints?
Thanks.
-Matej
---
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] new model CachingHibernateObjectModel

2005-05-18 Thread Eelco Hillenius
I'm not sure how many of you are using the wicket-stuff projects, but I 
just introduced a new hibernate related model: 
CachingHibernateObjectModel. For anyone using HibernateObjectModel: 
consider this model if you have edit pages that work with several 
roundtrips (working on the object) before actually saving changes to the 
database. I also introduced parameter 'unproxy' in HibernateObjectModel, 
that unproxies the loaded object. This solved some cglib issues I had 
when using Hibernate 3.0.

Regards,
Eelco
---
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] new model CachingHibernateObjectModel

2005-05-18 Thread Jonathan Carlson
Thanks Eelco.  I'm not doing Hibernate, but I noticed that my
CayenneQueryModel (which I will commit to wicket-stuff someday) seems to
be constantly refetching my query.  I'll be curious to see how you do
the caching.


 [EMAIL PROTECTED] 2005-05-18 3:45:13 PM 
I'm not sure how many of you are using the wicket-stuff projects, but I

just introduced a new hibernate related model: 
CachingHibernateObjectModel. For anyone using HibernateObjectModel: 
consider this model if you have edit pages that work with several 
roundtrips (working on the object) before actually saving changes to
the 
database. I also introduced parameter 'unproxy' in
HibernateObjectModel, 
that unproxies the loaded object. This solved some cglib issues I had 
when using Hibernate 3.0.

Regards,

Eelco


---
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=7412alloc_id=16344op=click 
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user 

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

__
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

Katun Corporation -- www.katun.com 
_


---
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Frames and AJAX stuff

2005-05-18 Thread Gili
	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
TITLEA simple frameset document/TITLE
/HEAD
FRAMESET cols=20%, 80%
FRAMESET rows=100, 200
FRAME 
src=myapp?pagemap=leftframebookmarkablePage=mypackage.MyNavigationPage
FRAME src=myapp?bookmarkablePage=mypackage.MyMainPage
/FRAMESET
FRAME 
src=myapp?pagemap=bottomframebookmarkablePage=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=7393alloc_id=16281op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
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=7412alloc_id=16344op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


---
This SF.Net email is sponsored by