Reputation: 58103
I have my inputText in the form i can get its value by the following code
<h:inputText value="hello world" id="myidtest" />
alert($(#{rich:element('myidtest')}).val());
If i put my inputText under rich:datatable then alert($(#{rich:element('myidtest')}).val());
gives undefined after some r&D i found that rich:elment reference not returning object if it is under rich:datatable
any quick help appriciated
Upvotes: 0
Views: 775
Reputation: 14943
That is because each column will have a different generated id
Use columns tag to set the id based on the column index
<rich:columns value="#{dataTableScrollerBean.columns}" var="columns" index="ind" id="column#{ind}">
The generated id will look like id="formId:tableId:rowIndex:column1"
then you can use
jQuery(#{rich:element('formId:tableId:rowIndex:column1')}).
If that does not work post the generated html for that element.
Upvotes: 1