on 01-05-2007 7:06 AM
Hi,
When delivering a repository manager, we need provide a configuration archive (cc.xml and co.xml). For an attribute cc.xml, can we display it as a dropdown list and let user choose the value?
For example, in cc.xml:
<attribute name="Protocol" type="string" default=""/>
I want do display a label "Protocol" before a dropdown list, in which the user can choose from "HTTP" and "HTTPS".
Normally the user can only fill in the blank of the attribute, but I wanna let user choose the value.
Thanks,
Ray
Hi,
try this:
<b><attribute name="Protocol" type="enum" values="HTTP,HTTPS" default="HTTP"/></b>
Hope this helps,
Romano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Romano,
Thanks very much~ That is really what I want.
Then, can I change the label for this attribute, which the user can see during configuration? I know by default "name" is used. For example, for <attribute name="Protocol" type="enum"/>, the user then sees "Protocol" as a label.
What should I do, if I wanna display a label different than the name? Or furthur, what if I wanna display different labels for this attribute for users from different locale, for I18N?
Thanks,
Ray
Hi,
I think you cannot change the label on thy fly. The internationalization on other hands should work.
Let's say you have in your <b>XXXX.cc.xml</b> this:
<b><attribute name="param_protocol" type="enum"/></b>
Create in the folder where you have <b>XXXX.cc.xml</b> file a folder <b>bundles</b>. inside this folder, inside this folder another folder <b>classes</b>. Here create a file <b>XXXX.properties</b> (XXXX is from your config name). So you will get this structure:
XXXX.cc.xml
bundles
classes
XXXX.properties
Inside this file you define labels for your properties, in this case:
lbl.param_protocol=Protocol
...
In fact I haven't tried it in another language, I suppose that creating <b>XXXX_de.properties</b> shold do the trick for DE language and so on.
Hope this helps,
Romano
Hi Romano,
Thanks for help. I've tested it according to your suggestion, but unfortunately only XXX.properties or XXX_en.properties takes effect, and other properties files does not.
For example, I have XXX_zh.properties and XXX_zh_CN.properties in the folder, in which I have:
lbl.Protocol=zhProtocol
. Then I log on to EP from a machine of which the locale is zh. but it still displays the literal in XXX_en.properties.
Awaiting help.... Could you help me realize this i18n?
Thanks,
Ray
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.