How is it possible to display a simple message in a JSF application when the mouse moves over a specific element of the interface? I have tried this code, but it didn't work, no message is displayed:
JSF file:
<h:form id ="f">
<h:selectManyCheckbox onmouseover="#{hello.message()}" layout="pageDirection" border="1" value="#{hello.customersSelect}">
<f:selectItems value="#{hello.customers}"></f:selectItems>
</h:selectManyCheckbox><br />
<h:commandButton action="response.xhtml" value="Click me" />
</h:form>
The backing bean Hello (ManagedBean) contains the method message() as:
public void message(){
FacesContext.getCurrentInstance().addMessage("f", new FacesMessage("Done"));
}
I suppose I should add somewhere a tag h:message, but I couldn't get it done, despite my efforts. Any hint?
titleattribute containing your message as a String?onmouseoveris a JavaScript function and you're passing a server side method. Change it for a JavaScript function that handles your message presentation (analertor something else).