Re: (Customizable) Fragment as String

2016-11-01 Thread Maxim Solodovnik
I was able to find workaround :)
In case of following modification:
https://github.com/solomax/fragment-as-string/commit/c6d5e8a692242fa2754a39b9cbe964d24c84a97e
Everything works as expected

The only issue is: fragment is wrapped with
DEFAULT_MARKUP: ""
Is there any option to remove it?


On Mon, Oct 17, 2016 at 1:57 PM, Martin Grigorov 
wrote:

> - org.apache.wicket.markup.IMarkupResourceStreamProvider
> - Component#setMarkup()
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Oct 17, 2016 at 8:33 AM, Maxim Solodovnik 
> wrote:
>
> > Is there other option to have additional markup in the same file?
> >
> > WBR, Maxim
> > (from mobile, sorry for the typos)
> >
> > On Oct 17, 2016 12:44, "Maxim Solodovnik"  wrote:
> >
> > That's a pitty :(
> > Thanks for your time
> > It would be nice to have this functionality available
> >
> > WBR, Maxim
> > (from mobile, sorry for the typos)
> >
> > On Oct 16, 2016 04:44, "Martin Grigorov"  wrote:
> >
> > > Sorry, but I don't find a way to make it work.
> > > It will need more thinking and debugging and I have no that much time
> > right
> > > now.
> > > Just use Panel instead of Fragment.
> > > I'll add a comment to ComponentRenderer's javadoc that Fragments are
> not
> > > supported.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Fri, Oct 14, 2016 at 9:14 AM, Maxim Solodovnik <
> solomax...@gmail.com>
> > > wrote:
> > >
> > > > Many thanks :)
> > > >
> > > > On Fri, Oct 14, 2016 at 2:12 PM, Martin Grigorov <
> mgrigo...@apache.org
> > >
> > > > wrote:
> > > >
> > > > > I'll take a look at the weekend.
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Fri, Oct 14, 2016 at 5:26 AM, Maxim Solodovnik <
> > > solomax...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Yes, the changes were local :(
> > > > > > Here is the quickstart: https://github.com/solomax/fra
> > > gment-as-string
> > > > > >
> > > > > > In case following line is uncommented
> > > > > > https://github.com/solomax/fragment-as-string/blob/
> > > > > > master/src/main/java/org/apache/solomax/HomePage.java#L16
> > > > > > (next one should be commented)
> > > > > > Tests are fails with markup not found exception
> > > > > >
> > > > > > Is it possible to create something like "wicket:visible" (or
> > > > > "om:visible")
> > > > > > tag+attribute so it can act as I call setVisible in Java?
> > > > > >
> > > > > > On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov <
> > > mgrigo...@apache.org
> > > > >
> > > > > > wrote:
> > > > > >
> > > > > > > On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik <
> > > > > solomax...@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Hello Martin,
> > > > > > > >
> > > > > > > > Thanks for the quick response!
> > > > > > > >
> > > > > > > > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov <
> > > > > > mgrigo...@apache.org>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > 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/
> > > > > 70606d73e9165d37c1d8b7c7820279
> > > > > > > > > fb4be18770/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.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > I have added following block to [2]
> > > > > > > >
> > > > > > >
> > > > > > > No, you have not!
> > > > > > > There is no 'fragment' in [2] and [3]
> > > > > > > Or you did it locally ? Better create a branch and point us to
> > it.
> > > > > > >
> > > > > > >
> > > > > > > >  > > > wicket:id="prefix">
> > > > > > >  > > > > > > > wicket:id="title">  > > > > > > > wicket:id="start"> -  > > > > > > > wicket:fragment>
> > > > > > > >
> > > > > > > > then I have added following code to [3]
> > > > > > > >
> > > > > > > > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject",
> > this);
> > > > > > > > f.add(new OmTextLabel("prefix", 1151L, langId)
> > > > > > > > , new OmTextLabel("title", a.getTitle())
> > > > > > > > , new OmTextLabel("start",
> > > > > > > > 

Re: (Customizable) Fragment as String

2016-10-17 Thread Martin Grigorov
- org.apache.wicket.markup.IMarkupResourceStreamProvider
- Component#setMarkup()

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Oct 17, 2016 at 8:33 AM, Maxim Solodovnik 
wrote:

> Is there other option to have additional markup in the same file?
>
> WBR, Maxim
> (from mobile, sorry for the typos)
>
> On Oct 17, 2016 12:44, "Maxim Solodovnik"  wrote:
>
> That's a pitty :(
> Thanks for your time
> It would be nice to have this functionality available
>
> WBR, Maxim
> (from mobile, sorry for the typos)
>
> On Oct 16, 2016 04:44, "Martin Grigorov"  wrote:
>
> > Sorry, but I don't find a way to make it work.
> > It will need more thinking and debugging and I have no that much time
> right
> > now.
> > Just use Panel instead of Fragment.
> > I'll add a comment to ComponentRenderer's javadoc that Fragments are not
> > supported.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, Oct 14, 2016 at 9:14 AM, Maxim Solodovnik 
> > wrote:
> >
> > > Many thanks :)
> > >
> > > On Fri, Oct 14, 2016 at 2:12 PM, Martin Grigorov  >
> > > wrote:
> > >
> > > > I'll take a look at the weekend.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Fri, Oct 14, 2016 at 5:26 AM, Maxim Solodovnik <
> > solomax...@gmail.com>
> > > > wrote:
> > > >
> > > > > Yes, the changes were local :(
> > > > > Here is the quickstart: https://github.com/solomax/fra
> > gment-as-string
> > > > >
> > > > > In case following line is uncommented
> > > > > https://github.com/solomax/fragment-as-string/blob/
> > > > > master/src/main/java/org/apache/solomax/HomePage.java#L16
> > > > > (next one should be commented)
> > > > > Tests are fails with markup not found exception
> > > > >
> > > > > Is it possible to create something like "wicket:visible" (or
> > > > "om:visible")
> > > > > tag+attribute so it can act as I call setVisible in Java?
> > > > >
> > > > > On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov <
> > mgrigo...@apache.org
> > > >
> > > > > wrote:
> > > > >
> > > > > > On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik <
> > > > solomax...@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Hello Martin,
> > > > > > >
> > > > > > > Thanks for the quick response!
> > > > > > >
> > > > > > > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov <
> > > > > mgrigo...@apache.org>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > 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/
> > > > 70606d73e9165d37c1d8b7c7820279
> > > > > > > > fb4be18770/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.
> > > > > > > >
> > > > > > > >
> > > > > > > I have added following block to [2]
> > > > > > >
> > > > > >
> > > > > > No, you have not!
> > > > > > There is no 'fragment' in [2] and [3]
> > > > > > Or you did it locally ? Better create a branch and point us to
> it.
> > > > > >
> > > > > >
> > > > > > >  > > wicket:id="prefix">
> > > > > >  > > > > > > wicket:id="title">  > > > > > > wicket:id="start"> -  > > > > > > wicket:fragment>
> > > > > > >
> > > > > > > then I have added following code to [3]
> > > > > > >
> > > > > > > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject",
> this);
> > > > > > > f.add(new OmTextLabel("prefix", 1151L, langId)
> > > > > > > , new OmTextLabel("title", a.getTitle())
> > > > > > > , new OmTextLabel("start",
> > > > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> > > > dTimeZone(a.getStart(),
> > > > > > > tz))
> > > > > > > , new OmTextLabel("end",
> > > > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> > > dTimeZone(a.getEnd(),
> > > > > > tz))
> > > > > > > );
> > > > > > >
> > > > > > > so I I was hoping markup should be available  but it's not
> :(
> > > > > > >
> > > > > > > [3]
> > > > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > > > > service/mail/template/CreatedAppointmentTemplate.java
> > > > > > >
> > > > > > > [2]
> > > > > > > 

Re: (Customizable) Fragment as String

2016-10-17 Thread Maxim Solodovnik
Is there other option to have additional markup in the same file?

WBR, Maxim
(from mobile, sorry for the typos)

On Oct 17, 2016 12:44, "Maxim Solodovnik"  wrote:

That's a pitty :(
Thanks for your time
It would be nice to have this functionality available

WBR, Maxim
(from mobile, sorry for the typos)

On Oct 16, 2016 04:44, "Martin Grigorov"  wrote:

> Sorry, but I don't find a way to make it work.
> It will need more thinking and debugging and I have no that much time right
> now.
> Just use Panel instead of Fragment.
> I'll add a comment to ComponentRenderer's javadoc that Fragments are not
> supported.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Oct 14, 2016 at 9:14 AM, Maxim Solodovnik 
> wrote:
>
> > Many thanks :)
> >
> > On Fri, Oct 14, 2016 at 2:12 PM, Martin Grigorov 
> > wrote:
> >
> > > I'll take a look at the weekend.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Fri, Oct 14, 2016 at 5:26 AM, Maxim Solodovnik <
> solomax...@gmail.com>
> > > wrote:
> > >
> > > > Yes, the changes were local :(
> > > > Here is the quickstart: https://github.com/solomax/fra
> gment-as-string
> > > >
> > > > In case following line is uncommented
> > > > https://github.com/solomax/fragment-as-string/blob/
> > > > master/src/main/java/org/apache/solomax/HomePage.java#L16
> > > > (next one should be commented)
> > > > Tests are fails with markup not found exception
> > > >
> > > > Is it possible to create something like "wicket:visible" (or
> > > "om:visible")
> > > > tag+attribute so it can act as I call setVisible in Java?
> > > >
> > > > On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov <
> mgrigo...@apache.org
> > >
> > > > wrote:
> > > >
> > > > > On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik <
> > > solomax...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Hello Martin,
> > > > > >
> > > > > > Thanks for the quick response!
> > > > > >
> > > > > > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov <
> > > > mgrigo...@apache.org>
> > > > > > wrote:
> > > > > >
> > > > > > > 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/
> > > 70606d73e9165d37c1d8b7c7820279
> > > > > > > fb4be18770/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.
> > > > > > >
> > > > > > >
> > > > > > I have added following block to [2]
> > > > > >
> > > > >
> > > > > No, you have not!
> > > > > There is no 'fragment' in [2] and [3]
> > > > > Or you did it locally ? Better create a branch and point us to it.
> > > > >
> > > > >
> > > > > >  > wicket:id="prefix">
> > > > >  > > > > > wicket:id="title">  > > > > > wicket:id="start"> -  > > > > > wicket:fragment>
> > > > > >
> > > > > > then I have added following code to [3]
> > > > > >
> > > > > > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
> > > > > > f.add(new OmTextLabel("prefix", 1151L, langId)
> > > > > > , new OmTextLabel("title", a.getTitle())
> > > > > > , new OmTextLabel("start",
> > > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> > > dTimeZone(a.getStart(),
> > > > > > tz))
> > > > > > , new OmTextLabel("end",
> > > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> > dTimeZone(a.getEnd(),
> > > > > tz))
> > > > > > );
> > > > > >
> > > > > > so I I was hoping markup should be available  but it's not :(
> > > > > >
> > > > > > [3]
> > > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > > > service/mail/template/CreatedAppointmentTemplate.java
> > > > > >
> > > > > > [2]
> > > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > > > service/mail/template/CreatedAppointmentTemplate.html#L33
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > 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
> > > > > > > >  - 
> > >  > > > > > > > wicket:id="aa3">
> > > > > > > >
> > > > > > > > to be able to remove some blocks 

Re: (Customizable) Fragment as String

2016-10-16 Thread Maxim Solodovnik
That's a pitty :(
Thanks for your time
It would be nice to have this functionality available

WBR, Maxim
(from mobile, sorry for the typos)

On Oct 16, 2016 04:44, "Martin Grigorov"  wrote:

> Sorry, but I don't find a way to make it work.
> It will need more thinking and debugging and I have no that much time right
> now.
> Just use Panel instead of Fragment.
> I'll add a comment to ComponentRenderer's javadoc that Fragments are not
> supported.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Oct 14, 2016 at 9:14 AM, Maxim Solodovnik 
> wrote:
>
> > Many thanks :)
> >
> > On Fri, Oct 14, 2016 at 2:12 PM, Martin Grigorov 
> > wrote:
> >
> > > I'll take a look at the weekend.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Fri, Oct 14, 2016 at 5:26 AM, Maxim Solodovnik <
> solomax...@gmail.com>
> > > wrote:
> > >
> > > > Yes, the changes were local :(
> > > > Here is the quickstart: https://github.com/solomax/
> fragment-as-string
> > > >
> > > > In case following line is uncommented
> > > > https://github.com/solomax/fragment-as-string/blob/
> > > > master/src/main/java/org/apache/solomax/HomePage.java#L16
> > > > (next one should be commented)
> > > > Tests are fails with markup not found exception
> > > >
> > > > Is it possible to create something like "wicket:visible" (or
> > > "om:visible")
> > > > tag+attribute so it can act as I call setVisible in Java?
> > > >
> > > > On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov <
> mgrigo...@apache.org
> > >
> > > > wrote:
> > > >
> > > > > On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik <
> > > solomax...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Hello Martin,
> > > > > >
> > > > > > Thanks for the quick response!
> > > > > >
> > > > > > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov <
> > > > mgrigo...@apache.org>
> > > > > > wrote:
> > > > > >
> > > > > > > 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/
> > > 70606d73e9165d37c1d8b7c7820279
> > > > > > > fb4be18770/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.
> > > > > > >
> > > > > > >
> > > > > > I have added following block to [2]
> > > > > >
> > > > >
> > > > > No, you have not!
> > > > > There is no 'fragment' in [2] and [3]
> > > > > Or you did it locally ? Better create a branch and point us to it.
> > > > >
> > > > >
> > > > > >  > wicket:id="prefix">
> > > > >  > > > > > wicket:id="title">  > > > > > wicket:id="start"> -  > > > > > wicket:fragment>
> > > > > >
> > > > > > then I have added following code to [3]
> > > > > >
> > > > > > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
> > > > > > f.add(new OmTextLabel("prefix", 1151L, langId)
> > > > > > , new OmTextLabel("title", a.getTitle())
> > > > > > , new OmTextLabel("start",
> > > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> > > dTimeZone(a.getStart(),
> > > > > > tz))
> > > > > > , new OmTextLabel("end",
> > > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> > dTimeZone(a.getEnd(),
> > > > > tz))
> > > > > > );
> > > > > >
> > > > > > so I I was hoping markup should be available  but it's not :(
> > > > > >
> > > > > > [3]
> > > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > > > service/mail/template/CreatedAppointmentTemplate.java
> > > > > >
> > > > > > [2]
> > > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > > > service/mail/template/CreatedAppointmentTemplate.html#L33
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > 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
> > > > > > > >  - 
> > >  > > > > > > > wicket:id="aa3">
> > > > > > > >
> > > > > > > > to be able to remove some blocks without breaking the
> rendering
> > > > > > > >
> > > > > > > > so I can modify the markup something like this
> > > > > > > >  -  > > > > > > > wicket:id="aa2">  > > > > wicket:remove>

Re: (Customizable) Fragment as String

2016-10-15 Thread Martin Grigorov
Sorry, but I don't find a way to make it work.
It will need more thinking and debugging and I have no that much time right
now.
Just use Panel instead of Fragment.
I'll add a comment to ComponentRenderer's javadoc that Fragments are not
supported.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Oct 14, 2016 at 9:14 AM, Maxim Solodovnik 
wrote:

> Many thanks :)
>
> On Fri, Oct 14, 2016 at 2:12 PM, Martin Grigorov 
> wrote:
>
> > I'll take a look at the weekend.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Fri, Oct 14, 2016 at 5:26 AM, Maxim Solodovnik 
> > wrote:
> >
> > > Yes, the changes were local :(
> > > Here is the quickstart: https://github.com/solomax/fragment-as-string
> > >
> > > In case following line is uncommented
> > > https://github.com/solomax/fragment-as-string/blob/
> > > master/src/main/java/org/apache/solomax/HomePage.java#L16
> > > (next one should be commented)
> > > Tests are fails with markup not found exception
> > >
> > > Is it possible to create something like "wicket:visible" (or
> > "om:visible")
> > > tag+attribute so it can act as I call setVisible in Java?
> > >
> > > On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov  >
> > > wrote:
> > >
> > > > On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik <
> > solomax...@gmail.com>
> > > > wrote:
> > > >
> > > > > Hello Martin,
> > > > >
> > > > > Thanks for the quick response!
> > > > >
> > > > > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov <
> > > mgrigo...@apache.org>
> > > > > wrote:
> > > > >
> > > > > > 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/
> > 70606d73e9165d37c1d8b7c7820279
> > > > > > fb4be18770/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.
> > > > > >
> > > > > >
> > > > > I have added following block to [2]
> > > > >
> > > >
> > > > No, you have not!
> > > > There is no 'fragment' in [2] and [3]
> > > > Or you did it locally ? Better create a branch and point us to it.
> > > >
> > > >
> > > > >  wicket:id="prefix">
> > > >  > > > > wicket:id="title">  > > > > wicket:id="start"> -  > > > > wicket:fragment>
> > > > >
> > > > > then I have added following code to [3]
> > > > >
> > > > > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
> > > > > f.add(new OmTextLabel("prefix", 1151L, langId)
> > > > > , new OmTextLabel("title", a.getTitle())
> > > > > , new OmTextLabel("start",
> > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> > dTimeZone(a.getStart(),
> > > > > tz))
> > > > > , new OmTextLabel("end",
> > > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> dTimeZone(a.getEnd(),
> > > > tz))
> > > > > );
> > > > >
> > > > > so I I was hoping markup should be available  but it's not :(
> > > > >
> > > > > [3]
> > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > > service/mail/template/CreatedAppointmentTemplate.java
> > > > >
> > > > > [2]
> > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > > service/mail/template/CreatedAppointmentTemplate.html#L33
> > > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > 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
> > > > > > >  - 
> >  > > > > > > wicket:id="aa3">
> > > > > > >
> > > > > > > to be able to remove some blocks without breaking the rendering
> > > > > > >
> > > > > > > so I can modify the markup something like this
> > > > > > >  -  > > > > > > wicket:id="aa2">  > > > 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))
> > > > > >
> > > > > >
> > > > > Actually we have markup files unpacked, so end users can add some
> > > > > modifications to it
> > > > > So I need to let users to modify fragments without recompiling or
> > java
> > > > 

