*/
public void doubleClick(int rowNumber,ValueObject persistentObject) {
new ScheduledActivityController(
panel.getGrid(),
null,
new ScheduledActivityPK(
((GridScheduledActivityVO)persistentObject).getCompanyCodeSys01SCH06(),
((GridScheduledActivityVO)persistentObject).getProgressiveSCH06()
),
true
);
}
/**
* Callback method invoked before saving data when the grid was in INSERT mode (on pressing save button).
* @return <code>true</code> allows the saving to continue, <code>false</code> the saving is interrupted
*/
public boolean beforeInsertGrid(GridControl grid) {
if (super.beforeInsertGrid(grid)) {
ScheduledActivityController c = new ScheduledActivityController(panel.getGrid(),null,null,true);
c.getControlSubjectType().setValue(controlSubjectType.getValue());
if (controlSubjectType.getValue().equals(ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER)) {
OrganizationCustomerVO model = (OrganizationCustomerVO)customerPanel.getVOModel().getValueObject();
c.getControlName_1Subject().setValue(model.getName_1REG04());
c.getControlName_2Subject().setValue(model.getName_2REG04());
ScheduledActivityVO actVO = (ScheduledActivityVO)c.getVOModel().getValueObject();
actVO.setProgressiveReg04SubjectSCH06(model.getProgressiveREG04());
c.getDetailFrame().getMainForm().getForm().pull("progressiveReg04SubjectSCH06");
}
else {
PeopleCustomerVO model = (PeopleCustomerVO)customerPanel.getVOModel().getValueObject();
c.getControlName_1Subject().setValue(model.getName_1REG04());
c.getControlName_2Subject().setValue(model.getName_2REG04());
ScheduledActivityVO actVO = (ScheduledActivityVO)c.getVOModel().getValueObject();
actVO.setProgressiveReg04SubjectSCH06(model.getProgressiveREG04());
c.getDetailFrame().getMainForm().getForm().pull("progressiveReg04SubjectSCH06");
}
}
return false;
}
/**
* Method invoked when the user has clicked on delete button and the grid is in READONLY mode.
* @param persistentObjects value objects to delete (related to the currently selected rows)
* @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
*/
public Response deleteRecords(ArrayList persistentObjects) throws Exception {
GridScheduledActivityVO vo = null;
ScheduledActivityPK pk = null;
ArrayList pks = new ArrayList();
for(int i=0;i<persistentObjects.size();i++) {
vo = (GridScheduledActivityVO)persistentObjects.get(i);
pk = new ScheduledActivityPK(vo.getCompanyCodeSys01SCH06(),vo.getProgressiveSCH06());
pks.add(pk);
}
Response response = ClientUtils.getData("deleteScheduledActivities",pks);
return response;
}