Search in sources :

Example 11 with CheckBoxModel

use of org.jaffa.presentation.portlet.widgets.model.CheckBoxModel in project jaffa-framework by jaffa-projects.

the class CheckBoxForm method getFieldLinkedToCCAndCachedWM.

public WidgetModel getFieldLinkedToCCAndCachedWM() {
    if (w_fieldLinkedToCCAndCached == null) {
        w_fieldLinkedToCCAndCached = (CheckBoxModel) getWidgetCache().getModel("fieldLinkedToCCAndCached");
        if (w_fieldLinkedToCCAndCached == null) {
            w_fieldLinkedToCCAndCached = new CheckBoxModel(getFieldLinkedToCCAndCached());
            getWidgetCache().addModel("fieldLinkedToCCAndCached", w_fieldLinkedToCCAndCached);
        }
    }
    return w_fieldLinkedToCCAndCached;
}
Also used : CheckBoxModel(org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)

Example 12 with CheckBoxModel

use of org.jaffa.presentation.portlet.widgets.model.CheckBoxModel in project jaffa-framework by jaffa-projects.

the class GridForm method createNewTreeModel.

private GridModel createNewTreeModel() {
    GridModel model = new GridModel();
    GridModelRow row;
    // Root Node 1
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    // Root Node 2
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(1));
    row.addElement("field1", new EditBoxModel("Field11Value"));
    row.addElement("field2", new EditBoxModel("Field12Value"));
    row.addElement("field3", new DateTimeModel());
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field21Value"));
    row.addElement("field2", new EditBoxModel("Field22Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field23Value"));
    row.addElement("field2", new EditBoxModel("Field24Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(3));
    row.addElement("field1", new EditBoxModel("Field31Value"));
    row.addElement("field2", new EditBoxModel("Field32Value"));
    row.addElement("field3", new DateTimeModel(DateTime.addMonth(new DateTime(), 1)));
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value3"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(2));
    row.addElement("field1", new EditBoxModel("Field43Value"));
    row.addElement("field2", new EditBoxModel("Field44Value"));
    row.addElement("field3", new DateTimeModel(new DateTime()));
    row.addElement("field4", new CheckBoxModel(false));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(3));
    row.addElement("field1", new EditBoxModel("Field51Value"));
    row.addElement("field2", new EditBoxModel("Field52Value"));
    row.addElement("field3", new DateTimeModel(DateTime.addMonth(new DateTime(), 1)));
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value3"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(4));
    row.addElement("field1", new EditBoxModel("Field61Value"));
    row.addElement("field2", new EditBoxModel("Field62Value"));
    row.addElement("field3", new DateTimeModel(DateTime.addMonth(new DateTime(), 1)));
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value3"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("level", new Integer(5));
    row.addElement("field1", new EditBoxModel("Field71Value"));
    row.addElement("field2", new EditBoxModel("Field72Value"));
    row.addElement("field3", new DateTimeModel(DateTime.addMonth(new DateTime(), 1)));
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value3"));
    row = model.newRow();
    row.addElement("isExpanded", new Boolean(false));
    row.addElement("isTarget", new Boolean(false));
    row.addElement("isParent", new Boolean(true));
    row.addElement("level", new Integer(3));
    row.addElement("field1", new EditBoxModel("Field81Value"));
    row.addElement("field2", new EditBoxModel("Field82Value"));
    row.addElement("field3", new DateTimeModel(DateTime.addMonth(new DateTime(), 1)));
    row.addElement("field4", new CheckBoxModel(true));
    row.addElement("field6", new DropDownModel("Value3"));
    return model;
}
Also used : GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) DateTimeModel(org.jaffa.presentation.portlet.widgets.model.DateTimeModel) DropDownModel(org.jaffa.presentation.portlet.widgets.model.DropDownModel) EditBoxModel(org.jaffa.presentation.portlet.widgets.model.EditBoxModel) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow) DateTime(org.jaffa.datatypes.DateTime) CheckBoxModel(org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)

Example 13 with CheckBoxModel

use of org.jaffa.presentation.portlet.widgets.model.CheckBoxModel in project jaffa-framework by jaffa-projects.

the class FormSelectionMaintenanceComponent method doPrintForms.