Re: (Customizable) Fragment as String

2016-10-14 Thread Maxim Solodovnik
Many thanks :)

On Fri, Oct 14, 2016 at 2:12 PM, Martin Grigorov 
wrote:

> I'll take a look at the weekend.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Oct 14, 2016 at 5:26 AM, Maxim Solodovnik 
> wrote:
>
> > Yes, the changes were local :(
> > Here is the quickstart: https://github.com/solomax/fragment-as-string
> >
> > In case following line is uncommented
> > https://github.com/solomax/fragment-as-string/blob/
> > master/src/main/java/org/apache/solomax/HomePage.java#L16
> > (next one should be commented)
> > Tests are fails with markup not found exception
> >
> > Is it possible to create something like "wicket:visible" (or
> "om:visible")
> > tag+attribute so it can act as I call setVisible in Java?
> >
> > On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov 
> > wrote:
> >
> > > On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik <
> solomax...@gmail.com>
> > > wrote:
> > >
> > > > Hello Martin,
> > > >
> > > > Thanks for the quick response!
> > > >
> > > > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov <
> > mgrigo...@apache.org>
> > > > wrote:
> > > >
> > > > > 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/
> 70606d73e9165d37c1d8b7c7820279
> > > > > fb4be18770/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.
> > > > >
> > > > >
> > > > I have added following block to [2]
> > > >
> > >
> > > No, you have not!
> > > There is no 'fragment' in [2] and [3]
> > > Or you did it locally ? Better create a branch and point us to it.
> > >
> > >
> > > > 
> > >  > > > wicket:id="title">  > > > wicket:id="start"> -  > > > wicket:fragment>
> > > >
> > > > then I have added following code to [3]
> > > >
> > > > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
> > > > f.add(new OmTextLabel("prefix", 1151L, langId)
> > > > , new OmTextLabel("title", a.getTitle())
> > > > , new OmTextLabel("start",
> > > > CalendarPatterns.getDateWithTimeByMiliSecondsAn
> dTimeZone(a.getStart(),
> > > > tz))
> > > > , new OmTextLabel("end",
> > > > CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getEnd(),
> > > tz))
> > > > );
> > > >
> > > > so I I was hoping markup should be available  but it's not :(
> > > >
> > > > [3]
> > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > service/mail/template/CreatedAppointmentTemplate.java
> > > >
> > > > [2]
> > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > > service/mail/template/CreatedAppointmentTemplate.html#L33
> > > >
> > > >
> > > > >
> > > > > >
> > > > > > 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
> > > > > >  - 
>  > > > > > wicket:id="aa3">
> > > > > >
> > > > > > to be able to remove some blocks without breaking the rendering
> > > > > >
> > > > > > so I can modify the markup something like this
> > > > > >  -  > > > > > wicket:id="aa2">  > > 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))
> > > > >
> > > > >
> > > > Actually we have markup files unpacked, so end users can add some
> > > > modifications to it
> > > > So I need to let users to modify fragments without recompiling or
> java
> > > > programming
> > > > re-arraging blocks is OK, but removing 
> > > >
> > >
> > > I'm afraid you will need to use auto-components for such requirement.
> > > E.g.  in the markup and IComponentResolver in Java that
> > knows
> > > what to do with such elements in the markup. E.g. it will instantiate a
> > > Label and set its model by reading some special attribute.
> > >
> > >
> > > >
> > > >
> > > >
> > > > > >
> > > > > > And I'll get
> > > > > > AA1
> > > > > > as a result without any errors/warnings
> > > > > >
> > > > > > Thanks in advance!
> > > > > >
> > > > > > [1]
> > > > > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > > > > 

