You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Volker Lamp <vo...@gmail.com> on 2022/04/01 13:17:48 UTC

Re: Bootstrap 4: Validation error messages in red font color

Hello again Thiago,

I must happily revise what I wrote yesterday.

Actually, with Bootstrap 4 enabled, validation messages now appear in red  *if
one uses the Error component (<t:error>)*.

If <t:error> is omitted (as is the case for BeanEditor component, for
instance) Tapestry uses client-side Javascript instead. Apparently,
fields.js:40, or rather fields.coffee:81 must account for Bootstrap 4 (if
enabled). Unfortunately, I don't know how to fix it, but perhaps someone
else is willing to pick up from here.

Ticket?

Cheers,

Volker




Am Do., 31. März 2022 um 12:59 Uhr schrieb Volker Lamp <
volker.lamp@gmail.com>:

> Hello Thiago,
>
> I took a look at the 5.8.1 release. With Bootstrap 4 enabled, validation
> messages still appear in black, not in red.
>
> I'll create a JIRA ticket as a reminder for 5.8.2.
>
> Cheers,
>
> Volker
>
> Am Mo., 28. März 2022 um 15:21 Uhr schrieb Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com>:
>
>> On Sat, Feb 26, 2022 at 6:05 PM Volker Lamp <vo...@gmail.com>
>> wrote:
>>
>> > Hello, Tapestry developers -
>> >
>>
>> Hello, Volker and Tapestry community!
>>
>> Thank you very very much for noticing this and providing a solution. It
>> will be included in Tapestry 5.8.1. I've also added the configuration
>> symbol and an explanation to the Configuration class in the documentation.
>>
>> Cheers!
>>
>>
>> > Using Tapestry's BeanEditor component with Bootstrap 4, I'm trying to
>> get
>> > validation error messages appear with a red font color like they used to
>> > with Bootstrap 3.
>> >
>> > Trying to understand from the Tapestry source code why Tapestry outputs
>> > Bootstrap v3-style "help-block" instead of v4-style "form-text" [1], I
>> > became aware of the SymbolConstants.ERROR_CSS_CLASS configuration
>> symbol.
>> > Setting its value to "form-text text-danger" did the trick for me.
>> >
>> > Two recommendations for improvement:
>> >
>> > First, the Configuration page of the Tapestry website [2] doesn't
>> mention
>> > the ERROR_CSS_CLASS configuration symbol. It should be added to make it
>> > easier for other Tapestry users trying to solve the same problem or
>> similar
>> > problems.
>> >
>> > Second, importing  the Bootstrap4Module should provide validation
>> messages
>> > with a red font color as the default.
>> >
>> > Thank you for the time your are putting into Tapestry. I'm a big fan.
>> >
>> > Volker
>> >
>> > [1] https://getbootstrap.com/docs/4.3/components/forms/#help-text
>> > [2] https://tapestry.apache.org/configuration.html
>> >
>>
>>
>> --
>> Thiago
>>
>

Re: Bootstrap 4: Validation error messages in red font color

Posted by Volker Lamp <vo...@gmail.com>.
Hello Thiago

> Good catch! We will probably need to pass the symbol value to
> fields.[coffee,js] so I can use the right CSS classes. That shouldn't be
> complicated to do and we can take care of it in 5.8.2.
> 
>> Ticket?
> 
> Please! Ideally, all commits should mention at least one Jira ticket,
> specially ones changing code (well, I'd consider changing Javadoc not
> changing code).

See TAP5-2715. Looking forward to learning from the commit how it‘s done.

Thanks,

Volker
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: Bootstrap 4: Validation error messages in red font color

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, Apr 1, 2022 at 10:18 AM Volker Lamp <vo...@gmail.com> wrote:

> Hello again Thiago,
>

Hello, Volker!


> I must happily revise what I wrote yesterday.
>
> Actually, with Bootstrap 4 enabled, validation messages now appear in red
> *if
> one uses the Error component (<t:error>)*.
>

Happily the ticket I created was specifically about the Error component, so
I guess we consider it successfully fixed. :D


> If <t:error> is omitted (as is the case for BeanEditor component, for
> instance) Tapestry uses client-side Javascript instead. Apparently,
> fields.js:40, or rather fields.coffee:81 must account for Bootstrap 4 (if
> enabled). Unfortunately, I don't know how to fix it, but perhaps someone
> else is willing to pick up from here.
>

Good catch! We will probably need to pass the symbol value to
fields.[coffee,js] so I can use the right CSS classes. That shouldn't be
complicated to do and we can take care of it in 5.8.2.


> Ticket?
>

Please! Ideally, all commits should mention at least one Jira ticket,
specially ones changing code (well, I'd consider changing Javadoc not
changing code).

Cheers!


> Cheers,
>
> Volker
>
>
>
>
> Am Do., 31. März 2022 um 12:59 Uhr schrieb Volker Lamp <
> volker.lamp@gmail.com>:
>
> > Hello Thiago,
> >
> > I took a look at the 5.8.1 release. With Bootstrap 4 enabled, validation
> > messages still appear in black, not in red.
> >
> > I'll create a JIRA ticket as a reminder for 5.8.2.
> >
> > Cheers,
> >
> > Volker
> >
> > Am Mo., 28. März 2022 um 15:21 Uhr schrieb Thiago H. de Paula Figueiredo
> <
> > thiagohp@gmail.com>:
> >
> >> On Sat, Feb 26, 2022 at 6:05 PM Volker Lamp <vo...@gmail.com>
> >> wrote:
> >>
> >> > Hello, Tapestry developers -
> >> >
> >>
> >> Hello, Volker and Tapestry community!
> >>
> >> Thank you very very much for noticing this and providing a solution. It
> >> will be included in Tapestry 5.8.1. I've also added the configuration
> >> symbol and an explanation to the Configuration class in the
> documentation.
> >>
> >> Cheers!
> >>
> >>
> >> > Using Tapestry's BeanEditor component with Bootstrap 4, I'm trying to
> >> get
> >> > validation error messages appear with a red font color like they used
> to
> >> > with Bootstrap 3.
> >> >
> >> > Trying to understand from the Tapestry source code why Tapestry
> outputs
> >> > Bootstrap v3-style "help-block" instead of v4-style "form-text" [1], I
> >> > became aware of the SymbolConstants.ERROR_CSS_CLASS configuration
> >> symbol.
> >> > Setting its value to "form-text text-danger" did the trick for me.
> >> >
> >> > Two recommendations for improvement:
> >> >
> >> > First, the Configuration page of the Tapestry website [2] doesn't
> >> mention
> >> > the ERROR_CSS_CLASS configuration symbol. It should be added to make
> it
> >> > easier for other Tapestry users trying to solve the same problem or
> >> similar
> >> > problems.
> >> >
> >> > Second, importing  the Bootstrap4Module should provide validation
> >> messages
> >> > with a red font color as the default.
> >> >
> >> > Thank you for the time your are putting into Tapestry. I'm a big fan.
> >> >
> >> > Volker
> >> >
> >> > [1] https://getbootstrap.com/docs/4.3/components/forms/#help-text
> >> > [2] https://tapestry.apache.org/configuration.html
> >> >
> >>
> >>
> >> --
> >> Thiago
> >>
> >
>


-- 
Thiago