It just saves a few lines of code.

yourPanel.add(new AjaxLink("foo"){
   private static final long serialVersionUID = 0L;
   @Override
   public void onClick(AjaxRequestTarget target)
   {
      yourModalWindow.show(target);
   });

vs.

yourPanel.add(yourModalWindow.createAjaxLink("foo"));

It's purely a convenience method, but to my eyes it reads a bit more cleanly.

Scott


On 5/14/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
> Hi.
>
> Not that I know of :) But what is it supposed to solve?
>
> -Matej
>
> On 5/14/07, Scott Swank <[EMAIL PROTECTED]> wrote:
> > Is there any reason not to have a factory method like the following on
> > ModalWindow?
> >
> >         public AjaxLink createAjaxLink(String linkId)
> >         {
> >                 return new AjaxLink(linkId)
> >                 {
> >                         private static final long serialVersionUID = 0L;
> >
> >                         @Override
> >                         public void onClick(AjaxRequestTarget target)
> >                         {
> >                                 ModalWindow.this.show(target);
> >                         }
> >                 };
> >         }
> >
> > Thank you,
> > Scott
> >
> > --
> > Scott Swank
> > reformed mathematician
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-- 
Scott Swank
reformed mathematician

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to