Re: (Customizable) Fragment as String

2016-10-14 Thread Martin Grigorov
I'll take a look at the weekend.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Oct 14, 2016 at 5:26 AM, Maxim Solodovnik 
wrote:

> Yes, the changes were local :(
> Here is the quickstart: https://github.com/solomax/fragment-as-string
>
> In case following line is uncommented
> https://github.com/solomax/fragment-as-string/blob/
> master/src/main/java/org/apache/solomax/HomePage.java#L16
> (next one should be commented)
> Tests are fails with markup not found exception
>
> Is it possible to create something like "wicket:visible" (or "om:visible")
> tag+attribute so it can act as I call setVisible in Java?
>
> On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov 
> wrote:
>
> > On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik 
> > wrote:
> >
> > > Hello Martin,
> > >
> > > Thanks for the quick response!
> > >
> > > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov <
> mgrigo...@apache.org>
> > > wrote:
> > >
> > > > 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/70606d73e9165d37c1d8b7c7820279
> > > > fb4be18770/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.
> > > >
> > > >
> > > I have added following block to [2]
> > >
> >
> > No, you have not!
> > There is no 'fragment' in [2] and [3]
> > Or you did it locally ? Better create a branch and point us to it.
> >
> >
> > > 
> >  > > wicket:id="title">  > > wicket:id="start"> -  > > wicket:fragment>
> > >
> > > then I have added following code to [3]
> > >
> > > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
> > > f.add(new OmTextLabel("prefix", 1151L, langId)
> > > , new OmTextLabel("title", a.getTitle())
> > > , new OmTextLabel("start",
> > > CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getStart(),
> > > tz))
> > > , new OmTextLabel("end",
> > > CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getEnd(),
> > tz))
> > > );
> > >
> > > so I I was hoping markup should be available  but it's not :(
> > >
> > > [3]
> > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > service/mail/template/CreatedAppointmentTemplate.java
> > >
> > > [2]
> > > https://github.com/apache/openmeetings/blob/3.1.x/
> > > openmeetings-service/src/main/java/org/apache/openmeetings/
> > > service/mail/template/CreatedAppointmentTemplate.html#L33
> > >
> > >
> > > >
> > > > >
> > > > > 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
> > > > >  -   > > > > wicket:id="aa3">
> > > > >
> > > > > to be able to remove some blocks without breaking the rendering
> > > > >
> > > > > so I can modify the markup something like this
> > > > >  -  > > > > wicket:id="aa2">  > 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))
> > > >
> > > >
> > > Actually we have markup files unpacked, so end users can add some
> > > modifications to it
> > > So I need to let users to modify fragments without recompiling or java
> > > programming
> > > re-arraging blocks is OK, but removing 
> > >
> >
> > I'm afraid you will need to use auto-components for such requirement.
> > E.g.  in the markup and IComponentResolver in Java that
> knows
> > what to do with such elements in the markup. E.g. it will instantiate a
> > Label and set its model by reading some special attribute.
> >
> >
> > >
> > >
> > >
> > > > >
> > > > > And I'll get
> > > > > AA1
> > > > > 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
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>


