You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Holda, Dariusz" <da...@lehman.com> on 2007/08/31 16:25:40 UTC

DataView paging

Hi,
I'm using my implementation of a DataView to display list of objects
that are own by another object.
I wrote my IDataProvider and LoadableDetachableModel so I can page
through the list - the list is quite long it can even have 5000, 6000
objects.
I'm displaying 10 rows on each page.
When I run application locally from my eclipse, everything is fine but
when I run it on a server the delay during page changing is significant
e.g. 3 or more seconds.
Could someone advise me on this issue?
I'm attaching code snippets.

class MyObjectDataProvider implements IDataProvider {

	private static final long serialVersionUID =
-254289478999293765L;
	private List<MyObject> myObjects;
		
	public MyObjectDataProvider(List<MyObject> myObjects){
		this.myObjects = myObjects;
	}
	
	public Iterator<MyObject> iterator(int first, int count) {
		return new ArrayList<MyObject>(myObjects.subList(first,
first+count)).iterator();
	}

	public IModel model(Object arg0) {
		return new MyObjectModel((MyObject)arg0);
	}

	public int size() {
		return myObjects.size();
	}

	public void setMyObjects(
			List<MyObject> myObjects) {
		this.myObjects = myObjects;
	}
	
	private final class MyObjectModel extends
LoadableDetachableModel{

		private static final long serialVersionUID =
8575601860619558208L;
		private MyObject psc;
		
		public MyObjectModel(MyObject psc){
			this.psc = psc;
		}
		
		@Override
		protected Object load() {
			return psc;
		}
		
		@Override
		public int hashCode(){
			return psc.hashCode();
		}
		
		@Override
		public boolean equals(Object o){
			if(this == o){
				return true;
			}
			if(o instanceof MyObjectModel){
				MyObjectModel that = (MyObjectModel)o;
				if(this.psc == null ? that.psc==null:
this.psc.equals(that.psc)){
					return true;
				}
			}
			return false;
		}	
	}
}

class MyObjectDataView extends DataView {

	private static final long serialVersionUID =
-5679706549137629007L;


	/**
	 * Constructor.
	 * 
	 * @param name of this Component
	 * @param myObjectModel model containing list of MyObject
objects
	 */
	public MyObjectDataView(String name, IDataProvider
myObjectDataProvider) {
		super(name, myObjectDataProvider);	
	}
	
	@Override
	protected void populateItem(Item item) {
		MyObject psc = (MyObject)item.getModelObject();
		TextField field1 = new TextField("field1",new
PropertyModel(psc,"field1"));		
		site.setEnabled(false);
		
		TextField field2 = new TextField("field2",new
PropertyModel(psc,"field2"));
		currency.setEnabled(false);
		
		item.add(field1);
		item.add(field2);
		item.add(new TextField("field3",new
PropertyModel(psc,"field3"))));
		item.add(new TextField("field4",new
PropertyModel(psc,"field4"))));
		item.add(new TextField("field5",new
PropertyModel(psc,"field5"))));
		item.add(new CheckBox("field6",new
PropertyModel(psc,"field6"))));
	}
}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.




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


RE: DataView paging

Posted by "Holda, Dariusz" <da...@lehman.com>.
I know, I've been writing jdbc and hibernate daos before.

Dariusz

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: 12 September 2007 16:31
To: users@wicket.apache.org
Subject: Re: DataView paging

it would be trivial to write a jdbc dao impl for the phonebook as well.

-igor


