Hi,
we want to save the datas in the listgrid .we have associated datasource for the listgrid and by using the operationBindings we are calling the serverMethod with lookupstyle as spring. How to handle the list of values in delegate [ ie in java method which is associated with the ds].Please find the sample code below.
code
<isomorphic:loadDS ID=“masters_baserates_baseratesDS” />
<isomorphic:loadDS ID=“masters_baserates_baseratesListDS” />
isc.Label.create({
top:90,
left:170,
width:200,
contents:“Base Rates”,
styleName:“content_tbltitle”
});
isc.ListGrid.create({
height:210,
left:170,
top:150,
width:800,
ID:“baseRatesListGrid”,
alternateRecordStyles:false,
showAllRecords:true,
canSort:false,
canHover:false,
showRollOver:false,
border:“0px”,
canEdit:true,
editEvent:“click”,
editByCell:false,
dataSource:masters_baserates_baseratesDS,
fields:[
{title:“Base Rate Code *”, name:“baseRateCode”, type:“text”},
{
width:250,
baseStyle:“grid_valuecolumn2”,
title:“Description *”,
name:“description”,
type:“text”,
headerBaseStyle:“grid_header2”
},
{title:“Base Rate *”, name:“baseRate”, type:“float”},
{
width:150,
valueMap:{“false”:“false”, “true”:“true”},
baseStyle:“grid_valuecolumn2”,
title:“Disable”,
canToggle:true,
valueIcons:{“false”:“/dbfcweb/script/isomorphic/skins/standard/images/DynamicForm/unchecked.png”,
“true”:“/dbfcweb/script/isomorphic/skins/standard/images/DynamicForm/checked.png”},
name:“disable”,
type:“checkbox”,
headerBaseStyle:“grid_header2”
}
],
leaveScrollbarGap:false,
showHeader:true
});
baseRatesListGrid.fetchData();
isc.DynamicForm.create({
ID:“baseRateForm”,
height:20,
left:157,
top:360,
width:850,
cellPadding:5,
numCols:4,
colWidths:50,
layoutAlign:“center”,
fields:[
{ name: “baseRatesList”, title: “”, type: “canvas”,
canvas: “baseRatesListGrid”
},
{
name:“reverse”,
startRow:true,
width:100,
title:“Reverse”,
height:25,
align:“center”,
type:“button”,
endRow:false,
_constructor:“FormItem”
},
{
name:“details”,
startRow:false,
width:100,
title:“Details”,
height:25,
align:“center”,
type:“button”,
endRow:false,
_constructor:“FormItem”
},
{
name:“save”,
startRow:false,
width:100,
title:“Save”,
height:25,
align:“center”,
type:“button”,
endRow:false,
click:“baseRateForm.saveData()”,
_constructor:“FormItem”
},
{
name:“close”,
startRow:false,
width:100,
title:“Close”,
height:25,
align:“center”,
type:“button”,
endRow:true,
_constructor:“FormItem”
}
],
dataSource:“masters_baserates_baseratesListDS”
});
isc.Toolbar.create({
ID: “addButton”,
align: “left”,
membersMargin:1,
height: 30, left: 890, top: 338,
buttons:[
{title: “+”, width:20, height:15, click: “baseRatesListGrid.startEditingNew()”}
]
});
code
<DataSource
ID=“masters_baserates_baseratesListDS”
serverType=“generic”>
<fields>
<field name=“baseRatesList” type=“canvas” />
</fields>
<operationBindings>
<binding operationType="update" serverMethod="saveBaseRatesDetails">
<serverObject lookupStyle="spring" bean="dbfc.masters.system.BaseRatesDelegate"/>
</binding>
</operationBindings>
</DataSource>
Delegate Layer
public DSResponse saveBaseRatesDetails(BaseRates baseRates,DSResponse dsresponse){
getBaseRatesService().saveBaseRatesDetails(baseRates);0
return dsresponse;
}
Regards,
Arul.K