Page 1 of 1

Multiple watermarks and inputtextareas in a datalist

Posted: 13 Mar 2011, 22:42
by tomik
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.