public FormKey doPrintForms(GridModel model) throws ApplicationExceptions, FrameworkException {
    FormKey fk = null;
    GridModelRow row = null;
    ApplicationExceptions appExps = null;
    CheckBoxModel checkBoxModel = null;
    boolean isValidationOk = true;
    boolean isSelected = false;
    try {
        if (model != null && model.getRows() != null && model.getRows().size() > 0) {
            for (Iterator itr = model.getRows().iterator(); itr.hasNext(); ) {
                appExps = new ApplicationExceptions();
                row = (GridModelRow) itr.next();
                // Field validation
                checkBoxModel = (CheckBoxModel) row.get("select");
                if (checkBoxModel.getState()) {
                    isSelected = true;
                }
                validateFields(row, appExps, false);
                row.addElement("errMessage", appExps);
                if (appExps != null && appExps.size() > 0) {
                    if (isValidationOk) {
                        isValidationOk = false;
                    }
                }
            }
            if (isSelected && isValidationOk) {
                String variation = VariationContext.getVariation();
                for (Iterator itr = model.getRows().iterator(); itr.hasNext(); ) {
                    try {
                        row = (GridModelRow) itr.next();
                        checkBoxModel = (CheckBoxModel) row.get("select");
                        if (checkBoxModel.getState()) {
                            if (log.isDebugEnabled()) {
                                log.debug("Just before dispatching Print request");
                            }
                            row.addElement("formVariation", variation);
                            m_tx.dispatchPrintRequest(createPrintRequestObject(row, false));
                        // itr.remove();
                        }
                    } catch (ApplicationExceptions ae) {
                        row.addElement("errMessage", ae);
                        isValidationOk = false;
                    } catch (FrameworkException fe) {
                        row.addElement("errMessage", fe);
                        isValidationOk = false;
                    }
                }
            }
            if (!isValidationOk) {
                fk = getResultsFormKey();
            }
        }
    } catch (ApplicationExceptions applicationException) {
        throw applicationException;
    } catch (FrameworkException frameworkException) {
        throw frameworkException;
    }
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) Iterator(java.util.Iterator) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow) CheckBoxModel(org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)

Example 14 with CheckBoxModel

use of org.jaffa.presentation.portlet.widgets.model.CheckBoxModel in project jaffa-framework by jaffa-projects.

the class FormSelectionMaintenanceComponent method display.

/**
 * Following attributes can be set on component invocation to control the types of output allowed
 *  directDisplay (), printing (), email(), webPublish(), autoDisplayAll()
 */
