The addMessage() method in AppFuse adds a message to the session that
messages.jsp can read. You might look into using JSF's API instead.

Matt

On 12/31/07, Ding, Qin <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Appfuse 1.9.4/DB2/JSF
>
>
>
> I am using the same logic as UserExistsException to do my own checking for
> the existence of the record.  The backend is working fine in throwing errors
> when record already exists in the database.  However, in JSF page, the error
> message is not shown.
>
>
>
> In JSF form,
>
>
>
> try{
>
> accountTypeManager.saveAccountType(accountType);
>
> }catch(RecordExistsException e){
>
> addMessage("error.record.exists");  // error.record.exists is the key in the
> bundle file
>
>       return "error";
>
> }
>
>
>
> In JSF page,
>
> <div class="required"><span class="labelIconLeft"><img
> src="../common/images/required.gif" alt="Required" /></span>
>
>       <span class="label">
>
>             <h:outputLabel for="name" value="#{text['accountType.name']}"/>
>
>       </span>
>
>
>
>       <span class="input">
>
>             <h:inputText id="name"
> value="#{accountTypeForm.accountType.name}">
>
>                   <v:commonsValidator type="required"
> arg="#{text['accountType.name']}"/>
>
>             </h:inputText>
>
>             <t:message for="name" styleClass="fieldError"/>
>
>       </span>
>
> </div>
>
>
>
> What did I miss here? How does <t:message> know what message in the faces
> context to display?  Thank you.
>
>
>
> QD

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to