Hi,

This wont be very easy :-/

The problem is that you will need to provide MarkupStream which index
is set at the proper position for the markup of the label.
If you make this working then you need to do:

StringResponse tempResponse = new StringResponse();
Response oldResponse = requestCycle.setResponse(tempResponse);
String labelMarkup = "";
try {
   // set markupStream index
   label.render();
} finally {
   requestCycle.setResponse(oldResponse);
   labelMarkup = tempResponse.getContent();
}

and finally use 'labelMarkup' when constructing the body of MyMatrix.

As I said - it wont be easy. But it is not impossible too.

On Thu, Oct 18, 2012 at 10:04 PM, lukuperman <[email protected]> wrote:
> Martin,
> the webmarkupcontainer I created looks like this:
>
> public class MyMatrix extends WebMarkupContainer {
>    ...
>    @Override
>    protected void onComponentTagBody(MarkupStream markupStream, ComponentTag
> openTag) {
>       StringBuilder body = new StringBuilder();
>       ...
>       replaceComponentTagBody(markupStream, openTag, body);
>    }
> }
>
> And I would like to reuse a custom label I created and append it to the body
> string. My label looks like:
>
> public class AbbreviatedLabel extends Label
>    ...
>    @Override
>    protected void onComponentTagBody(MarkupStream markupStream, ComponentTag
> openTag) {
>       StringBuffer label = new StringBuffer();
>       <some string manipulation>
>       replaceComponentTagBody(markupStream, openTag, label);
>    }
> }
>
>
> Thanks in advance
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/performance-on-nested-dataviews-tp4652673p4653074.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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

Reply via email to