On 9/11/07, Holda, Dariusz <da...@lehman.com> wrote:
>
>
> Sorry for late response. I was dragged to another task.
> Thanks for pointing  me to the svn repository, it helped a lot. Shame
I
> can't use Hibernate or Ibatis as you do in your project.
>
> Thanks again,
> Dariusz
>
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: 31 August 2007 16:50
> To: users@wicket.apache.org
> Subject: Re: DataView paging
>
> you are holding on to the entire list in your data provider, this is
> bad.
> you should only load the pieces of your list you need.
>
> further your loadabledetachablemodel is broken since you hold on to
the
> actual object itself. loadabel detachable models are meant to hold on
to
> the
> id, and in load() load the object from the database based on that id
>
> makes sense? see wicket-phonebook example in wicket-stuff svn.
>
> -igor
>
>
> On 8/31/07, Holda, Dariusz <da...@lehman.com> wrote:
> >
> >
> > Hi,
> > I'm using my implementation of a DataView to display list of objects
> > that are own by another object.
> > I wrote my IDataProvider and LoadableDetachableModel so I can page
> > through the list - the list is quite long it can even have 5000,
6000
> > objects.
> > I'm displaying 10 rows on each page.
> > When I run application locally from my eclipse, everything is fine
but
> > when I run it on a server the delay during page changing is
> significant
> > e.g. 3 or more seconds.
> > Could someone advise me on this issue?
> > I'm attaching code snippets.
> >
> > class MyObjectDataProvider implements IDataProvider {
> >
> >         private static final long serialVersionUID =
> > -254289478999293765L;
> >         private List<MyObject> myObjects;
> >
> >         public MyObjectDataProvider(List<MyObject> myObjects){
> >                 this.myObjects = myObjects;
> >         }
> >
> >         public Iterator<MyObject> iterator(int first, int count) {
> >                 return new
> ArrayList<MyObject>(myObjects.subList(first,
> > first+count)).iterator();
> >         }
> >
> >         public IModel model(Object arg0) {
> >                 return new MyObjectModel((MyObject)arg0);
> >         }
> >
> >         public int size() {
> >                 return myObjects.size();
> >         }
> >
> >         public void setMyObjects(
> >                         List<MyObject> myObjects) {
> >                 this.myObjects = myObjects;
> >         }
> >
> >         private final class MyObjectModel extends
> > LoadableDetachableModel{
> >
> >                 private static final long serialVersionUID =
> > 8575601860619558208L;
> >                 private MyObject psc;
> >
> >                 public MyObjectModel(MyObject psc){
> >                         this.psc = psc;
> >                 }
> >
> >                 @Override
> >                 protected Object load() {
> >                         return psc;
> >                 }
> >
> >                 @Override
> >                 public int hashCode(){
> >                         return psc.hashCode();
> >                 }
> >
> >                 @Override
> >                 public boolean equals(Object o){
> >                         if(this == o){
> >                                 return true;
> >                         }
> >                         if(o instanceof MyObjectModel){
> >                                 MyObjectModel that =
(MyObjectModel)o;
> >                                 if(this.psc == null ?
that.psc==null:
> > this.psc.equals(that.psc)){
> >                                         return true;
> >                                 }
> >                         }
> >                         return false;
> >                 }
> >         }
> > }
> >
> > class MyObjectDataView extends DataView {
> >
> >         private static final long serialVersionUID =
> > -5679706549137629007L;
> >
> >
> >         /**
> >          * Constructor.
> >          *
> >          * @param name of this Component
> >          * @param myObjectModel model containing list of MyObject
> > objects
> >          */
> >         public MyObjectDataView(String name, IDataProvider
> > myObjectDataProvider) {
> >                 super(name, myObjectDataProvider);
> >         }
> >
> >         @Override
> >         protected void populateItem(Item item) {
> >                 MyObject psc = (MyObject)item.getModelObject();
> >                 TextField field1 = new TextField("field1",new
> > PropertyModel(psc,"field1"));
> >                 site.setEnabled(false);
> >
> >                 TextField field2 = new TextField("field2",new
> > PropertyModel(psc,"field2"));
> >                 currency.setEnabled(false);
> >
> >                 item.add(field1);
> >                 item.add(field2);
> >                 item.add(new TextField("field3",new
> > PropertyModel(psc,"field3"))));
> >                 item.add(new TextField("field4",new
> > PropertyModel(psc,"field4"))));
> >                 item.add(new TextField("field5",new
> > PropertyModel(psc,"field5"))));
> >                 item.add(new CheckBox("field6",new
> > PropertyModel(psc,"field6"))));
> >         }
> > }
> >
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
> - -
> > - - - - - - -
> >
> > This message is intended only for the personal and confidential use
of
> the
> > designated recipient(s) named above.  If you are not the intended
> recipient
> > of this message you are hereby notified that any review,
> dissemination,
> > distribution or copying of this message is strictly prohibited.
This
> > communication is for information purposes only and should not be
> regarded as
> > an offer to sell or as a solicitation of an offer to buy any
financial
> > product, an official confirmation of any transaction, or as an
> official
> > statement of Lehman Brothers.  Email transmission cannot be
guaranteed
> to be
> > secure or error-free.  Therefore, we do not represent that this
> information
> > is complete or accurate and it should not be relied upon as such.
All
> > information is subject to change without notice.
> >
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
> - - - - - - -
>
> This message is intended only for the personal and confidential use of
the
> designated recipient(s) named above.  If you are not the intended
recipient
> of this message you are hereby notified that any review,
dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be
regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an
official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed
to be
> secure or error-free.  Therefore, we do not represent that this
information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.




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