public FormKey display() throws ApplicationExceptions, FrameworkException {
    FormKey fk = null;
    GridModel rows = new GridModel();
    fileNames = new StringBuilder();
    if (getAutoDisplayAll()) {
        setDirectDisplay(true);
        setPrinting(false);
        setEmail(false);
        setWebPublish(false);
    }
    if (getAutoDisplayAll()) {
        FormSelectionMaintenanceOutDto finderOutDto = (FormSelectionMaintenanceOutDto) doInquiry();
        if (finderOutDto != null && finderOutDto.getRowsCount() > 0) {
            if (log.isDebugEnabled()) {
                log.debug("Form Preview for event " + getEvent() + ", Key1=" + getKey1() + ", Key2=" + getKey2() + ", Key3=" + getKey3() + ", Key4=" + getKey4() + ", Key5=" + getKey5() + ", Key6=" + getKey6() + ".  Found " + finderOutDto.getRowsCount() + " rows.");
            }
            for (int i = 0; i < finderOutDto.getRowsCount(); i++) {
                FormSelectionMaintenanceOutRowDto rowDto = finderOutDto.getRows(i);
                rowDto.setSelect(Boolean.TRUE);
                rowDto.setAdditionalDataObject(getAdditionalDataObject());
                GridModelRow row = rows.newRow();
                row.addElement("select", new CheckBoxModel((rowDto.getSelect() != null ? rowDto.getSelect() : Boolean.FALSE)));
                row.addElement("errMessage", rowDto.getErrMessage());
                row.addElement("formName", rowDto.getFormName());
                row.addElement("event", rowDto.getEvent());
                row.addElement("key1", rowDto.getKey1());
                row.addElement("key2", rowDto.getKey2());
                row.addElement("key3", rowDto.getKey3());
                row.addElement("key4", rowDto.getKey4());
                row.addElement("key5", rowDto.getKey5());
                row.addElement("key6", rowDto.getKey6());
                row.addElement("value1", rowDto.getValue1());
                row.addElement("value2", rowDto.getValue2());
                row.addElement("value3", rowDto.getValue3());
                row.addElement("value4", rowDto.getValue4());
                row.addElement("value5", rowDto.getValue5());
                row.addElement("value6", rowDto.getValue6());
                row.addElement("printer", rowDto.getPrinter());
                row.addElement("email", rowDto.getEmail());
                row.addElement("publish", new CheckBoxModel((rowDto.getPublish() != null ? rowDto.getPublish() : Boolean.FALSE)));
                row.addElement("copies", rowDto.getCopies());
                EditBoxModel printerModel = new EditBoxModel(rowDto.getPrinter(), PrinterDefinitionMeta.META_PRINTER_ID);
                printerModel.setMandatory(false);
                row.addElement("printer", printerModel);
                row.addElement("email", new EditBoxModel(rowDto.getEmail()));
                row.addElement("copies", new EditBoxModel(rowDto.getCopies()));
                row.addElement("formType", rowDto.getFormType());
                row.addElement("object", rowDto);
                row.addElement("additionalDataComponent", rowDto.getAdditionalDataComponent());
                fk = doShowForm(row);
                if (finderOutDto.getRowsCount() == 1 && ((HttpServletRequest) ContextManagerFactory.instance().getProperty("request")).getHeader("user-agent").indexOf("UnixWare") >= 0) {
                    String tmpDir = System.getProperty("java.io.tmpdir");
                    String[] path = getFileNames().split(",");
                    ((HttpServletRequest) ContextManagerFactory.instance().getProperty("request")).setAttribute("org.jaffa.applications.jaffa.modules.admin.components.fileexplorer", new File(tmpDir, path[0]));
                    fk = new FormKey("jaffa_admin_fileExplorer_download", null);
                }
            }
        } else {
            throw new ApplicationExceptions(new FormSelectionException(FormSelectionException.NO_FORM_DEFINED_FOR_EVENT, getEvent()) {
            });
        }
    } else {
        fk = super.display();
    }
    return fk;
}
Also used : FormSelectionException(org.jaffa.modules.printing.components.formselectionmaintenance.FormSelectionException) ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) FormKey(org.jaffa.presentation.portlet.FormKey) org.jaffa.components.maint(org.jaffa.components.maint) CheckBoxModel(org.jaffa.presentation.portlet.widgets.model.CheckBoxModel) HttpServletRequest(javax.servlet.http.HttpServletRequest) FormSelectionMaintenanceOutRowDto(org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutRowDto) EditBoxModel(org.jaffa.presentation.portlet.widgets.model.EditBoxModel) FormSelectionMaintenanceOutDto(org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutDto) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 15 with CheckBoxModel

use of org.jaffa.presentation.portlet.widgets.model.CheckBoxModel in project jaffa-framework by jaffa-projects.

the class FormSelectionMaintenanceComponent method doShowForm.

public FormKey doShowForm(GridModel model) throws ApplicationExceptions, FrameworkException {
    FormKey fk = null;
    boolean isSelected = false;
    GridModelRow row = null;
    ApplicationExceptions appExps = null;
    CheckBoxModel checkBoxModel = null;
    fileNames = new StringBuilder();
    if (model != null && model.getRows() != null && model.getRows().size() > 0) {
        for (Iterator itr = model.getRows().iterator(); itr.hasNext(); ) {
            row = (GridModelRow) itr.next();
            checkBoxModel = (CheckBoxModel) row.get("select");
            if (checkBoxModel.getState()) {
                fk = doShowForm(row);
                isSelected = true;
            }
        }
    }
    if (!isSelected) {
        fk = quitAndReturnToCallingScreen();
    }
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) Iterator(java.util.Iterator) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow) CheckBoxModel(org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)

Aggregations

CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)19 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)9 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)7 EditBoxModel (org.jaffa.presentation.portlet.widgets.model.EditBoxModel)7 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)6 Iterator (java.util.Iterator)4 FrameworkException (org.jaffa.exceptions.FrameworkException)4 FormSelectionMaintenanceOutRowDto (org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutRowDto)4 FormKey (org.jaffa.presentation.portlet.FormKey)4 DateTime (org.jaffa.datatypes.DateTime)3 FormSelectionException (org.jaffa.modules.printing.components.formselectionmaintenance.FormSelectionException)3 DateTimeModel (org.jaffa.presentation.portlet.widgets.model.DateTimeModel)3 DropDownModel (org.jaffa.presentation.portlet.widgets.model.DropDownModel)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 org.jaffa.components.maint (org.jaffa.components.maint)2 ApplicationException (org.jaffa.exceptions.ApplicationException)2 FormSelectionMaintenanceOutDto (org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutDto)2 ImageModel (org.jaffa.presentation.portlet.widgets.model.ImageModel)2 Method (java.lang.reflect.Method)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1