<s:action namespace="/tags/ui" name="actionTagExample" executeResult="true"/>
<s:submit method="save" value="Save all persons"/>
<%--s:textfield label="%{getText('word.id.label')}" name="currentWord.id"/--%>//注释
<s:radio list="#{'male':'男','female':'女'}" name="personsex" theme="simple"/>
或者(数据库存'男'或'女')
<s:radio list="{'男','女'}" name="personsex" theme="simple"/>
<s:label label="%{#st.index}" value="%{content}" ></s:label><br>
<sx:head extraLocales="en-us,nl-nl,de-de" />
<sx:datetimepicker label="With value='today'" name="dddp1" value="%{'today'}" />
<sx:head extraLocales="en-us,nl-nl,de-de" />不可缺
这个标签会显示一个文本框,值是2009-7-14这样的值,默认为today.还可以自已选择,会出来一个日历面板。在应用页面需要去掉<base href="<%=basePath%>">
<s:actionerror/>
<s:actionmessage/>
<s:fielderror />
<s:form action="exampleSubmit" enctype="multipart/form-data" javascriptTooltip="true">
<s:textfield
label="Name"
name="name"
tooltip="Enter your Name here"/>这个tooltip配合javascriptTolltip使用,在页面点击会显示出来。
<s:textarea
tooltip="Enter your Biography"
label="Biography"
name="bio"
cols="20"
rows="3"/>
<s:select
tooltip="Choose Your Favourite Color"
label="Favorite Color"
list="{'Red', 'Blue', 'Green'}"
name="favouriteColor"
emptyOption="true"
headerKey="None"
headerValue="None"/>默认值
还有属性:
list="favouriteLanguages"
name="favouriteLanguage"
listKey="key"
listValue="description"
emptyOption="true"
<s:checkboxlist 多个checkbox
tooltip="Choose your Friends"
label="Friends"
list="{'Patrick', 'Jason', 'Jay', 'Toby', 'Rene'}"
name="friends"/>
<s:doubleselect //两个select,一个select选择值,会影响另一个select的选项,是对应的。
tooltip="Choose Your State"
formName="registryForm" //必填
label="State"
name="region" list="{'North', 'South'}" 第一个select的选项
value="'South'"
doubleValue="'Florida'" 默认值
doubleList="top == 'North' ? {'Oregon', 'Washington'} : {'Texas', 'Florida'}" 第二个select选项
doubleName="state"
headerKey="-1"
headerValue="---------- Please Select ----------"
emptyOption="true" />
<s:doubleselect
label="Favourite Vehical"
name="favouriteVehicalType"
list="vehicalTypeList"
listKey="key"
listValue="description"
value="'MotorcycleKey'"
doubleValue="'YamahaKey'"
doubleList="vehicalSpecificList"
doubleListKey="key"
doubleListValue="description"
doubleName="favouriteVehicalSpecific" headerKey="-1"
headerValue="---------- Please Select ----------"
emptyOption="true" />
<s:file
label="Picture"
name="picture" />
<s:optiontransferselect
tooltip="Select Your Favourite Cartoon Characters"
label="Favourite Cartoons Characters"
name="leftSideCartoonCharacters"
leftTitle="Left Title"
rightTitle="Right Title"
list="{'Popeye', 'He-Man', 'Spiderman'}" 左边选项
multiple="true" 可以多选
headerKey="headerKey"
headerValue="--- Please Select ---" 显示在左边选项的最上面
emptyOption="true" 可以为空
doubleList="{'Superman', 'Mickey Mouse', 'Donald Duck'}" 右边选项
doubleName="rightSideCartoonCharacters"
doubleHeaderKey="doubleHeaderKey"
doubleHeaderValue="--- Please Select ---"
doubleEmptyOption="true"
doubleMultiple="true" />
这个最有意思,是两个select ,可以两边互选
不写headerKey,headerValue.所有选项将从最上面显示。写emptyOption="true",将会空出一行。
size="1" multiple="false" 左边显示一行,象个select
doubleSize="5" doubleMultiple="true" 右边5行,可以多选
allowAddAllToLeft="false" 右边禁用全选
allowAddAllToRight="false" 左边禁用全选
allowSelectAll="false"
<s:submit />
<s:reset onclick="alert('Resetting form now... Press OK to continue!');" />