Re: Page expiration

Posted by eagle yao <sh...@gmail.com>.
i use tomcat .But have the same problem.i used iframe in a page.,and
when i click several times,it's 'page expired'.it puzzled me all the
time.



2007/9/20, Swaroop Belur <sw...@gmail.com>:
> We are facing the same problem here - but its only with jetty and not with
> tomcat.
> After a re login everything seems to work fine. Its only the first time.
> (i guess the resource was loaded the next time.) The problem
> however does not occur with tomcat.
>
> -swaroop
>
> On 9/20/07, Holda, Dariusz <da...@lehman.com> wrote:
> >
> >
> > I don't have but from time to time I'm getting this error:
> > "ERROR
> > Unable to render resource stream
> > jar:file:/vendor/Wicket_ext/1.2.6/wicket-extensions-1.2.6.jar!/wicket/ex
> > tensions/markup/html/datepicker/style/aqua/menuarrow.gifwicket.WicketRun
> > timeException: Unable to render resource stream
> > jar:file:/vendor/Wicket_ext/1.2.6/wicket-extensions-1.2.6.jar!/wicket/ex
> > tensions/markup/html/datepicker/style/aqua/menuarrow.gif "
> >
> > Could this be the cause of the problem?
> >
> > Thx,
> > Dariusz
> >
> > -----Original Message-----
> > From: Dipu Seminlal [mailto:dipu.wkt@googlemail.com]
> > Sent: 20 September 2007 13:03
> > To: users@wicket.apache.org
> > Subject: Re: Page expiration
> >
> > Hi,
> >
> > Can you please check if you have any img tags in your html with empty
> > src
> > attributes ?
> >
> > Regards
> > Dipu
> >
> > On 9/20/07, Holda, Dariusz <da...@lehman.com> wrote:
> > >
> > >
> > > Hi,
> > > I've came across a strange behaviour. I'm running Wicket app on Jetty
> > > server and most of the times it's working fine but from time to time
> > I'm
> > > getting "Page expired" message even if user is actively using the app.
> > > Unfortunately it's not happening on the same events. Sometimes it's
> > > after pressing 'Save' after choosing a date in DatePicker, sometimes
> > > it's happening after clicking on a different tab after editing a
> > > textfield.
> > > Anyone has an idea what may be the cause of this problem?
> > > I'm using wicket-1.2.6 and each of the editable fields has an Ajax
> > > behaviour.
> > >
> > > Thx,
> > > Dariusz
> > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > - -
> > > - - - - - - -
> > >
> > > This message is intended only for the personal and confidential use of
> > the
> > > designated recipient(s) named above.  If you are not the intended
> > recipient
> > > of this message you are hereby notified that any review,
> > dissemination,
> > > distribution or copying of this message is strictly prohibited.  This
> > > communication is for information purposes only and should not be
> > regarded as
> > > an offer to sell or as a solicitation of an offer to buy any financial
> > > product, an official confirmation of any transaction, or as an
> > official
> > > statement of Lehman Brothers.  Email transmission cannot be guaranteed
> > to be
> > > secure or error-free.  Therefore, we do not represent that this
> > information
> > > is complete or accurate and it should not be relied upon as such.  All
> > > information is subject to change without notice.
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > - - - - - - -
> >
> > This message is intended only for the personal and confidential use of the
> > designated recipient(s) named above.  If you are not the intended recipient
> > of this message you are hereby notified that any review, dissemination,
> > distribution or copying of this message is strictly prohibited.  This
> > communication is for information purposes only and should not be regarded as
> > an offer to sell or as a solicitation of an offer to buy any financial
> > product, an official confirmation of any transaction, or as an official
> > statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
> > secure or error-free.  Therefore, we do not represent that this information
> > is complete or accurate and it should not be relied upon as such.  All
> > information is subject to change without notice.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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: Page expiration

