Struts2 Select UI 标签:在 Firefox 中使用所选项目进行渲染时出现问题
我对 Struts2 选择 UI 标签有问题。 Firefox 不显示所选项目。我在 JSP 中有代码:
<s:select list="allCategories" value="2" listKey="id" listValue="categoryName" name="selectedCategory" key="shortcut.add.category" required="true" />
它呈现为:
<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>
当我在 IE 中打开此操作时,它呈现良好(默认情况下选择选项 Catg1)。但 Firefox (3.6) 显示第一个选项为选定状态。我该如何解决?我使用Struts2的xhtml主题。
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" required="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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您生成的 HTML 在 Firefox 3.6.11 中正确显示。您是否确认您没有查看该页面的缓存版本?我看到
gtbfieldid
被添加到渲染的输出中。这不是 Google 工具栏吗?也许这会干扰某些事情?我看不出您的 select 元素有任何明显的错误,导致它无法在任何浏览器中正常工作。
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.