Please see the following code:

        private static class RequiredLabel extends SimpleFormComponentLabel
        {
                private static final long serialVersionUID = 
5132250047993256659L;
                
                //private boolean required;
                FormComponent fc;
                
                public RequiredLabel(String id, FormComponent fc)
                {
                        super(id, fc);
                        //this.required = fc.isRequired();
                        this.fc = fc;
                }

                @Override
                protected void onComponentTag(ComponentTag tag)
                {
                        super.onComponentTag(tag);
                        if (fc.isRequired()) {
                                getResponse().write("*"); 
                        }
                        else {
                                 // ?? how do I remove the previously placed
"*"
                        }
                }
        }

RequiredLabel is a label that is used with a FormComponent. It is used to
put the red asterisk to show that input to the field is required.   But what
happens is that on an ajax request the red asterisks keep on piling up.  And
I have a case where the field may be changed to be not required.   How do I
remove the previosly placed red asterisk?

Thanks. 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/editing-response-in-onComponentTag-tp4671062.html
Sent from the Users forum 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

Reply via email to