Posted by Swaroop Belur <sw...@gmail.com>.
We are facing the same problem here - but its only with jetty and not with
tomcat.
After a re login everything seems to work fine. Its only the first time.
(i guess the resource was loaded the next time.) The problem
however does not occur with tomcat.

-swaroop

On 9/20/07, Holda, Dariusz <da...@lehman.com> wrote:
>
>
> I don't have but from time to time I'm getting this error:
> "ERROR
> Unable to render resource stream
> jar:file:/vendor/Wicket_ext/1.2.6/wicket-extensions-1.2.6.jar!/wicket/ex
> tensions/markup/html/datepicker/style/aqua/menuarrow.gifwicket.WicketRun
> timeException: Unable to render resource stream
> jar:file:/vendor/Wicket_ext/1.2.6/wicket-extensions-1.2.6.jar!/wicket/ex
> tensions/markup/html/datepicker/style/aqua/menuarrow.gif "
>
> Could this be the cause of the problem?
>
> Thx,
> Dariusz
>
> -----Original Message-----
> From: Dipu Seminlal [mailto:dipu.wkt@googlemail.com]
> Sent: 20 September 2007 13:03
> To: users@wicket.apache.org
> Subject: Re: Page expiration
>
> Hi,
>
> Can you please check if you have any img tags in your html with empty
> src
> attributes ?
>
> Regards
> Dipu
>
> On 9/20/07, Holda, Dariusz <da...@lehman.com> wrote:
> >
> >
> > Hi,
> > I've came across a strange behaviour. I'm running Wicket app on Jetty
> > server and most of the times it's working fine but from time to time
> I'm
> > getting "Page expired" message even if user is actively using the app.
> > Unfortunately it's not happening on the same events. Sometimes it's
> > after pressing 'Save' after choosing a date in DatePicker, sometimes
> > it's happening after clicking on a different tab after editing a
> > textfield.
> > Anyone has an idea what may be the cause of this problem?
> > I'm using wicket-1.2.6 and each of the editable fields has an Ajax
> > behaviour.
> >
> > Thx,
> > Dariusz
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - -
> > - - - - - - -
> >
> > This message is intended only for the personal and confidential use of
> the
> > designated recipient(s) named above.  If you are not the intended
> recipient
> > of this message you are hereby notified that any review,
> dissemination,
> > distribution or copying of this message is strictly prohibited.  This
> > communication is for information purposes only and should not be
> regarded as
> > an offer to sell or as a solicitation of an offer to buy any financial
> > product, an official confirmation of any transaction, or as an
> official
> > statement of Lehman Brothers.  Email transmission cannot be guaranteed
> to be
> > secure or error-free.  Therefore, we do not represent that this
> information
> > is complete or accurate and it should not be relied upon as such.  All
> > information is subject to change without notice.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - -
>
> This message is intended only for the personal and confidential use of the
> designated recipient(s) named above.  If you are not the intended recipient
> of this message you are hereby notified that any review, dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
> secure or error-free.  Therefore, we do not represent that this information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: Page expiration

Posted by "Holda, Dariusz" <da...@lehman.com>.
I don't have but from time to time I'm getting this error:
"ERROR
Unable to render resource stream
jar:file:/vendor/Wicket_ext/1.2.6/wicket-extensions-1.2.6.jar!/wicket/ex
tensions/markup/html/datepicker/style/aqua/menuarrow.gifwicket.WicketRun
timeException: Unable to render resource stream
jar:file:/vendor/Wicket_ext/1.2.6/wicket-extensions-1.2.6.jar!/wicket/ex
tensions/markup/html/datepicker/style/aqua/menuarrow.gif "

Could this be the cause of the problem?

Thx,
Dariusz

-----Original Message-----
From: Dipu Seminlal [mailto:dipu.wkt@googlemail.com] 
Sent: 20 September 2007 13:03
To: users@wicket.apache.org
Subject: Re: Page expiration

Hi,

Can you please check if you have any img tags in your html with empty
src
attributes ?

Regards
Dipu

