As Igor mentioned. It is completely fine to use. Nothing wrong with it.
Juergen
On 11/20/05, Andrew Lombardi [EMAIL PROTECTED] wrote:
So, I see all this talk of using static factory methods to generate a
Page, but what would be wrong with just using
add(new Link(myLink) {
public
i said the static factories are only useful when you have bookmarkable pages with parameters. that means you need to create a PageParameters, fill it in, and pass it into the page's constructor. i said, imho, it is much better to have a static factory method on the page that does that because you
So, I see all this talk of using static factory methods to generate a
Page, but what would be wrong with just using
add(new Link(myLink) {
public void onClick() {
setResponsePage(new MyPage(param1, param2, param3));
}
};
this looks like it ensures that the page
Hi all,
I wanted to know what's the best way to use Links (PageLinks,
BookmarkablePageLinks).
In the beginning, I was using BookmarkablePageLink's and converting
everything to and from Strings. That obviously was flawed, as I was using
string names and passing them back and forth (lost
imho that is the best practice. that is what i use whenever i do not need a bookmarkable page. i have yet to use the PageLink class. PageLink makes it easier to create links to pages because it lets you specify the class name of the page or the created page instance. This is ok for pages that are
If it's OK to write a little more code, you could use a factory for
the page with the same signature your constructor uses. In my opinion
this could be more elegant, but what Igor said is simpler. Something
like (not tested):
// reusable class
public interface IPageCreator {
Page
Actually what i meant was a simple static factory method that translates strongly typed params into PageParameters.ieclass MyBookmarkablePage extends WebPage { public MyBookmarkablePage(PageParameters params) {
... } public static MyBookmarkablePage(String p1, int p2, String p3) { PageParameters
Yeah, I just forgot IPageLink and PageLink (by the way these names can
be quite confusing!), so ignore my classes, but I keep my point :P.
2005/11/18, Igor Vaynberg [EMAIL PROTECTED]:
Actually what i meant was a simple static factory method that translates
strongly typed params into