Board index JavaServer Faces General Multiple watermarks and inputtextareas in a datalist

Multiple watermarks and inputtextareas in a datalist

Components, Ajax Framework, Utilities and More.


Posts: 32
Hi,

What is the best way to have a datalist where each item has its own inputtextarea with an associated watermark (which is the same for all text areas)?

Right now, if I just have <h:inputTextarea id="comment" value=""/> and <p:watermark for="comment" value="Enter a comment" /> in the datalist, only the first text area displays the watermark.
I assume that is because any subsequent inputTextarea fields will have different ids to keep them unique. I tried to dynamically set the id of the text area component with <c:set target="#{component}" property="id" value="#{bean.Id}"/>, but that didn't work either.

Any help would be greatly appreciated.

Thanks!

T.

Return to General