On 9/20/07, Holda, Dariusz <da...@lehman.com> wrote:
>
>
> Hi,
> I've came across a strange behaviour. I'm running Wicket app on Jetty
> server and most of the times it's working fine but from time to time
I'm
> getting "Page expired" message even if user is actively using the app.
> Unfortunately it's not happening on the same events. Sometimes it's
> after pressing 'Save' after choosing a date in DatePicker, sometimes
> it's happening after clicking on a different tab after editing a
> textfield.
> Anyone has an idea what may be the cause of this problem?
> I'm using wicket-1.2.6 and each of the editable fields has an Ajax
> behaviour.
>
> Thx,
> Dariusz
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
> - - - - - - -
>
> This message is intended only for the personal and confidential use of
the
> designated recipient(s) named above.  If you are not the intended
recipient
> of this message you are hereby notified that any review,
dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be
regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an
official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed
to be
> secure or error-free.  Therefore, we do not represent that this
information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.




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


Re: Page expiration

Posted by Dipu Seminlal <di...@googlemail.com>.
Hi,

Can you please check if you have any img tags in your html with empty src
attributes ?

Regards
Dipu

On 9/20/07, Holda, Dariusz <da...@lehman.com> wrote:
>
>
> Hi,
> I've came across a strange behaviour. I'm running Wicket app on Jetty
> server and most of the times it's working fine but from time to time I'm
> getting "Page expired" message even if user is actively using the app.
> Unfortunately it's not happening on the same events. Sometimes it's
> after pressing 'Save' after choosing a date in DatePicker, sometimes
> it's happening after clicking on a different tab after editing a
> textfield.
> Anyone has an idea what may be the cause of this problem?
> I'm using wicket-1.2.6 and each of the editable fields has an Ajax
> behaviour.
>
> Thx,
> Dariusz
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - -
>
> This message is intended only for the personal and confidential use of the
> designated recipient(s) named above.  If you are not the intended recipient
> of this message you are hereby notified that any review, dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
> secure or error-free.  Therefore, we do not represent that this information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Page expiration

Posted by "Holda, Dariusz" <da...@lehman.com>.
Hi,
I've came across a strange behaviour. I'm running Wicket app on Jetty
server and most of the times it's working fine but from time to time I'm
getting "Page expired" message even if user is actively using the app.
Unfortunately it's not happening on the same events. Sometimes it's
after pressing 'Save' after choosing a date in DatePicker, sometimes
it's happening after clicking on a different tab after editing a
textfield. 
Anyone has an idea what may be the cause of this problem?
I'm using wicket-1.2.6 and each of the editable fields has an Ajax
behaviour.

Thx,
Dariusz
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.




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


Re: DataView paging

Posted by Igor Vaynberg <ig...@gmail.com>.
it would be trivial to write a jdbc dao impl for the phonebook as well.

-igor


