Thanks, but this would not work in my case.
I have to check whether there are messages for specific fields.
Better sample:
I have a required editable inputField carID and want to output the name of the
car if there are no errors for the carID field. If the carID field is changed
then I clear the carName immediately via JS. When there is now a validation
error for carID, then the old carName is displayed again.
I want to suppress the carName in errorCase.
<t:inputText id="carId" required="true"
value="#{MyBean.attributes['carId']}"
onchange="document.getElementById('carname').innerText='')";/>
<t:message for="carId" showDetail...>
<t:outputText id="carName"
value="#{MyBean.attributes['carName']}"
rendered=???empty messages['carId']???
I hope there is a Map with messages, that would be accessible with the
fieldID????
Michael
-----Original Message-----
From: Gerald Müllan [mailto:[EMAIL PROTECTED]
Sent: Montag, 28. August 2006 12:20
To: MyFaces Discussion
Subject: Re: output text depending on message
Hi,
what is about rendering the outputText in case if there are no
messages in the FacesContext waiting to be displayed:
FacesContext.getCurrentInstance().getMessages().hasNext()
Place this in a method-binding in the backend. Should work to me.
cheers,
Gerald
On 8/28/06, Michael Heinen <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi all,
>
>
>
> I have to output some text in the case that there isn't a message for a
> component.
>
> How can I achieve this?
>
>
>
> <t:inputText id="aField">...
>
> <t:message for ="aField" showDetail ...>
>
>
>
> <t:outputText value="ok" rendered=??? aField ???
>
>
>
> I remember that this has been discussed here but I can't find it anymore.
>
>
>
> Michael
--
Gerald Müllan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506
[EMAIL PROTECTED]