Search in sources :

Example 1 with FormGroupLookupOutRowDto

use of org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutRowDto in project jaffa-framework by jaffa-projects.

the class FormGroupLookupTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private FormGroupLookupOutDto buildDto(UOW uow, Collection results, FormGroupLookupInDto input) throws UOWException {
    FormGroupLookupOutDto output = new FormGroupLookupOutDto();
    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;
        }
        FormGroupLookupOutRowDto row = new FormGroupLookupOutRowDto();
        FormGroup formGroup = (FormGroup) 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_FormName_1_be
        row.setFormName(formGroup.getFormName());
        // .//GEN-END:_buildDto_FormName_1_be
        // .//GEN-BEGIN:_buildDto_Description_1_be
        row.setDescription(formGroup.getDescription());
        // .//GEN-END:_buildDto_Description_1_be
        // .//GEN-BEGIN:_buildDto_FormType_1_be
        row.setFormType(formGroup.getFormType());
        // .//GEN-END:_buildDto_FormType_1_be
        // .//GEN-BEGIN:_buildDto_CreatedOn_1_be
        row.setCreatedOn(formGroup.getCreatedOn());
        // .//GEN-END:_buildDto_CreatedOn_1_be
        // .//GEN-BEGIN:_buildDto_CreatedBy_1_be
        row.setCreatedBy(formGroup.getCreatedBy());
        // .//GEN-END:_buildDto_CreatedBy_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedOn_1_be
        row.setLastChangedOn(formGroup.getLastChangedOn());
        // .//GEN-END:_buildDto_LastChangedOn_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedBy_1_be
        row.setLastChangedBy(formGroup.getLastChangedBy());
        // .//GEN-END:_buildDto_LastChangedBy_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;
}
Also used : FormGroupLookupOutDto(org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutDto) FormGroup(org.jaffa.modules.printing.domain.FormGroup) FormGroupLookupOutRowDto(org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutRowDto)

Example 2 with FormGroupLookupOutRowDto

use of org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutRowDto in project jaffa-framework by jaffa-projects.

the class FormGroupLookupForm 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();
    FormGroupLookupOutDto outputDto = (FormGroupLookupOutDto) ((FormGroupLookupComponent) getComponent()).getFinderOutDto();
    if (outputDto != null) {
        GridModelRow row;
        for (int i = 0; i < outputDto.getRowsCount(); i++) {
            FormGroupLookupOutRowDto rowDto = outputDto.getRows(i);
            row = rows.newRow();
            row.addElement(LookupComponent2.MULTI_SELECT_CHECKBOX, new CheckBoxModel(false));
            row.addElement("formName", rowDto.getFormName());
            row.addElement("description", rowDto.getDescription());
            row.addElement("formType", rowDto.getFormType());
            row.addElement("createdOn", rowDto.getCreatedOn());
            row.addElement("createdBy", rowDto.getCreatedBy());
            row.addElement("lastChangedOn", rowDto.getLastChangedOn());
            row.addElement("lastChangedBy", rowDto.getLastChangedBy());
        // .//GEN-END:_populateRows_1_be
        // Add custom code for the row //GEN-FIRST:_populateRows_1
        // .//GEN-LAST:_populateRows_1
        // .//GEN-BEGIN:_populateRows_2_be
        }
    }
}
Also used : FormGroupLookupOutDto(org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutDto) FormGroupLookupOutRowDto(org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutRowDto)

Aggregations

FormGroupLookupOutDto (org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutDto)2 FormGroupLookupOutRowDto (org.jaffa.modules.printing.components.formgrouplookup.dto.FormGroupLookupOutRowDto)2 FormGroup (org.jaffa.modules.printing.domain.FormGroup)1