On 9/11/07, Holda, Dariusz <da...@lehman.com> wrote:
>
>
> Sorry for late response. I was dragged to another task.
> Thanks for pointing  me to the svn repository, it helped a lot. Shame I
> can't use Hibernate or Ibatis as you do in your project.
>
> Thanks again,
> Dariusz
>
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: 31 August 2007 16:50
> To: users@wicket.apache.org
> Subject: Re: DataView paging
>
> you are holding on to the entire list in your data provider, this is
> bad.
> you should only load the pieces of your list you need.
>
> further your loadabledetachablemodel is broken since you hold on to the
> actual object itself. loadabel detachable models are meant to hold on to
> the
> id, and in load() load the object from the database based on that id
>
> makes sense? see wicket-phonebook example in wicket-stuff svn.
>
> -igor
>
>
> On 8/31/07, Holda, Dariusz <da...@lehman.com> wrote:
> >
> >
> > Hi,
> > I'm using my implementation of a DataView to display list of objects
> > that are own by another object.
> > I wrote my IDataProvider and LoadableDetachableModel so I can page
> > through the list - the list is quite long it can even have 5000, 6000
> > objects.
> > I'm displaying 10 rows on each page.
> > When I run application locally from my eclipse, everything is fine but
> > when I run it on a server the delay during page changing is
> significant
> > e.g. 3 or more seconds.
> > Could someone advise me on this issue?
> > I'm attaching code snippets.
> >
> > class MyObjectDataProvider implements IDataProvider {
> >
> >         private static final long serialVersionUID =
> > -254289478999293765L;
> >         private List<MyObject> myObjects;
> >
> >         public MyObjectDataProvider(List<MyObject> myObjects){
> >                 this.myObjects = myObjects;
> >         }
> >
> >         public Iterator<MyObject> iterator(int first, int count) {
> >                 return new
> ArrayList<MyObject>(myObjects.subList(first,
> > first+count)).iterator();
> >         }
> >
> >         public IModel model(Object arg0) {
> >                 return new MyObjectModel((MyObject)arg0);
> >         }
> >
> >         public int size() {
> >                 return myObjects.size();
> >         }
> >
> >         public void setMyObjects(
> >                         List<MyObject> myObjects) {
> >                 this.myObjects = myObjects;
> >         }
> >
> >         private final class MyObjectModel extends
> > LoadableDetachableModel{
> >
> >                 private static final long serialVersionUID =
> > 8575601860619558208L;
> >                 private MyObject psc;
> >
> >                 public MyObjectModel(MyObject psc){
> >                         this.psc = psc;
> >                 }
> >
> >                 @Override
> >                 protected Object load() {
> >                         return psc;
> >                 }
> >
> >                 @Override
> >                 public int hashCode(){
> >                         return psc.hashCode();
> >                 }
> >
> >                 @Override
> >                 public boolean equals(Object o){
> >                         if(this == o){
> >                                 return true;
> >                         }
> >                         if(o instanceof MyObjectModel){
> >                                 MyObjectModel that = (MyObjectModel)o;
> >                                 if(this.psc == null ? that.psc==null:
> > this.psc.equals(that.psc)){
> >                                         return true;
> >                                 }
> >                         }
> >                         return false;
> >                 }
> >         }
> > }
> >
> > class MyObjectDataView extends DataView {
> >
> >         private static final long serialVersionUID =
> > -5679706549137629007L;
> >
> >
> >         /**
> >          * Constructor.
> >          *
> >          * @param name of this Component
> >          * @param myObjectModel model containing list of MyObject
> > objects
> >          */
> >         public MyObjectDataView(String name, IDataProvider
> > myObjectDataProvider) {
> >                 super(name, myObjectDataProvider);
> >         }
> >
> >         @Override
> >         protected void populateItem(Item item) {
> >                 MyObject psc = (MyObject)item.getModelObject();
> >                 TextField field1 = new TextField("field1",new
> > PropertyModel(psc,"field1"));
> >                 site.setEnabled(false);
> >
> >                 TextField field2 = new TextField("field2",new
> > PropertyModel(psc,"field2"));
> >                 currency.setEnabled(false);
> >
> >                 item.add(field1);
> >                 item.add(field2);
> >                 item.add(new TextField("field3",new
> > PropertyModel(psc,"field3"))));
> >                 item.add(new TextField("field4",new
> > PropertyModel(psc,"field4"))));
> >                 item.add(new TextField("field5",new
> > PropertyModel(psc,"field5"))));
> >                 item.add(new CheckBox("field6",new
> > PropertyModel(psc,"field6"))));
> >         }
> > }
> >
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - -
> > - - - - - - -
> >
> > This message is intended only for the personal and confidential use of
> the
> > designated recipient(s) named above.  If you are not the intended
> recipient
> > of this message you are hereby notified that any review,
> dissemination,
> > distribution or copying of this message is strictly prohibited.  This
> > communication is for information purposes only and should not be
> regarded as
> > an offer to sell or as a solicitation of an offer to buy any financial
> > product, an official confirmation of any transaction, or as an
> official
> > statement of Lehman Brothers.  Email transmission cannot be guaranteed
> to be
> > secure or error-free.  Therefore, we do not represent that this
> information
> > is complete or accurate and it should not be relied upon as such.  All
> > information is subject to change without notice.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - -
>
> This message is intended only for the personal and confidential use of the
> designated recipient(s) named above.  If you are not the intended recipient
> of this message you are hereby notified that any review, dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
> secure or error-free.  Therefore, we do not represent that this information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

RE: DataView paging

Posted by "Holda, Dariusz" <da...@lehman.com>.
Sorry for late response. I was dragged to another task.
Thanks for pointing  me to the svn repository, it helped a lot. Shame I
can't use Hibernate or Ibatis as you do in your project. 

