I am using JSF 1.2, Richfaces 3.3.1 and I am trying to display a watermark in <rich:calendar>
.
I thought of using Watermark tag of primefaces <p:watermark>
and so i have included primefaces1.1.jar in my classpath. It works fine for input text, but when i tried it on Calendar by using forElement of Watermark it didn't work.
Please find the below code snippet, where I used the generated client id in the forElement attribute.
<p:watermark forElement = "#includeId:GroupMasterForm:arrDateInputDate input" value="dd/mm/yyyy"/>
Is there 开发者_如何学编程any workaround for that? Thanks in advance.
Some suggestions:
I think the problem is that you try to combine two different component libraries. I am not sure if this works at all.
You could try to use p:calendar
instead of rich:calendar
in order to test if this is the cause.
Furthermore, I think your forElement
content might be a reason. If calendar and watermark are siblings you can simply use the id of the calendar instead of the whole path.
Try this one:
<rich:calendar value="#{dataModel.date}" id="date"
datePattern="dd.MM.yyyy" enableManualInput="true"
showApplyButton="false" inputClass="watermark" required="true"/>
<p:watermark forElement=".watermark" value="TT.MM.JJJJ"/>
remember to define the p:watermark tag outside of rich:calendar
精彩评论