Re: (Customizable) Fragment as String

2016-10-13 Thread Maxim Solodovnik
Yes, the changes were local :(
Here is the quickstart: https://github.com/solomax/fragment-as-string

In case following line is uncommented
https://github.com/solomax/fragment-as-string/blob/master/src/main/java/org/apache/solomax/HomePage.java#L16
(next one should be commented)
Tests are fails with markup not found exception

Is it possible to create something like "wicket:visible" (or "om:visible")
tag+attribute so it can act as I call setVisible in Java?

On Fri, Oct 14, 2016 at 1:14 AM, Martin Grigorov 
wrote:

> On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik 
> wrote:
>
> > Hello Martin,
> >
> > Thanks for the quick response!
> >
> > On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov 
> > wrote:
> >
> > > 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/70606d73e9165d37c1d8b7c7820279
> > > fb4be18770/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.
> > >
> > >
> > I have added following block to [2]
> >
>
> No, you have not!
> There is no 'fragment' in [2] and [3]
> Or you did it locally ? Better create a branch and point us to it.
>
>
> > 
>  > wicket:id="title">  > wicket:id="start"> -  > wicket:fragment>
> >
> > then I have added following code to [3]
> >
> > Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
> > f.add(new OmTextLabel("prefix", 1151L, langId)
> > , new OmTextLabel("title", a.getTitle())
> > , new OmTextLabel("start",
> > CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getStart(),
> > tz))
> > , new OmTextLabel("end",
> > CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getEnd(),
> tz))
> > );
> >
> > so I I was hoping markup should be available  but it's not :(
> >
> > [3]
> > https://github.com/apache/openmeetings/blob/3.1.x/
> > openmeetings-service/src/main/java/org/apache/openmeetings/
> > service/mail/template/CreatedAppointmentTemplate.java
> >
> > [2]
> > https://github.com/apache/openmeetings/blob/3.1.x/
> > openmeetings-service/src/main/java/org/apache/openmeetings/
> > service/mail/template/CreatedAppointmentTemplate.html#L33
> >
> >
> > >
> > > >
> > > > 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
> > > >  -   > > > wicket:id="aa3">
> > > >
> > > > to be able to remove some blocks without breaking the rendering
> > > >
> > > > so I can modify the markup something like this
> > > >  -  > > > wicket:id="aa2">  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))
> > >
> > >
> > Actually we have markup files unpacked, so end users can add some
> > modifications to it
> > So I need to let users to modify fragments without recompiling or java
> > programming
> > re-arraging blocks is OK, but removing 
> >
>
> I'm afraid you will need to use auto-components for such requirement.
> E.g.  in the markup and IComponentResolver in Java that knows
> what to do with such elements in the markup. E.g. it will instantiate a
> Label and set its model by reading some special attribute.
>
>
> >
> >
> >
> > > >
> > > > And I'll get
> > > > AA1
> > > > 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
> > > >
> > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax


Re: (Customizable) Fragment as String

2016-10-13 Thread Martin Grigorov
On Thu, Oct 13, 2016 at 6:49 PM, Maxim Solodovnik 
wrote:

> Hello Martin,
>
> Thanks for the quick response!
>
> On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov 
> wrote:
>
> > Hi Maxim,
> >
> > On Thu, Oct 13, 2016 at 6:10 PM, Maxim Solodovnik 
> > 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/70606d73e9165d37c1d8b7c7820279
> > fb4be18770/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.
> >
> >
> I have added following block to [2]
>

No, you have not!
There is no 'fragment' in [2] and [3]
Or you did it locally ? Better create a branch and point us to it.


>   wicket:id="title">  wicket:id="start"> -  wicket:fragment>
>
> then I have added following code to [3]
>
> Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
> f.add(new OmTextLabel("prefix", 1151L, langId)
> , new OmTextLabel("title", a.getTitle())
> , new OmTextLabel("start",
> CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getStart(),
> tz))
> , new OmTextLabel("end",
> CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getEnd(), tz))
> );
>
> so I I was hoping markup should be available  but it's not :(
>
> [3]
> https://github.com/apache/openmeetings/blob/3.1.x/
> openmeetings-service/src/main/java/org/apache/openmeetings/
> service/mail/template/CreatedAppointmentTemplate.java
>
> [2]
> https://github.com/apache/openmeetings/blob/3.1.x/
> openmeetings-service/src/main/java/org/apache/openmeetings/
> service/mail/template/CreatedAppointmentTemplate.html#L33
>
>
> >
> > >
> > > 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
> > >  -   > > wicket:id="aa3">
> > >
> > > to be able to remove some blocks without breaking the rendering
> > >
> > > so I can modify the markup something like this
> > >  -  > > wicket:id="aa2"> 
> > >
> > > 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))
> >
> >
> Actually we have markup files unpacked, so end users can add some
> modifications to it
> So I need to let users to modify fragments without recompiling or java
> programming
> re-arraging blocks is OK, but removing 
>

I'm afraid you will need to use auto-components for such requirement.
E.g.  in the markup and IComponentResolver in Java that knows
what to do with such elements in the markup. E.g. it will instantiate a
Label and set its model by reading some special attribute.


>
>
>
> > >
> > > And I'll get
> > > AA1
> > > 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
> > >
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>


Re: (Customizable) Fragment as String

2016-10-13 Thread Maxim Solodovnik
Hello Martin,

Thanks for the quick response!

On Thu, Oct 13, 2016 at 11:39 PM, Martin Grigorov 
wrote:

> Hi Maxim,
>
> On Thu, Oct 13, 2016 at 6:10 PM, Maxim Solodovnik 
> 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/70606d73e9165d37c1d8b7c7820279
> fb4be18770/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.
>
>
I have added following block to [2]
   - 

then I have added following code to [3]

Fragment f = new Fragment(TemplatePage.COMP_ID, "subject", this);
f.add(new OmTextLabel("prefix", 1151L, langId)
, new OmTextLabel("title", a.getTitle())
, new OmTextLabel("start",
CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getStart(), tz))
, new OmTextLabel("end",
CalendarPatterns.getDateWithTimeByMiliSecondsAndTimeZone(a.getEnd(), tz))
);

so I I was hoping markup should be available  but it's not :(

