开发者

Struts2 Select UI tag: problem with rendering in Firefox with selected item

开发者 https://www.devze.com 2023-01-24 13:56 出处:网络
I have problem with Struts2 select UI tag. Firefox doesn\'t show selected item. I have code in JSP: <s:select list=\"allCategories\"value=\"2\" listKey=\"id\" listValue=\"categoryName\" name=\"sel

I have problem with Struts2 select UI tag. Firefox doesn't show selected item. I have code in JSP:

<s:select list="allCategories"  value="2" listKey="id" listValue="categoryName" name="selectedCategory"  key="shortcut.add.category" requ开发者_运维问答ired="true" />

It renders into:

<select gtbfieldid="49" name="selectedCategory" id="inputShortcuts_selectedCategory">
<option value="1">23456</option>
<option value="2" selected="selected">Catg1</option>
<option value="3">updated</option>

<option value="6">Category</option>
</select>

When I open this action in IE, it renders fine (option Catg1 is selected by default). But Firefox (3.6) shows first option as selected. How can I resolve it? I use xhtml theme of Struts2.


Your generated HTML displays correctly for me in Firefox 3.6.11. Have you confirmed that you are not viewing a cached version of the page? I see that gtbfieldid is being added to the rendered output. Isn't that from Google Toolbar? Perhaps that is interfering with something?

I can't see anything visibly wrong with your select element that would prohibit it from working properly in any browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消