You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by parthiv pradhan <pa...@gmail.com> on 2011/05/28 07:31:34 UTC

Blank check validator in Trinidad 1.2

Hi All,

If a tr:inputbox has required="true" then the error message by default
appears at the bottom of the text box.
i) Can the postion of this in-built error message be changed?
ii) Can the appearance of this error message be changed by using a custom
stylesheet?

I cannot write a custom blank check validator because it would never be
called in case the text box is blank, instead the inbuilt blank check would
be called.

thanks
Parthiv

Re: Blank check validator in Trinidad 1.2

Posted by parthiv pradhan <pa...@gmail.com>.
please ignore this. seems like a conflict between trinidad components and
java JSF components. I placed the components inside trinidad table layout
instead of panelgrid and the error messages are shown in red color.

thanks

On Wed, Jun 1, 2011 at 10:57 PM, parthiv pradhan
<pa...@gmail.com>wrote:

> ahh was using <h:message>. once i used tr:message the message showed. but
> the behavior is very inconsistent.
> first the inlinestyle of the message sometimes work and sometimes it
> doesnot. I want to show the messages in red but most of the time the messges
> are shown in black colour.
>
> below is the .xhtml file content which i am using.
>
>
>
> <
> ui:composition xmlns:ui=*"http://java.sun.com/jsf/facelets"*
>
> xmlns:tr=*"http://myfaces.apache.org/trinidad"*
>
> xmlns:trh=*"http://myfaces.apache.org/trinidad/html"*
>
> xmlns:h=*"http://java.sun.com/jsf/html"*
>
> xmlns:f=*"http://java.sun.com/jsf/core"*
>
> xmlns:t=*"http://myfaces.apache.org/tomahawk"*
>
> xmlns:jsp=*"http://java.sun.com/JSP/Page"*>
>
> <tr:document id=*"docid"*>
>
> <tr:form id=*"frmdemo"*>
>
> <tr:panelBorderLayout>
>
> <tr:panelHorizontalLayout id=*"panelhr1"*>
>
> <tr:outputLabel value=*"Email"* id=*"emaillabel"* />
>
> <tr:inputText id=*"email"* required=*"true"* simple=*"true"*
>
> requiredMessageDetail=*"email cannot be left blank"*>
>
> <f:validator validatorId=*"emailValidator"* />
>
> </tr:inputText>
>
> <tr:message for=*"email"* inlineStyle=*"color: red;"* id=*"msgemail"*/>
>
> </tr:panelHorizontalLayout>
>
> <tr:panelHorizontalLayout id=*"panelhr2"*>
>
> <tr:outputLabel value=*"Quantity"* id=*"qtylabel"* />
>
> <tr:inputText id=*"qty"* value="#{loginBean.qty}" simple=*"true"* required
> =*"true"* requiredMessageDetail=*"qty cannot be left blank"*>
>
> </tr:inputText>
>
> <tr:message for=*"qty"* inlineStyle=*"color: red;"* id=*"msgqty"*/>
>
> </tr:panelHorizontalLayout>
>
> <tr:commandButton id=*"login"* text=*"Click me"*/>
>
> </tr:panelBorderLayout>
>
> </tr:form>
>
> </
> tr:document>
>
> </
> ui:composition>
>
>
> On Wed, Jun 1, 2011 at 9:54 PM, parthiv pradhan <parthiv.pradhan@gmail.com
> > wrote:
>
>>
>> thanks Cedric for the reply.
>> if I set the required and simple attribute to true and try to show a
>> custom message using tr:message then instead of the message appearing on the
>> page itself..the message appears on a popup.
>>
>> have been breaking my head over this but no luck yet.
>> thanks
>> Parthiv
>>
>>   On Sun, May 29, 2011 at 1:36 AM, Cédric Durmont <cd...@gmail.com>wrote:
>>
>>> Hi Prathiv,
>>> The easiest way to customize the position of your message is to add
>>> simple="true" to your tr:inputText, then add a tr:message component,
>>> linked to the inputText. See the Trinidad component guide for more
>>> details.
>>> I can't find the selector keys for skinning the messages, but they do
>>> exist : for instance, af|panelFormLayout:message-cell when the
>>> inputText is in a panelFormLayout. Check the generated source of your
>>> page.
>>>
>>> Hope this helps,
>>> Regards,
>>> Cedric Durmont
>>>
>>> 2011/5/28 parthiv pradhan <pa...@gmail.com>:
>>>  > Hi All,
>>> >
>>> > If a tr:inputbox has required="true" then the error message by default
>>> > appears at the bottom of the text box.
>>> > i) Can the postion of this in-built error message be changed?
>>> > ii) Can the appearance of this error message be changed by using a
>>> custom
>>> > stylesheet?
>>> >
>>> > I cannot write a custom blank check validator because it would never be
>>> > called in case the text box is blank, instead the inbuilt blank check
>>> would
>>> > be called.
>>> >
>>> > thanks
>>> > Parthiv
>>>
>>
>>
>

Re: Blank check validator in Trinidad 1.2

Posted by parthiv pradhan <pa...@gmail.com>.
ahh was using <h:message>. once i used tr:message the message showed. but
the behavior is very inconsistent.
first the inlinestyle of the message sometimes work and sometimes it
doesnot. I want to show the messages in red but most of the time the messges
are shown in black colour.

below is the .xhtml file content which i am using.



<ui:composition xmlns:ui=*"http://java.sun.com/jsf/facelets"
*

xmlns:tr=*"http://myfaces.apache.org/trinidad"
*

xmlns:trh=*"http://myfaces.apache.org/trinidad/html"
*

