Hi Maxim,

On Thu, Oct 13, 2016 at 6:10 PM, Maxim Solodovnik <solomax...@gmail.com>
wrote:

> Hello All,
>
> I'm successfully using following code [1] to get Panel as String
> Unfortunately It is not possible to get Fragment as String this way :(
>

You can replace your util with ComponentRenderer#renderComponent()
https://github.com/apache/wicket/blob/70606d73e9165d37c1d8b7c7820279fb4be18770/wicket-core/src/main/java/org/apache/wicket/core/util/string/ComponentRenderer.java#L86
The problem here is that your helper page doesn't provide the Fragment's
markup. Someone has to provide it.


>
> The goal I'm trying to achieve is: store email subject as wicket:fragment
>
> Another question is: is it possible to edit markup like this
> <span wicket:id="aa1"></span> - <span wicket:id="aa2"></span> <span
> wicket:id="aa3"></span>
>
> to be able to remove some blocks without breaking the rendering
>
> so I can modify the markup something like this
> <span wicket:id="aa1"></span><wicket:remove> - <span
> wicket:id="aa2"></span> <span wicket:id="aa3"></span></wicket:remove>
>
> The java code will remain the same:
> comp.add(new Label("aa1", "AA1"), new Label("aa2", "AA2"), new Label("aa3",
> "AA3"))
>

Just make aa2 and aa3 inviible (e.g. aa2.setVisible(false))


>
> And I'll get
> <span>AA1</span>
> as a result without any errors/warnings
>
> Thanks in advance!
>
> [1]
> https://github.com/apache/openmeetings/blob/3.1.x/
> openmeetings-service/src/main/java/org/apache/openmeetings/
> service/mail/template/AbstractTemplatePanel.java#L70
>
> --
> WBR
> Maxim aka solomax
>

Reply via email to