This is the code (wicket 1.3 rc1)
add(new AjaxEditableMultiLineLabel("Comment", new
PropertyModel(experiment, "experimentDetailStat.Comment")){
/*
@Override
protected void onEdit(AjaxRequestTarget target) {
if(isEnabled()){
super.onEdit(target);
}
}
*/
@Override
protected void onSubmit(AjaxRequestTarget target) {
super.onSubmit(target);
Util.getBean(GenericLocal.class).saveObject(
experiment.getExperimentDetailStat());
}
}.setEnabled(LoginSession.get().isAdmin()));
and I tested by replacing the LoginSession.get().isAdmin() by false but I'm
still able to edit that field
Regards
Francis
On 11/21/07, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
>
> Francis,
> i would really be interested in your code that doesn't seem to work, if
> you
> don't mind.
> as of before Al's fix, it already worked for me because:
>
> the label is dis-/enabled in AjaxEditableLabel#onBeforeRender:
> label.setEnabled(isEnableAllowed() && isEnabled());
>
> and since the LabelAjaxBehavior is derived from AjaxEventBehavior, the
> eventhandler is only rendered,
> if the associated component is enabled. see
> AjaxEventBehavior#onComponentTag
>
> regards,
> Gerolf
>
> On Nov 21, 2007 1:26 PM, Francis De Brabandere <[EMAIL PROTECTED]>
> wrote:
>
> > ok, i'll check on next release
> >
> > On Nov 21, 2007 12:56 PM, Al Maw <[EMAIL PROTECTED]> wrote:
> >
> > > Francis De Brabandere wrote:
> > > > doing setEnabled(false) on a AjaxEditableMultiLineLabel does not
> > disable
> > > the
> > > > editing feature
> > > >
> > > > this can be fixed by overriding onEdit():
> > > >
> > > > @Override
> > > > protected void onEdit(AjaxRequestTarget target) {
> > > > if(isEnabled()){
> > > > super.onEdit(target);
> > > > }
> > > > }
> > > >
> > > > but shouldn't this be changed in the AjaxEditableMultiLineLabel
> > source?
> > > >
> > > > ps: this might be needed on other ajax edit lables too
> > >
> > > It is. This should now be fixed in trunk.
> > >
> > > Regards,
> > >
> > > Al
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > http://www.somatik.be
> > Microsoft gives you windows, Linux gives you the whole house.
> >
>
--
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.