use of org.jaffa.modules.printing.components.formtemplatelookup.dto.FormTemplateLookupOutRowDto in project jaffa-framework by jaffa-projects.
the class FormTemplateLookupTx method buildDto.
// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private FormTemplateLookupOutDto buildDto(UOW uow, Collection results, FormTemplateLookupInDto input) throws UOWException {
FormTemplateLookupOutDto output = new FormTemplateLookupOutDto();
int maxRecords = input.getMaxRecords() != null ? input.getMaxRecords().intValue() : 0;
int counter = 0;
for (Iterator i = results.iterator(); i.hasNext(); ) {
if (++counter > maxRecords && maxRecords > 0) {
output.setMoreRecordsExist(Boolean.TRUE);
break;
}
FormTemplateLookupOutRowDto row = new FormTemplateLookupOutRowDto();
FormTemplate formTemplate = (FormTemplate) i.next();
// .//GEN-END:_buildDto_1_be
// Add custom code before all the setters //GEN-FIRST:_buildDto_1
// .//GEN-LAST:_buildDto_1
// .//GEN-BEGIN:_buildDto_FormId_1_be
row.setFormId(formTemplate.getFormId());
// .//GEN-END:_buildDto_FormId_1_be
// .//GEN-BEGIN:_buildDto_TemplateData_1_be
row.setTemplateData(formTemplate.getTemplateData());
// .//GEN-END:_buildDto_TemplateData_1_be
// .//GEN-BEGIN:_buildDto_LayoutData_1_be
row.setLayoutData(formTemplate.getLayoutData());
// .//GEN-END:_buildDto_LayoutData_1_be
// Add custom code to pass values to the dto //GEN-FIRST:_buildDto_2
// .//GEN-LAST:_buildDto_2
// .//GEN-BEGIN:_buildDto_3_be
output.addRows(row);
}
return output;
}
use of org.jaffa.modules.printing.components.formtemplatelookup.dto.FormTemplateLookupOutRowDto in project jaffa-framework by jaffa-projects.
the class FormTemplateLookupForm method populateRows.
// .//GEN-END:_doValidate_2_be
// .//GEN-BEGIN:_populateRows_1_be
/**
* This will populate the input GridModel with the data in the finderOutDto of the Component.
* @param rows The GridModel object to populate.
*/
public void populateRows(GridModel rows) {
rows.clearRows();
FormTemplateLookupOutDto outputDto = (FormTemplateLookupOutDto) ((FormTemplateLookupComponent) getComponent()).getFinderOutDto();
if (outputDto != null) {
GridModelRow row;
for (int i = 0; i < outputDto.getRowsCount(); i++) {
FormTemplateLookupOutRowDto rowDto = outputDto.getRows(i);
row = rows.newRow();
row.addElement(LookupComponent2.MULTI_SELECT_CHECKBOX, new CheckBoxModel(false));
row.addElement("formId", rowDto.getFormId());
row.addElement("templateData", rowDto.getTemplateData());
row.addElement("layoutData", rowDto.getLayoutData());
// .//GEN-END:_populateRows_1_be
// Add custom code for the row //GEN-FIRST:_populateRows_1
// .//GEN-LAST:_populateRows_1
// .//GEN-BEGIN:_populateRows_2_be
}
}
}
Aggregations