Well, in my case, the underlying data is static. Images are not going
to be dynamically removed. If an exception is thrown, I wish for it to
be fatal. I'm just trying to mirror the design in Hibernate: you can
choose to catch StaleObjectStateException or not. Either way, it only
rarely gets thrown if the underlying data may change and if the data
can't be change it never gets thrown.
The reason you want to force developers to catch it is because it
usually indicates the original request is no longer valid. That is, if
the user operated on data which has been changed or removed then he
should be reprompted for input because there is no graceful way to
recover. Using my image browsing gallery as an example, say the user
clicks "next" to move to the next page in the set of images, and we find
out some images were removed, in *my* implementation I would catch the
exception, find out what the last image is and ensure that the user sees
the last page because that's what he meant to do... move forward, not back.
I really think this is a domain-specific thing. You can't know ahead of
time what the developers will want to do.
Gili
Igor Vaynberg wrote:
If we do add an exception we will be on the other side of the fence, the
user now HAS to handle it. Personally, I wouldn't want to have a try catch
block everytime I have a dataview for something that can be handled for me
automatically. What else would you do inside that catch block other then
redirect to first or last page?
Last time I checked setStartIndex() is public so you are more then welcome
to override it.
Public setStartIndex(int index) {
if (index<0||index>==getItemCount()) {
throw new IndexOutOfBoundsException();
}
super.setStartIndex(index);
}
-Igor
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gili
Sent: Tuesday, August 16, 2005 2:05 PM
To: [email protected]
Subject: [Wicket-user] RE: DataView.setStartIndex() (Igor Vaynberg)
Im not sure this is a good idea. For example, when using
pageabledataview lets say at the time of request 1 you have
4 pages so
the navigator will draw 4 links, use clicks page 4 and at that time
there are only 3 pages because some rows were deleted. In this
situation would you like to deal with the exception or just let the
listview default back to first page and only draw 3
navigation links?
When the new navigation is done we can make it smarter and
based on the index default ot the first or last page.
Well, if the user wishes to catch the exception and
redirect to index zero instead that's his choice to make but
right now we're not even giving people the choice.
Gili
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference &
EXPO September 19-22, 2005 * San Francisco, CA * Development
Lifecycle Practices Agile & Plan-Driven Development *
Managing Projects & Teams * Testing & QA Security * Process
Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
--
http://www.desktopbeautifier.com/
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user