ulliard.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
tract
>> class ContentHoldingPage extend TheBasePage.
>>
>> ++
>>
>> -----------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional command
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, f
ing 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 ab
t's a specific kind of structured page, for example an abstract
> > class ContentHoldingPage extend TheBasePage.
> >
> > ++
> >
> > -------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.or
Page.
>
> ++
>
> -
> 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 :
link.add(new
> >>>> Label("linkRequestTxt",String.valueOf(audit.getRequest().getId(;
> >>>> item.add(link);
> >>>>
> >>>> } else {
> >>>> link =
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 personall
itional 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-conditi
cmoulliard wrote:
(...)
I think that this is a general remark that some users make about Wicket. It
is very difficult to reuse part of the code.
Here is another example :
I have a label called id which is used in different page. The way proposes
by Wicket to code it is
Page Request
item.add
gt;>>> audit.getRequest().getId() );
>> >>>>
>> >>>> link = new Link("linkRequest") {
>> >>>>
>> >>>> @Ove
tring.valueOf(audit.getRequest().getId())));
> >>>> item.add(link);
> >>>>
> >>>> } else {
> >>>> link = new Link("linkRequest") {
> >>>>
> >>
Hi
Yes there'll always be some repetition. Depending on your logic you
might also stuff the first block in the onClick event to generate the
model if it's not used anywhere else. That could eliminate the first block.
The problem about reusable components in wicket is that probably you
might
this.setEnabled(false);
>>>> }
>>>>
>>>> };
>>>> Label label = new Label("linkRequestTxt","");
>>>> link.add(label);
>>>&
Hi
As I said in my previous mail, just initialize the link once using the
upper variant.
Use an if before to create the requestFormModel, in case 2, the
requestFormModel can be null - as the onClick is never executed this
will not matter.
Have something like:
final Model requestFormModel;
if
er
>>
>> *
>> blog : http://cmoulliard.blogspot.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: u
Sure, just create it (including the onClick which might be invalid), but
afterwards set the setEnabled() as needed.
As long as the link is disabled, it can never be clicked thus the
onClick() will never be executed anyway, so it's irrelevant if the
requestFormModel is valid or not...
I dont th
Hi,
I would like to know if there is a better way to code this case : What
I would like to do is to enable/disable a link depending on a
condition. If the condition is true, than we create the link otherwise
we disable it. In both case, a label must be defined for the Link.
I mean, is it possible
18 matches
Mail list logo