You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Stoch <da...@gmail.com> on 2011/09/15 17:05:59 UTC
Display HTML in Label with validation
Hi,
How to display dynamic HTML content on page which can be invalid
(because this HTML is entered by a user). I can use
Label.setEscapeModelStrings(false), but with invalid HTML content the
page will not be rendered (because of HTML parsing error). So maybe I
can use some of standard Wicket mechanisms to parse this HTML first to
check if I can display it on page? There are some parsers within
framework...
--
Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Display HTML in Label with validation
Posted by Clint Checketts <ch...@gmail.com>.
Add your own html header and footer tags when validating,
(<html><body></body></html>) but don't include them when outputting the
fragment.
On Fri, Sep 16, 2011 at 6:05 AM, manuelbarzi <ma...@gmail.com> wrote:
> sure, but you can try customizing it. inside it you can find
> interesting things like HtmlDocumentParser, which you can modify to
> accomplish your needs. it works with a raw html string document, as
> you may need.
> .
>
>
> On Fri, Sep 16, 2011 at 12:17 PM, Daniel Stoch <da...@gmail.com>
> wrote:
> >
> > Thanks for your suggestion. But I need to validate a fragment of HTML,
> > but it seems that HtmlDocumentValidator validates only whole
> > documents.
> > From my point of view the following texts are valid HTML fragments:
> > - This is sample text
> > - <b>This is</b> sample <p>paragraph</p>
> >
> > --
> > Daniel
> >
> >
> > On Thu, Sep 15, 2011 at 5:31 PM, manuelbarzi <ma...@gmail.com>
> wrote:
> > > may HtmlDocumentValidator help you.
> > > .
> > >
> > >
> > >
> > > On Thu, Sep 15, 2011 at 5:05 PM, Daniel Stoch <da...@gmail.com>
> wrote:
> > >> Hi,
> > >>
> > >> How to display dynamic HTML content on page which can be invalid
> > >> (because this HTML is entered by a user). I can use
> > >> Label.setEscapeModelStrings(false), but with invalid HTML content the
> > >> page will not be rendered (because of HTML parsing error). So maybe I
> > >> can use some of standard Wicket mechanisms to parse this HTML first to
> > >> check if I can display it on page? There are some parsers within
> > >> framework...
> > >>
> > >> --
> > >> Daniel
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Display HTML in Label with validation
Posted by manuelbarzi <ma...@gmail.com>.
sure, but you can try customizing it. inside it you can find
interesting things like HtmlDocumentParser, which you can modify to
accomplish your needs. it works with a raw html string document, as
you may need.
.
On Fri, Sep 16, 2011 at 12:17 PM, Daniel Stoch <da...@gmail.com> wrote:
>
> Thanks for your suggestion. But I need to validate a fragment of HTML,
> but it seems that HtmlDocumentValidator validates only whole
> documents.
> From my point of view the following texts are valid HTML fragments:
> - This is sample text
> - <b>This is</b> sample <p>paragraph</p>
>
> --
> Daniel
>
>
> On Thu, Sep 15, 2011 at 5:31 PM, manuelbarzi <ma...@gmail.com> wrote:
> > may HtmlDocumentValidator help you.
> > .
> >
> >
> >
> > On Thu, Sep 15, 2011 at 5:05 PM, Daniel Stoch <da...@gmail.com> wrote:
> >> Hi,
> >>
> >> How to display dynamic HTML content on page which can be invalid
> >> (because this HTML is entered by a user). I can use
> >> Label.setEscapeModelStrings(false), but with invalid HTML content the
> >> page will not be rendered (because of HTML parsing error). So maybe I
> >> can use some of standard Wicket mechanisms to parse this HTML first to
> >> check if I can display it on page? There are some parsers within
> >> framework...
> >>
> >> --
> >> Daniel
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Display HTML in Label with validation
Posted by Martin Grigorov <mg...@apache.org>.
See whether org.apache.wicket.settings.IMarkupSettings.getMarkupFactory().newMarkupParser(IMarkupResourceStream)
will do the job for you.
On Fri, Sep 16, 2011 at 1:17 PM, Daniel Stoch <da...@gmail.com> wrote:
> Thanks for your suggestion. But I need to validate a fragment of HTML,
> but it seems that HtmlDocumentValidator validates only whole
> documents.
> From my point of view the following texts are valid HTML fragments:
> - This is sample text
> - <b>This is</b> sample <p>paragraph</p>
>
> --
> Daniel
>
>
> On Thu, Sep 15, 2011 at 5:31 PM, manuelbarzi <ma...@gmail.com> wrote:
>> may HtmlDocumentValidator help you.
>> .
>>
>>
>>
>> On Thu, Sep 15, 2011 at 5:05 PM, Daniel Stoch <da...@gmail.com> wrote:
>>> Hi,
>>>
>>> How to display dynamic HTML content on page which can be invalid
>>> (because this HTML is entered by a user). I can use
>>> Label.setEscapeModelStrings(false), but with invalid HTML content the
>>> page will not be rendered (because of HTML parsing error). So maybe I
>>> can use some of standard Wicket mechanisms to parse this HTML first to
>>> check if I can display it on page? There are some parsers within
>>> framework...
>>>
>>> --
>>> Daniel
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Display HTML in Label with validation
Posted by Daniel Stoch <da...@gmail.com>.
Thanks for your suggestion. But I need to validate a fragment of HTML,
but it seems that HtmlDocumentValidator validates only whole
documents.
>From my point of view the following texts are valid HTML fragments:
- This is sample text
- <b>This is</b> sample <p>paragraph</p>
--
Daniel
On Thu, Sep 15, 2011 at 5:31 PM, manuelbarzi <ma...@gmail.com> wrote:
> may HtmlDocumentValidator help you.
> .
>
>
>
> On Thu, Sep 15, 2011 at 5:05 PM, Daniel Stoch <da...@gmail.com> wrote:
>> Hi,
>>
>> How to display dynamic HTML content on page which can be invalid
>> (because this HTML is entered by a user). I can use
>> Label.setEscapeModelStrings(false), but with invalid HTML content the
>> page will not be rendered (because of HTML parsing error). So maybe I
>> can use some of standard Wicket mechanisms to parse this HTML first to
>> check if I can display it on page? There are some parsers within
>> framework...
>>
>> --
>> Daniel
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Display HTML in Label with validation
Posted by manuelbarzi <ma...@gmail.com>.
may HtmlDocumentValidator help you.
.
On Thu, Sep 15, 2011 at 5:05 PM, Daniel Stoch <da...@gmail.com> wrote:
> Hi,
>
> How to display dynamic HTML content on page which can be invalid
> (because this HTML is entered by a user). I can use
> Label.setEscapeModelStrings(false), but with invalid HTML content the
> page will not be rendered (because of HTML parsing error). So maybe I
> can use some of standard Wicket mechanisms to parse this HTML first to
> check if I can display it on page? There are some parsers within
> framework...
>
> --
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org