also you dont need the attribute modifier, you can override oncomponenttag
in the errorindicator and perform the same function

-igor


On 4/23/07, M.A.Bednarz <[EMAIL PROTECTED]> wrote:

 Perfect ! It works !

Here is my resulting code:

*

public
* *class* ErrorIndicator *extends* WebMarkupContainer {

FormComponent component;

*private* *final* *static* SimpleAttributeModifier *errorIndicator* =

*new* SimpleAttributeModifier("class", "errorindicator");

*public* ErrorIndicator(String id, FormComponent component) {

*super*(id);

*this*.component = component;

*this*.setVersioned(*false*);

*this*.add(*errorIndicator*);

*this*.setRenderBodyOnly(*true*);

}

*public* *boolean* isVisible() {

*return* *this*.component.hasErrorMessage();

}

/**

* [EMAIL PROTECTED] wicket.MarkupContainer#onComponentTagBody(
wicket.markup.MarkupStream, wicket.markup.ComponentTag)

*/

@Override

*protected* *void* onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {

replaceComponentTagBody(markupStream, openTag, *this*.component
.getFeedbackMessage().getMessage());

}

}
Maciek

----- Original Message -----
*From:* Igor Vaynberg <[EMAIL PROTECTED]>
*To:* M.A.Bednarz <[EMAIL PROTECTED]> ;
wicket-user@lists.sourceforge.net
*Sent:* Monday, April 23, 2007 7:27 PM
*Subject:* Re: [Wicket-user] Set different output for WebMarkupContainer

see label.java, mainly oncomponenttagbody()

-igor

On 4/23/07, M.A.Bednarz <[EMAIL PROTECTED] > wrote:
>
> Hi all,
>
> i think the question might be quite simple to answer but I do not have
> the
> time to investigate and search the api.
> I have the following pice of code:
>
> public class ErrorIndicator extends WebMarkupContainer {
>
>     FormComponent component;
>
>     private final static SimpleAttributeModifier errorIndicator =
>      new SimpleAttributeModifier("class", "errorindicator");
>
>     public ErrorIndicator(String id, FormComponent component) {
>        super(id);
>        this.component = component;
>        add(errorIndicator);
>     }
>
>     public boolean isVisible() {
>        return this.component.hasErrorMessage();
>     }
> }
>
> Displayed by following html
>
> <span wicket:id="error_field">....</span>
>
>
> My question is, how to replace the three dots runtime?
>
> Thank you very much,
>
> Maciek
>
>
>
> -------------------------------------------------------------------------
> 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


-------------------------------------------------------------------------
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

Reply via email to