You can get the id by Id's plus varStatus index.
Example:
<tr:table id="tableId" varStatus="row"...
<tr:inputText id="inputId"...
<script>
document.getElementById('tableId:#{row.index}:inputId');
</script>
So you have the element in the dom tree, you can set what you want. Yous
a onclick event or something else.
Best regards Michael
Joris Kimpe schrieb:
I have a table containing in each cell of a column a panelPopup. This
panelPopup contains a tr:inputText wich needs to have to focus when the
popup is loaded. How can I do this? I think I need to develop some
javascript, but the id of the inputText contains some id. Is this for each
cell the same? Or how can I do this?
This is how my jsf page looks like:
...
<tr:panelPopup onclick="setCurrentSelectedDate('#{row.dateString}')"
text="create"
title="create #{row.dateStringForTitle} " modal="true"
position="relative" rendered="#row.isCreationAllowed}">
<tr:panelGroupLayout>
<tr:outputLabel value="Time"/>
<tr:inputText id="time" value="#{backingBean.time}"
maximumLength="8" immediate="true">
<tr:convertDateTime type="time" timeStyle="medium"/>
</tr:inputText>
<br/>
...
</tr:panelGroupLayout>
</tr:panelPopup>
This is my generated html:
...
<!--Start: org.apache.myfaces.trinidad.Input["timej_id_4"]-->
<input
id="personalShiftPlanOverviewForm:personalShiftPlanWeeklyOverviewTablePage:personalShiftPlanWeeklyOverviewTablej_id_1:0:timej_id_4"
name=
"personalShiftPlanOverviewForm:personalShiftPlanWeeklyOverviewTablePage:personalShiftPlanWeeklyOverviewTablej_id_1:0:timej_id_4"
class="x25" size="30" maxlength="8" type="text">
<!--Start: org.apache.myfaces.trinidad.Input["timej_id_4"]-->
<br>
Thanks!