“title” attribute for <html:options> struts

2019-08-23 10:28发布

In a regular select box you can show the full title on mouseover using "title" attribute in the "option" field.

In Apache Struts, you make the select box with the "html:options" tag. I don't think this tag supports the "title" attribute. Is there another way to show the full title of an option on mouseover for the "html:options" struts tag?

Thanks

3条回答
Rolldiameter
2楼-- · 2019-08-23 11:09

Struts' tag for <select><option>.. is <s:select />, or <s:doubleselect /> for double lists. <s:doubleselect /> doesn't support title at all, you have to modify the Javascript it generates by hand (ddoubleselect.ftl). For with the default theme, the file is found in struts2-core-2.1.6.jar under template/simple/.

查看更多
戒情不戒烟
3楼-- · 2019-08-23 11:21

I'll admit to not being familiar with Apache Struts. If nobody more familiar can find you a better solution then worst case you could do it as a javascript tooltip. It's more effort, but gives you more effective visual control over the presentation.

查看更多
Evening l夕情丶
4楼-- · 2019-08-23 11:22

hard code in html or jsp file is a bad code practice.

if you are writing code in struts 1.x try to store all messages in MessageResources_en.properties

try update your jsp with following (alternatively go for )

title="<bean:message key="your_tool_tip"/>

and modify MessageResources_en.properties

your_tool_tip=toolTIp is a cool idea

ps there are solutions available in jquery as well

查看更多
登录 后发表回答