Thanks again,
Dariusz 
 

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: 31 August 2007 16:50
To: users@wicket.apache.org
Subject: Re: DataView paging

you are holding on to the entire list in your data provider, this is
bad.
you should only load the pieces of your list you need.

further your loadabledetachablemodel is broken since you hold on to the
actual object itself. loadabel detachable models are meant to hold on to
the
id, and in load() load the object from the database based on that id

makes sense? see wicket-phonebook example in wicket-stuff svn.

-igor


On 8/31/07, Holda, Dariusz <da...@lehman.com> wrote:
>
>
> Hi,
> I'm using my implementation of a DataView to display list of objects
> that are own by another object.
> I wrote my IDataProvider and LoadableDetachableModel so I can page
> through the list - the list is quite long it can even have 5000, 6000
> objects.
> I'm displaying 10 rows on each page.
> When I run application locally from my eclipse, everything is fine but
> when I run it on a server the delay during page changing is
significant
> e.g. 3 or more seconds.
> Could someone advise me on this issue?
> I'm attaching code snippets.
>
> class MyObjectDataProvider implements IDataProvider {
>
>         private static final long serialVersionUID =
> -254289478999293765L;
>         private List<MyObject> myObjects;
>
>         public MyObjectDataProvider(List<MyObject> myObjects){
>                 this.myObjects = myObjects;
>         }
>
>         public Iterator<MyObject> iterator(int first, int count) {
>                 return new
ArrayList<MyObject>(myObjects.subList(first,
> first+count)).iterator();
>         }
>
>         public IModel model(Object arg0) {
>                 return new MyObjectModel((MyObject)arg0);
>         }
>
>         public int size() {
>                 return myObjects.size();
>         }
>
>         public void setMyObjects(
>                         List<MyObject> myObjects) {
>                 this.myObjects = myObjects;
>         }
>
>         private final class MyObjectModel extends
> LoadableDetachableModel{
>
>                 private static final long serialVersionUID =
> 8575601860619558208L;
>                 private MyObject psc;
>
>                 public MyObjectModel(MyObject psc){
>                         this.psc = psc;
>                 }
>
>                 @Override
>                 protected Object load() {
>                         return psc;
>                 }
>
>                 @Override
>                 public int hashCode(){
>                         return psc.hashCode();
>                 }
>
>                 @Override
>                 public boolean equals(Object o){
>                         if(this == o){
>                                 return true;
>                         }
>                         if(o instanceof MyObjectModel){
>                                 MyObjectModel that = (MyObjectModel)o;
>                                 if(this.psc == null ? that.psc==null:
> this.psc.equals(that.psc)){
>                                         return true;
>                                 }
>                         }
>                         return false;
>                 }
>         }
> }
>
> class MyObjectDataView extends DataView {
>
>         private static final long serialVersionUID =
> -5679706549137629007L;
>
>
>         /**
>          * Constructor.
>          *
>          * @param name of this Component
>          * @param myObjectModel model containing list of MyObject
> objects
>          */
>         public MyObjectDataView(String name, IDataProvider
> myObjectDataProvider) {
>                 super(name, myObjectDataProvider);
>         }
>
>         @Override
>         protected void populateItem(Item item) {
>                 MyObject psc = (MyObject)item.getModelObject();
>                 TextField field1 = new TextField("field1",new
> PropertyModel(psc,"field1"));
>                 site.setEnabled(false);
>
>                 TextField field2 = new TextField("field2",new
> PropertyModel(psc,"field2"));
>                 currency.setEnabled(false);
>
>                 item.add(field1);
>                 item.add(field2);
>                 item.add(new TextField("field3",new
> PropertyModel(psc,"field3"))));
>                 item.add(new TextField("field4",new
> PropertyModel(psc,"field4"))));
>                 item.add(new TextField("field5",new
> PropertyModel(psc,"field5"))));
>                 item.add(new CheckBox("field6",new
> PropertyModel(psc,"field6"))));
>         }
> }
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
> - - - - - - -
>
> This message is intended only for the personal and confidential use of
the
> designated recipient(s) named above.  If you are not the intended
recipient
> of this message you are hereby notified that any review,
dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be
regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an
official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed
to be
> secure or error-free.  Therefore, we do not represent that this
information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.




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


