Hi all.
I've using an editable grid based on
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/tables/editablegridusingencoder1
but instead of having a submit button for the whole form, i've added a
Save button as a new property for every row, so every row can be saved
on its own.
<!-------------------------------- tml ---------------------------->
<form t:type="form" t:id="configurationEdit">
<t:errors/>
<table t:type="grid" t:source="configurations" t:row="configuration"
t:model="configurationModel" t:rowsPerPage="5"
t:exclude="category"
t:encoder="configurationEncoder" />
<p:ValueCell>
<input t:type="textfield" t:value="configuration.value"
t:id="newConfigValue" t:validate="required, maxlength=128" size="128"/>
<input t:type="hidden" t:value="newValue" t:id="newValue" />
</p:ValueCell>
<p:ActionsCell>
<t:actionlink t:id="saveRow" context="configContext">Save</t:actionlink>
</p:ActionsCell>
</table>
</form>
<script>
Event.observe('saveRow', 'click', function(event) {
alert(document.configurationEdit.newConfigValue.value);
document.configurationEdit.newValue.value =
document.configurationEdit.newConfigValue.value;
alert(document.configurationEdit.newValue.value);
});
</script>
<!------------------------- java --------------------------------->
public Object [] getConfigContext() {
// newValue is always null !
return new Object[] { configuration.getId(),newValue };
}
Object onActionFromSaveRow(Long id,String newValue) {
LOGGER.info("Object ID "+id+". NewValue to save =
"+newValue);
}
My main problem is how to get the new textfield value.
The click event on the saveRow is not called ( at least, the alert does
not shows up :-( )
Is there any solution anyone can tell me ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org