首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TextField描述RichFaces

TextField描述RichFaces
EN

Stack Overflow用户
提问于 2013-05-22 03:46:48
回答 1查看 239关注 0票数 1

我正在使用richfaces,我需要在单击字段时显示"X“消息,如照片。这是我的xhtml代码:

代码语言:javascript
复制
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j">

    <rich:panel>
    <h:form>
        <h:panelGrid columns="3">
            <h:outputText value="Name:" />
            <h:inputText label="Name" id="name" required="true"
                value="#{loginAction.username}">
                <f:validateLength minimum="3" />
            </h:inputText>
            <rich:message for="name" style="color:red;">
                <f:facet name="errorMarker">
                    <h:graphicImage value="/img/error.gif" />
                </f:facet>
            </rich:message>

            <f:facet name="footer">
                <a4j:commandButton value="Validate" />
            </f:facet>
        </h:panelGrid>
    </h:form>
    </rich:panel>
</ui:composition>

我想要这样的东西,在提交之前,只有当字段被单击时:

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-22 04:01:23

使用richfaces的在文本框旁边显示一个可定制、可换皮的工具提示。在演示示例中:

代码语言:javascript
复制
<h:inputText label="Name" id="name" required="true" value="#{loginAction.username}">
            <f:validateLength minimum="3" />
               <rich:tooltip followMouse="false" showEvent="onclick" showDelay="1500" styleClass="tooltip-custom-body" layout="block">
            <span style="white-space: nowrap"> This tool-tip content is also <strong>pre-rendered</strong> to the
                page.<br /> </span>
     </rich:tooltip>
 </h:inputText>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16678249

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档