Jeremy:you say "2 - don't call setEnabled() - override isEnabled"
why is better override isEnable then setEnable? thanks NM On Mon, Sep 21, 2009 at 9:44 AM, cmoulliard <cmoulli...@gmail.com> wrote: > > Joseph, > > Can you explain a little bit what you mean by provide it with attribute > (IModel<String>) ? > > private Label labelTitle; > public static Label createLabelTitle(String title) { > return new Label("title",new Model( title )); > } > > --> becomes > > private Label labelTitle; > public static Label createLabelTitle(String title) { > return new Label(title,new PropertyModel( ModelClass, title > )); > } > > Is it right what I create ? > > > Joseph Pachod wrote: > > > > cmoulliard wrote: > >> What I have done to avoid to repeat the creation of the labels is to > >> define > >> and use static method > >> > >> private Label labelTitle; > >> public static Label getLabelTitle(String title) { > >> return new Label("title",new Model( title )); > >> } > >> > > I personally would name this method createLabelTitle(String title) or > > getNewLabelTitle(String title), for explicitness. > > > > Furthermore, I would directly provide it with a "final IModel<String> > > title" attribute, not to dictate how the data has to be provided > > (dynamic or not for example). > > > > In the end, this method is fine for just a label, but for anything more > > complex a panel would be the way to go I would say. The main exception > > here I see right now is the case of pages. > > > > For example, if we're speaking of a page title, then I would define it > > in my base page and make an abstract String getTitle() method in the > > base page so I'm sure everyone set it up later on. I would do the same > > if it's a specific kind of structured page, for example an abstract > > class ContentHoldingPage extend TheBasePage. > > > > ++ > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > > ----- > Charles Moulliard > SOA Architect > > My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ > -- > View this message in context: > http://www.nabble.com/Is-it-the-best-way-to-code-a-Link-depending-on-a-condition-tp25488603p25530206.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >