You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Lowery <sl...@gatessolutions.com> on 2013/01/24 17:25:30 UTC

Component to String

I found several threads on the user list about converting a Component into
a String.  There are at least 2 very valid use cases where doing this makes
sense:

1.  You are trying to create an html email to send out to your customers.
 Building that content out with wicket is a great way to do it.  We are
able to harness Wicket's awesome i18n capabilities to generate the content.
 Otherwise, we resort to ResourceBundles or having to introduce some other
templating library.

2.  Many Javascript APIs/JQuery Plugins (i.e. growl notifications,
popovers, etc) want the html content passed in.  Again, ideally the
component is written in wicket.

The threads I've seen have asked for potential ways to do this, but I'm
wondering if this is a utility that should be included within Wicket
itself.  What do you think?

If you think this type of utility does not belong in the framework and
should be implemented by the users instead, can you provide a wicket 6 way
of accomplishing this?

Thanks.

-- 
 

IMPORTANT: This e-mail (including any attachments) is intended for the use 
of the individual or entity to which it is addressed and may contain 
information that is classified, private, or confidential. If the reader of 
this message is not the intended recipient, or the employee or agent 
responsible for delivering the message to the intended recipient, you are 
hereby notified that any dissemination, distribution, or copying of this 
communication is prohibited. If you have received this communication in 
error, please notify us immediately by replying to this e-mail. Thank you.

Re: Component to String

Posted by Paul Bors <pa...@bors.ws>.
You can also use a VelocityPanel in Wicket to render to HTML or plain text
or XML or whatever your velocity template feels like :)

http://wicket.apache.org/learn/projects/velocity.html

~ Thank you,
    Paul Bors

On Thu, Jan 24, 2013 at 1:30 PM, Cedric Gatay <ga...@gmail.com> wrote:

> Yes it is the real issue when displaying HTML in emails. However, using
> Wicket's builtin templating engine is great to generate these HTML mails ;)
>
>
> On Thu, Jan 24, 2013 at 7:24 PM, Nick Pratt <nb...@gmail.com> wrote:
>
> > The real issue here is that most Email clients render HTML really badly,
> or
> > dont render it at all (or their implementations of such rendering is just
> > wrong).
> >
> > Even modern email clients, like the latest Outlook or GMail dont render
> > significant portions of HTML/CSS correctly, and you will likely have to
> > resort to <table> layout to get anything even remotely like what you're
> > after.
> >
> > N
> >
> > On Thu, Jan 24, 2013 at 1:04 PM, Francois Meillet <
> > francois.meillet@gmail.com> wrote:
> >
> > > Hi Cedric,
> > >
> > > Great !
> > > It works on 6.5
> > >
> > > François
> > >
> > >
> > > Le 24 janv. 2013 à 17:39, Cedric Gatay <ga...@gmail.com> a écrit :
> > >
> > > > Hi,
> > > > I recently needed to do this, I come with a simple solution (quickly
> > > > deprecated by our main application architecture however). I blogged
> > about
> > > > it here
> > > >
> > >
> >
> http://www.bloggure.info/work/java-work/use-wicket-templating-system-to-generate-html.html
> > > >
> > > > I hope it will help you, I don't know if it works well with Wicket 6
> > > > (written for 1.5).
> > > >
> > > > Regards,
> > > >
> > > >
> > > > __
> > > > Cedric Gatay
> > > > http://www.bloggure.info | http://cedric.gatay.fr |
> > > > @Cedric_Gatay<http://twitter.com/Cedric_Gatay>
> > > >
> > > >
> > > > On Thu, Jan 24, 2013 at 5:25 PM, Steve Lowery <
> > > slowery@gatessolutions.com>wrote:
> > > >
> > > >> I found several threads on the user list about converting a
> Component
> > > into
> > > >> a String.  There are at least 2 very valid use cases where doing
> this
> > > makes
> > > >> sense:
> > > >>
> > > >> 1.  You are trying to create an html email to send out to your
> > > customers.
> > > >> Building that content out with wicket is a great way to do it.  We
> are
> > > >> able to harness Wicket's awesome i18n capabilities to generate the
> > > content.
> > > >> Otherwise, we resort to ResourceBundles or having to introduce some
> > > other
> > > >> templating library.
> > > >>
> > > >> 2.  Many Javascript APIs/JQuery Plugins (i.e. growl notifications,
> > > >> popovers, etc) want the html content passed in.  Again, ideally the
> > > >> component is written in wicket.
> > > >>
> > > >> The threads I've seen have asked for potential ways to do this, but
> > I'm
> > > >> wondering if this is a utility that should be included within Wicket
> > > >> itself.  What do you think?
> > > >>
> > > >> If you think this type of utility does not belong in the framework
> and
> > > >> should be implemented by the users instead, can you provide a
> wicket 6
> > > way
> > > >> of accomplishing this?
> > > >>
> > > >> Thanks.
> > > >>
> > > >> --
> > > >>
> > > >>
> > > >> IMPORTANT: This e-mail (including any attachments) is intended for
> the
> > > use
> > > >> of the individual or entity to which it is addressed and may contain
> > > >> information that is classified, private, or confidential. If the
> > reader
> > > of
> > > >> this message is not the intended recipient, or the employee or agent
> > > >> responsible for delivering the message to the intended recipient,
> you
> > > are
> > > >> hereby notified that any dissemination, distribution, or copying of
> > this
> > > >> communication is prohibited. If you have received this communication
> > in
> > > >> error, please notify us immediately by replying to this e-mail.
> Thank
> > > you.
> > > >>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>

Re: Component to String

Posted by Cedric Gatay <ga...@gmail.com>.
Yes it is the real issue when displaying HTML in emails. However, using
Wicket's builtin templating engine is great to generate these HTML mails ;)


On Thu, Jan 24, 2013 at 7:24 PM, Nick Pratt <nb...@gmail.com> wrote:

> The real issue here is that most Email clients render HTML really badly, or
> dont render it at all (or their implementations of such rendering is just
> wrong).
>
> Even modern email clients, like the latest Outlook or GMail dont render
> significant portions of HTML/CSS correctly, and you will likely have to
> resort to <table> layout to get anything even remotely like what you're
> after.
>
> N
>
> On Thu, Jan 24, 2013 at 1:04 PM, Francois Meillet <
> francois.meillet@gmail.com> wrote:
>
> > Hi Cedric,
> >
> > Great !
> > It works on 6.5
> >
> > François
> >
> >
> > Le 24 janv. 2013 à 17:39, Cedric Gatay <ga...@gmail.com> a écrit :
> >
> > > Hi,
> > > I recently needed to do this, I come with a simple solution (quickly
> > > deprecated by our main application architecture however). I blogged
> about
> > > it here
> > >
> >
> http://www.bloggure.info/work/java-work/use-wicket-templating-system-to-generate-html.html
> > >
> > > I hope it will help you, I don't know if it works well with Wicket 6
> > > (written for 1.5).
> > >
> > > Regards,
> > >
> > >
> > > __
> > > Cedric Gatay
> > > http://www.bloggure.info | http://cedric.gatay.fr |
> > > @Cedric_Gatay<http://twitter.com/Cedric_Gatay>
> > >
> > >
> > > On Thu, Jan 24, 2013 at 5:25 PM, Steve Lowery <
> > slowery@gatessolutions.com>wrote:
> > >
> > >> I found several threads on the user list about converting a Component
> > into
> > >> a String.  There are at least 2 very valid use cases where doing this
> > makes
> > >> sense:
> > >>
> > >> 1.  You are trying to create an html email to send out to your
> > customers.
> > >> Building that content out with wicket is a great way to do it.  We are
> > >> able to harness Wicket's awesome i18n capabilities to generate the
> > content.
> > >> Otherwise, we resort to ResourceBundles or having to introduce some
> > other
> > >> templating library.
> > >>
> > >> 2.  Many Javascript APIs/JQuery Plugins (i.e. growl notifications,
> > >> popovers, etc) want the html content passed in.  Again, ideally the
> > >> component is written in wicket.
> > >>
> > >> The threads I've seen have asked for potential ways to do this, but
> I'm
> > >> wondering if this is a utility that should be included within Wicket
> > >> itself.  What do you think?
> > >>
> > >> If you think this type of utility does not belong in the framework and
> > >> should be implemented by the users instead, can you provide a wicket 6
> > way
> > >> of accomplishing this?
> > >>
> > >> Thanks.
> > >>
> > >> --
> > >>
> > >>
> > >> IMPORTANT: This e-mail (including any attachments) is intended for the
> > use
> > >> of the individual or entity to which it is addressed and may contain
> > >> information that is classified, private, or confidential. If the
> reader
> > of
> > >> this message is not the intended recipient, or the employee or agent
> > >> responsible for delivering the message to the intended recipient, you
> > are
> > >> hereby notified that any dissemination, distribution, or copying of
> this
> > >> communication is prohibited. If you have received this communication
> in
> > >> error, please notify us immediately by replying to this e-mail. Thank
> > you.
> > >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: Component to String

Posted by Nick Pratt <nb...@gmail.com>.
The real issue here is that most Email clients render HTML really badly, or
dont render it at all (or their implementations of such rendering is just
wrong).

Even modern email clients, like the latest Outlook or GMail dont render
significant portions of HTML/CSS correctly, and you will likely have to
resort to <table> layout to get anything even remotely like what you're
after.

N

On Thu, Jan 24, 2013 at 1:04 PM, Francois Meillet <
francois.meillet@gmail.com> wrote:

> Hi Cedric,
>
> Great !
> It works on 6.5
>
> François
>
>
> Le 24 janv. 2013 à 17:39, Cedric Gatay <ga...@gmail.com> a écrit :
>
> > Hi,
> > I recently needed to do this, I come with a simple solution (quickly
> > deprecated by our main application architecture however). I blogged about
> > it here
> >
> http://www.bloggure.info/work/java-work/use-wicket-templating-system-to-generate-html.html
> >
> > I hope it will help you, I don't know if it works well with Wicket 6
> > (written for 1.5).
> >
> > Regards,
> >
> >
> > __
> > Cedric Gatay
> > http://www.bloggure.info | http://cedric.gatay.fr |
> > @Cedric_Gatay<http://twitter.com/Cedric_Gatay>
> >
> >
> > On Thu, Jan 24, 2013 at 5:25 PM, Steve Lowery <
> slowery@gatessolutions.com>wrote:
> >
> >> I found several threads on the user list about converting a Component
> into
> >> a String.  There are at least 2 very valid use cases where doing this
> makes
> >> sense:
> >>
> >> 1.  You are trying to create an html email to send out to your
> customers.
> >> Building that content out with wicket is a great way to do it.  We are
> >> able to harness Wicket's awesome i18n capabilities to generate the
> content.
> >> Otherwise, we resort to ResourceBundles or having to introduce some
> other
> >> templating library.
> >>
> >> 2.  Many Javascript APIs/JQuery Plugins (i.e. growl notifications,
> >> popovers, etc) want the html content passed in.  Again, ideally the
> >> component is written in wicket.
> >>
> >> The threads I've seen have asked for potential ways to do this, but I'm
> >> wondering if this is a utility that should be included within Wicket
> >> itself.  What do you think?
> >>
> >> If you think this type of utility does not belong in the framework and
> >> should be implemented by the users instead, can you provide a wicket 6
> way
> >> of accomplishing this?
> >>
> >> Thanks.
> >>
> >> --
> >>
> >>
> >> IMPORTANT: This e-mail (including any attachments) is intended for the
> use
> >> of the individual or entity to which it is addressed and may contain
> >> information that is classified, private, or confidential. If the reader
> of
> >> this message is not the intended recipient, or the employee or agent
> >> responsible for delivering the message to the intended recipient, you
> are
> >> hereby notified that any dissemination, distribution, or copying of this
> >> communication is prohibited. If you have received this communication in
> >> error, please notify us immediately by replying to this e-mail. Thank
> you.
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Component to String

Posted by Francois Meillet <fr...@gmail.com>.
Hi Cedric,

Great !
It works on 6.5

François


Le 24 janv. 2013 à 17:39, Cedric Gatay <ga...@gmail.com> a écrit :

> Hi,
> I recently needed to do this, I come with a simple solution (quickly
> deprecated by our main application architecture however). I blogged about
> it here
> http://www.bloggure.info/work/java-work/use-wicket-templating-system-to-generate-html.html
> 
> I hope it will help you, I don't know if it works well with Wicket 6
> (written for 1.5).
> 
> Regards,
> 
> 
> __
> Cedric Gatay
> http://www.bloggure.info | http://cedric.gatay.fr |
> @Cedric_Gatay<http://twitter.com/Cedric_Gatay>
> 
> 
> On Thu, Jan 24, 2013 at 5:25 PM, Steve Lowery <sl...@gatessolutions.com>wrote:
> 
>> I found several threads on the user list about converting a Component into
>> a String.  There are at least 2 very valid use cases where doing this makes
>> sense:
>> 
>> 1.  You are trying to create an html email to send out to your customers.
>> Building that content out with wicket is a great way to do it.  We are
>> able to harness Wicket's awesome i18n capabilities to generate the content.
>> Otherwise, we resort to ResourceBundles or having to introduce some other
>> templating library.
>> 
>> 2.  Many Javascript APIs/JQuery Plugins (i.e. growl notifications,
>> popovers, etc) want the html content passed in.  Again, ideally the
>> component is written in wicket.
>> 
>> The threads I've seen have asked for potential ways to do this, but I'm
>> wondering if this is a utility that should be included within Wicket
>> itself.  What do you think?
>> 
>> If you think this type of utility does not belong in the framework and
>> should be implemented by the users instead, can you provide a wicket 6 way
>> of accomplishing this?
>> 
>> Thanks.
>> 
>> --
>> 
>> 
>> IMPORTANT: This e-mail (including any attachments) is intended for the use
>> of the individual or entity to which it is addressed and may contain
>> information that is classified, private, or confidential. If the reader of
>> this message is not the intended recipient, or the employee or agent
>> responsible for delivering the message to the intended recipient, you are
>> hereby notified that any dissemination, distribution, or copying of this
>> communication is prohibited. If you have received this communication in
>> error, please notify us immediately by replying to this e-mail. Thank you.
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Component to String

Posted by Cedric Gatay <ga...@gmail.com>.
Hi,
I recently needed to do this, I come with a simple solution (quickly
deprecated by our main application architecture however). I blogged about
it here
http://www.bloggure.info/work/java-work/use-wicket-templating-system-to-generate-html.html

I hope it will help you, I don't know if it works well with Wicket 6
(written for 1.5).

Regards,


__
Cedric Gatay
http://www.bloggure.info | http://cedric.gatay.fr |
@Cedric_Gatay<http://twitter.com/Cedric_Gatay>


On Thu, Jan 24, 2013 at 5:25 PM, Steve Lowery <sl...@gatessolutions.com>wrote:

> I found several threads on the user list about converting a Component into
> a String.  There are at least 2 very valid use cases where doing this makes
> sense:
>
> 1.  You are trying to create an html email to send out to your customers.
>  Building that content out with wicket is a great way to do it.  We are
> able to harness Wicket's awesome i18n capabilities to generate the content.
>  Otherwise, we resort to ResourceBundles or having to introduce some other
> templating library.
>
> 2.  Many Javascript APIs/JQuery Plugins (i.e. growl notifications,
> popovers, etc) want the html content passed in.  Again, ideally the
> component is written in wicket.
>
> The threads I've seen have asked for potential ways to do this, but I'm
> wondering if this is a utility that should be included within Wicket
> itself.  What do you think?
>
> If you think this type of utility does not belong in the framework and
> should be implemented by the users instead, can you provide a wicket 6 way
> of accomplishing this?
>
> Thanks.
>
> --
>
>
> IMPORTANT: This e-mail (including any attachments) is intended for the use
> of the individual or entity to which it is addressed and may contain
> information that is classified, private, or confidential. If the reader of
> this message is not the intended recipient, or the employee or agent
> responsible for delivering the message to the intended recipient, you are
> hereby notified that any dissemination, distribution, or copying of this
> communication is prohibited. If you have received this communication in
> error, please notify us immediately by replying to this e-mail. Thank you.
>

Re: Component to String

Posted by Martin Grigorov <mg...@apache.org>.
There is Mail template example at
http://www.wicket-library.com/wicket-examples-6.0.x/mailtemplate/?0 since
some time.


On Thu, Jan 24, 2013 at 6:25 PM, Steve Lowery <sl...@gatessolutions.com>wrote:

> I found several threads on the user list about converting a Component into
> a String.  There are at least 2 very valid use cases where doing this makes
> sense:
>
> 1.  You are trying to create an html email to send out to your customers.
>  Building that content out with wicket is a great way to do it.  We are
> able to harness Wicket's awesome i18n capabilities to generate the content.
>  Otherwise, we resort to ResourceBundles or having to introduce some other
> templating library.
>
> 2.  Many Javascript APIs/JQuery Plugins (i.e. growl notifications,
> popovers, etc) want the html content passed in.  Again, ideally the
> component is written in wicket.
>
> The threads I've seen have asked for potential ways to do this, but I'm
> wondering if this is a utility that should be included within Wicket
> itself.  What do you think?
>
> If you think this type of utility does not belong in the framework and
> should be implemented by the users instead, can you provide a wicket 6 way
> of accomplishing this?
>
> Thanks.
>
> --
>
>
> IMPORTANT: This e-mail (including any attachments) is intended for the use
> of the individual or entity to which it is addressed and may contain
> information that is classified, private, or confidential. If the reader of
> this message is not the intended recipient, or the employee or agent
> responsible for delivering the message to the intended recipient, you are
> hereby notified that any dissemination, distribution, or copying of this
> communication is prohibited. If you have received this communication in
> error, please notify us immediately by replying to this e-mail. Thank you.
>



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