You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Struts2 Fan <st...@gmail.com> on 2007/02/04 12:11:46 UTC

[S2] How to use a bundle message in a validation

Hi all,

I put the message on the right hand side of the tag with writing my own
theme. (Thanks for all)

But i cannot put the <div> tag on the message.

struts.properties
errorage=<div name="ageerror"><img src="images/mistake.jpg" /></div>

myAction-validation.xml
<field name="age">
        <field-validator type="int" >
            <param name="min">13</param>
            <param name="max">19</param>
            <message key="errorage"/>
        </field-validator>
    </field>

It writes "errorage" on the page not the div element.
Am I doing something wrong?

Re: [S2] How to use a bundle message in a validation

Posted by Dave Newton <ne...@yahoo.com>.
--- Struts2 Fan <st...@gmail.com> wrote:
> struts.properties
> errorage=<div name="ageerror"><img
> src="images/mistake.jpg" /></div>
> Am I doing something wrong?

I don't know what the "name" attribute is; I only know
about "id" and "class" for styling-type things.

If you seriously want a different div for each field
(which strikes me odd, but I can imagine use-cases)
then you will probably want to write an FTL that
constructs a div id/class name out of the field name
or something.

d.



 
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org