Arg, I wanted to make my changes bold. But now I see stars. Not sure if you get those too, but if you do: leave out the stars :)

Linda van der Pal wrote:
quote: "To keep the models of the nested components and the top component synchronized, we need to override two methods: onBeforeRender, which prepares for rendering,
and convertInput, which handles receiving input."

So your code would become something like this:

public class LimitedTextArea extends FormComponentPanel implements
IHeaderContributor {
*private String text;
private TextArea textField;
*    public LimitedTextArea(String id, IModel model, int limit) {
       super(id, model);
*    PropertyModel textModel = new PropertyModel(this, "text");*
       *textField *= new TextArea("content", *textModel*);
       add(textField);
       ...
   }

*...@override public void onBeforeRender() {
    text = (String) getModelObject();
    super.onBeforeRender();
}

@Override
public void convertInput() {
    String text = (String) textField.getConvertedInput();
    setConvertedInput(text);
}

*}

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to