xmlns:h=*"http://java.sun.com/jsf/html"
*

xmlns:f=*"http://java.sun.com/jsf/core"
*

xmlns:t=*"http://myfaces.apache.org/tomahawk"
*

xmlns:jsp=*"http://java.sun.com/JSP/Page"*>

<tr:document id=*"docid"*>

<tr:form id=*"frmdemo"*>

<tr:panelBorderLayout>

<tr:panelHorizontalLayout id=*"panelhr1"*>

<tr:outputLabel value=*"Email"* id=*"emaillabel"* />

<tr:inputText id=*"email"* required=*"true"* simple=*"true"
*

requiredMessageDetail=*"email cannot be left blank"*>

<f:validator validatorId=*"emailValidator"* />

</tr:inputText>

<tr:message for=*"email"* inlineStyle=*"color: red;"* id=*"msgemail"*/>

</tr:panelHorizontalLayout>

<tr:panelHorizontalLayout id=*"panelhr2"*>

<tr:outputLabel value=*"Quantity"* id=*"qtylabel"* />

<tr:inputText id=*"qty"* value="#{loginBean.qty}" simple=*"true"* required=*
"true"* requiredMessageDetail=*"qty cannot be left blank"*>

</tr:inputText>

<tr:message for=*"qty"* inlineStyle=*"color: red;"* id=*"msgqty"*/>

</tr:panelHorizontalLayout>

<tr:commandButton id=*"login"* text=*"Click me"*/>

</tr:panelBorderLayout>

</tr:form>

</tr:document>

</ui:composition>


On Wed, Jun 1, 2011 at 9:54 PM, parthiv pradhan
<pa...@gmail.com>wrote:

>
> thanks Cedric for the reply.
> if I set the required and simple attribute to true and try to show a custom
> message using tr:message then instead of the message appearing on the page
> itself..the message appears on a popup.
>
> have been breaking my head over this but no luck yet.
> thanks
> Parthiv
>
>   On Sun, May 29, 2011 at 1:36 AM, Cédric Durmont <cd...@gmail.com>wrote:
>
>> Hi Prathiv,
>> The easiest way to customize the position of your message is to add
>> simple="true" to your tr:inputText, then add a tr:message component,
>> linked to the inputText. See the Trinidad component guide for more
>> details.
>> I can't find the selector keys for skinning the messages, but they do
>> exist : for instance, af|panelFormLayout:message-cell when the
>> inputText is in a panelFormLayout. Check the generated source of your
>> page.
>>
>> Hope this helps,
>> Regards,
>> Cedric Durmont
>>
>> 2011/5/28 parthiv pradhan <pa...@gmail.com>:
>>  > Hi All,
>> >
>> > If a tr:inputbox has required="true" then the error message by default
>> > appears at the bottom of the text box.
>> > i) Can the postion of this in-built error message be changed?
>> > ii) Can the appearance of this error message be changed by using a
>> custom
>> > stylesheet?
>> >
>> > I cannot write a custom blank check validator because it would never be
>> > called in case the text box is blank, instead the inbuilt blank check
>> would
>> > be called.
>> >
>> > thanks
>> > Parthiv
>>
>
>

Re: Blank check validator in Trinidad 1.2

Posted by parthiv pradhan <pa...@gmail.com>.
thanks Cedric for the reply.
if I set the required and simple attribute to true and try to show a custom
message using tr:message then instead of the message appearing on the page
itself..the message appears on a popup.

have been breaking my head over this but no luck yet.
thanks
Parthiv

On Sun, May 29, 2011 at 1:36 AM, Cédric Durmont <cd...@gmail.com> wrote:

> Hi Prathiv,
> The easiest way to customize the position of your message is to add
> simple="true" to your tr:inputText, then add a tr:message component,
> linked to the inputText. See the Trinidad component guide for more
> details.
> I can't find the selector keys for skinning the messages, but they do
> exist : for instance, af|panelFormLayout:message-cell when the
> inputText is in a panelFormLayout. Check the generated source of your
> page.
>
> Hope this helps,
> Regards,
> Cedric Durmont
>
> 2011/5/28 parthiv pradhan <pa...@gmail.com>:
>  > Hi All,
> >
> > If a tr:inputbox has required="true" then the error message by default
> > appears at the bottom of the text box.
> > i) Can the postion of this in-built error message be changed?
> > ii) Can the appearance of this error message be changed by using a custom
> > stylesheet?
> >
> > I cannot write a custom blank check validator because it would never be
> > called in case the text box is blank, instead the inbuilt blank check
> would
> > be called.
> >
> > thanks
> > Parthiv
>

Re: Blank check validator in Trinidad 1.2

Posted by Cédric Durmont <cd...@gmail.com>.
Hi Prathiv,
The easiest way to customize the position of your message is to add
simple="true" to your tr:inputText, then add a tr:message component,
linked to the inputText. See the Trinidad component guide for more
details.
I can't find the selector keys for skinning the messages, but they do
exist : for instance, af|panelFormLayout:message-cell when the
inputText is in a panelFormLayout. Check the generated source of your
page.

Hope this helps,
Regards,
Cedric Durmont

2011/5/28 parthiv pradhan <pa...@gmail.com>:
> Hi All,
>
> If a tr:inputbox has required="true" then the error message by default
> appears at the bottom of the text box.
> i) Can the postion of this in-built error message be changed?
> ii) Can the appearance of this error message be changed by using a custom
> stylesheet?
>
> I cannot write a custom blank check validator because it would never be
> called in case the text box is blank, instead the inbuilt blank check would
> be called.
>
> thanks
> Parthiv