I'm using teamstudio's unplugged for the record.
I'm trying to build a table using a repeat control with a view as a data source. The user should be able to change edit the documents and then save all data sources.
Below is a example that currently does not work. I have also tried using computed ids for all the different check-boxes in the cells and storing the UNID of the row's document in a hidden text field and then read every row based on the computed ids and saving them. That didn't work because computing ids in a repeater is impossible in unplugged despite tons of effort.
If i have done something wrong or there is a trick i haven't tried, i would love to hear about it.
<xp:table id="table">
<xp:tr>
<xp:td>Document name</xp:td>
<xp:td>Field1</xp:td>
<xp:td>Field2</xp:td>
<xp:td>Field3</xp:td>
</xp:tr>
<xp:repeat id="repeat1" rows="30"
value="#{TestDocs}" indexVar="index" var="Docs" first="0"
removeRepeat="true" repeatControls="true">
<xp:panel>
<xp:tr>
<xp:td>
<xp:text id="Name" escape="true"
value="#{document1.Name}">
</xp:text>
</xp:td>
<xp:td>
<xp:checkBox id="Field1"
checkedValue="true" uncheckedValue="false"
value="#{document1.Field1}">
<xp:this.defaultChecked><![CDATA[${javascript:
if(document1.getDocument().getItemValue("Field1")=="[true]"){
return true;
}else{
return false;
}}]]></xp:this.defaultChecked>
</xp:checkBox>
</xp:td>
<xp:td>
<xp:checkBox id="Field2"
checkedValue="true" uncheckedValue="false"
value="#{document1.Field2}">
<xp:this.defaultChecked><![CDATA[${javascript:
if(document1.getDocument().getItemValue("Field2")=="[true]"){
return true;
}else{
return false;
}}]]></xp:this.defaultChecked>
</xp:checkBox>
</xp:td>
<xp:td>
<xp:checkBox id="Field3"
checkedValue="true" uncheckedValue="false"
value="#{document1.Field3}">
<xp:this.defaultChecked><![CDATA[${javascript:
if(document1.getDocument().getItemValue("Field3")=="[true]"){
return true;
}else{
return false;
}}]]></xp:this.defaultChecked>
</xp:checkBox>
</xp:td>
</xp:tr>
</xp:panel>
</xp:repeat>
</xp:table>
<xp:button value="Save" id="button3"
styleClass="button">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete" disableValidators="true">
<xp:this.action>
<xp:save></xp:save>
</xp:this.action>
</xp:eventHandler>
</xp:button>