Re: DataView paging

Posted by Igor Vaynberg <ig...@gmail.com>.
you are holding on to the entire list in your data provider, this is bad.
you should only load the pieces of your list you need.

further your loadabledetachablemodel is broken since you hold on to the
actual object itself. loadabel detachable models are meant to hold on to the
id, and in load() load the object from the database based on that id

makes sense? see wicket-phonebook example in wicket-stuff svn.

-igor


On 8/31/07, Holda, Dariusz <da...@lehman.com> wrote:
>
>
> Hi,
> I'm using my implementation of a DataView to display list of objects
> that are own by another object.
> I wrote my IDataProvider and LoadableDetachableModel so I can page
> through the list - the list is quite long it can even have 5000, 6000
> objects.
> I'm displaying 10 rows on each page.
> When I run application locally from my eclipse, everything is fine but
> when I run it on a server the delay during page changing is significant
> e.g. 3 or more seconds.
> Could someone advise me on this issue?
> I'm attaching code snippets.
>
> class MyObjectDataProvider implements IDataProvider {
>
>         private static final long serialVersionUID =
> -254289478999293765L;
>         private List<MyObject> myObjects;
>
>         public MyObjectDataProvider(List<MyObject> myObjects){
>                 this.myObjects = myObjects;
>         }
>
>         public Iterator<MyObject> iterator(int first, int count) {
>                 return new ArrayList<MyObject>(myObjects.subList(first,
> first+count)).iterator();
>         }
>
>         public IModel model(Object arg0) {
>                 return new MyObjectModel((MyObject)arg0);
>         }
>
>         public int size() {
>                 return myObjects.size();
>         }
>
>         public void setMyObjects(
>                         List<MyObject> myObjects) {
>                 this.myObjects = myObjects;
>         }
>
>         private final class MyObjectModel extends
> LoadableDetachableModel{
>
>                 private static final long serialVersionUID =
> 8575601860619558208L;
>                 private MyObject psc;
>
>                 public MyObjectModel(MyObject psc){
>                         this.psc = psc;
>                 }
>
>                 @Override
>                 protected Object load() {
>                         return psc;
>                 }
>
>                 @Override
>                 public int hashCode(){
>                         return psc.hashCode();
>                 }
>
>                 @Override
>                 public boolean equals(Object o){
>                         if(this == o){
>                                 return true;
>                         }
>                         if(o instanceof MyObjectModel){
>                                 MyObjectModel that = (MyObjectModel)o;
>                                 if(this.psc == null ? that.psc==null:
> this.psc.equals(that.psc)){
>                                         return true;
>                                 }
>                         }
>                         return false;
>                 }
>         }
> }
>
> class MyObjectDataView extends DataView {
>
>         private static final long serialVersionUID =
> -5679706549137629007L;
>
>
>         /**
>          * Constructor.
>          *
>          * @param name of this Component
>          * @param myObjectModel model containing list of MyObject
> objects
>          */
>         public MyObjectDataView(String name, IDataProvider
> myObjectDataProvider) {
>                 super(name, myObjectDataProvider);
>         }
>
>         @Override
>         protected void populateItem(Item item) {
>                 MyObject psc = (MyObject)item.getModelObject();
>                 TextField field1 = new TextField("field1",new
> PropertyModel(psc,"field1"));
>                 site.setEnabled(false);
>
>                 TextField field2 = new TextField("field2",new
> PropertyModel(psc,"field2"));
>                 currency.setEnabled(false);
>
>                 item.add(field1);
>                 item.add(field2);
>                 item.add(new TextField("field3",new
> PropertyModel(psc,"field3"))));
>                 item.add(new TextField("field4",new
> PropertyModel(psc,"field4"))));
>                 item.add(new TextField("field5",new
> PropertyModel(psc,"field5"))));
>                 item.add(new CheckBox("field6",new
> PropertyModel(psc,"field6"))));
>         }
> }
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - -
>
> This message is intended only for the personal and confidential use of the
> designated recipient(s) named above.  If you are not the intended recipient
> of this message you are hereby notified that any review, dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
> secure or error-free.  Therefore, we do not represent that this information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>