<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%--@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"--%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/tooltip" prefix="rich"%>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/componentControl" prefix="cc"%>

<html>
	<head>
		<title></title>
	</head>
	<body>
		<f:view>
			<h:form>
				<h:commandLink action="demo">demo.jsf</h:commandLink>
			</h:form>
			<h:form>
				<h:selectOneRadio binding="#{skinBean.component}" />
				<h:commandLink action="#{skinBean.change}" value="set skin" />
				<f:verbatim>
					<br/><br/>
					<div style="position:relative;top:100px;left:100px;">
				</f:verbatim>
				<h:commandButton value="Tooltip with followMouse mode" id="btn">
					<rich:toolTip id="tt" followMouse="true" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" layout="block">
						<f:facet name="defaultContent"><f:verbatim>DEFAULT CONTENT</f:verbatim>
						</f:facet>
						<h:outputText id="ot" value="#{bean.toolTipContent}"></h:outputText>
						<h:commandLink value="You can click here..."></h:commandLink>
					</rich:toolTip>
				</h:commandButton>
				<f:verbatim>
					</div>
				</f:verbatim>
				<h:commandLink value="Simple Link" id="link">
					<rich:toolTip id="toolTipForLink" followMouse="false" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" layout="block">
						<f:facet name="defaultContent"><f:verbatim>DEFAULT LINK CONTENT</f:verbatim>
						</f:facet>
						<h:outputText id="outText" value="#{bean.toolTipContent}"></h:outputText>
					</rich:toolTip>
				
				</h:commandLink>
				<h:outputText id="text" value="Text with tooltip">
					<rich:toolTip id="toolTipForText" followMouse="false" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" layout="inline">
					</rich:toolTip>				
				</h:outputText>
				<%-- h:commandButton value="Tooltip with followMouse mode" id="btn">
					<tt:toolTip value="Tooltip text" followMouse="false" onclick="alert('onlcick');" direction="bottom-left"></tt:toolTip>
				</h:commandButton--%>
				
				<%--a4j:log popup="false" level="ALL"></a4j:log--%>
			
				<h:outputText id="text1" value="Text with tooltip">
					<rich:toolTip id="controlledTooltip" followMouse="false" direction="top-right" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" layout="inline">
					</rich:toolTip>				
				</h:outputText>
			
				<f:verbatim>
					<br />
					<span id="controlInput">
					Mouse down here
					</span>
				</f:verbatim>

				<cc:componentControl event="mousedown" operation="show" for="controlledTooltip" attachTo="controlInput" />
				<cc:componentControl event="mouseup" operation="hide" for="controlledTooltip" attachTo="controlInput" />
			</h:form>
			
		</f:view>
	</body>	
</html>  