[3]
https://github.com/apache/openmeetings/blob/3.1.x/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/CreatedAppointmentTemplate.java

[2]
https://github.com/apache/openmeetings/blob/3.1.x/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/CreatedAppointmentTemplate.html#L33


>
> >
> > 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
> >  -   > wicket:id="aa3">
> >
> > to be able to remove some blocks without breaking the rendering
> >
> > so I can modify the markup something like this
> >  -  > wicket:id="aa2"> 
> >
> > 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))
>
>
Actually we have markup files unpacked, so end users can add some
modifications to it
So I need to let users to modify fragments without recompiling or java
programming
re-arraging blocks is OK, but removing 



> >
> > And I'll get
> > AA1
> > 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
> >
>



-- 
WBR
Maxim aka solomax


Re: (Customizable) Fragment as String

2016-10-13 Thread Martin Grigorov
Hi Maxim,

On Thu, Oct 13, 2016 at 6:10 PM, Maxim Solodovnik 
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
>  -   wicket:id="aa3">
>
> to be able to remove some blocks without breaking the rendering
>
> so I can modify the markup something like this
>  -  wicket:id="aa2"> 
>
> 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
> AA1
> 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
>


(Customizable) Fragment as String

2016-10-13 Thread Maxim Solodovnik
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 :(

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
 -  

to be able to remove some blocks without breaking the rendering

so I can modify the markup something like this
 -  

The java code will remain the same:
comp.add(new Label("aa1", "AA1"), new Label("aa2", "AA2"), new Label("aa3",
"AA3"))

And I'll get
AA1
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