Search in sources :

Example 6 with DropDownModel

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

the class UserGridForm method createNewModel.

private GridModel createNewModel() {
    GridModel model = new GridModel();
    GridModelRow row;
    row = model.newRow();
    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("field5", new ImageModel(ImageComponent.getImageBytes("C:\\Sandbox\\Jaffa\\source\\httpunittest\\html\\widgets\\tests\\testimage1_up.gif")));
    row.addElement("field6", new DropDownModel("Value1"));
    row = model.newRow();
    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("field5", new ImageModel(ImageComponent.getImageBytes("C:\\Sandbox\\Jaffa\\source\\httpunittest\\html\\widgets\\tests\\testimage1_down.gif")));
    row.addElement("field6", new DropDownModel("Value2"));
    row = model.newRow();
    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("field5", new ImageModel(ImageComponent.getImageBytes("C:\\Sandbox\\Jaffa\\source\\httpunittest\\html\\widgets\\tests\\testimage1_up.gif")));
    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) ImageModel(org.jaffa.presentation.portlet.widgets.model.ImageModel) DateTime(org.jaffa.datatypes.DateTime) CheckBoxModel(org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)

Example 7 with DropDownModel

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

the class FinderForm method getSortDropDownWM.

/**
 * Getter for DropDown property sortDropDown.
 * @return Value of DropDown property sortDropDown.
 */
public DropDownModel getSortDropDownWM() {
    DropDownModel sortDropDownModel = (DropDownModel) getWidgetCache().getModel(SORT_DROP_DOWN);
    if (sortDropDownModel == null) {
        String sortDropDown = getSortDropDown();
        if (sortDropDown != null)
            sortDropDownModel = new DropDownModel(sortDropDown);
        else
            sortDropDownModel = new DropDownModel("");
        getWidgetCache().addModel(SORT_DROP_DOWN, sortDropDownModel);
    }
    return sortDropDownModel;
}
Also used : DropDownModel(org.jaffa.presentation.portlet.widgets.model.DropDownModel)

Example 8 with DropDownModel

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

the class FinderForm method getSavedQueryIdWM.

/**
 * Getter for property savedQueryId. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * @return Value of property savedQueryId.
 */
public DropDownModel getSavedQueryIdWM() {
    DropDownModel w_savedQueryId = (DropDownModel) getWidgetCache().getModel("savedQueryId");
    if (w_savedQueryId == null) {
        w_savedQueryId = new DropDownModel((getSavedQueryId() != null ? "" + getSavedQueryId() : ""));
        CodeHelperOutElementDto dto = ((FinderComponent2) getComponent()).getSavedQueryIdCodes();
        if (dto != null && dto.getCodeHelperOutCodeDtoCount() > 0) {
            CodeHelperOutCodeDto[] codes = dto.getCodeHelperOutCodeDtos();
            for (int i = 0; i < codes.length; i++) {
                CodeHelperOutCodeDto code = codes[i];
                w_savedQueryId.addOption(Formatter.format(code.getDescription()), Formatter.format(code.getCode()));
            }
        }
        getWidgetCache().addModel("savedQueryId", w_savedQueryId);
    }
    return w_savedQueryId;
}
Also used : CodeHelperOutCodeDto(org.jaffa.components.codehelper.dto.CodeHelperOutCodeDto) DropDownModel(org.jaffa.presentation.portlet.widgets.model.DropDownModel) CodeHelperOutElementDto(org.jaffa.components.codehelper.dto.CodeHelperOutElementDto)

Example 9 with DropDownModel

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

the class FinderForm method getMaxRecordsWM.

/**
 * Getter for DropDown property maxRecords.
 * @return Value of DropDown property maxRecords.
 */
public DropDownModel getMaxRecordsWM() {
    DropDownModel maxRecordsModel = (DropDownModel) getWidgetCache().getModel(MAX_RECORDS);
    if (maxRecordsModel == null) {
        // create a list of valid values (Long objects) for the maxRecords dropdown
        List maxRecordsList = new ArrayList();
        Map maxRecordsDropDownOptions = CriteriaDropDownOptions.getMaxRecordsDropDownOptions();
        for (Iterator i = maxRecordsDropDownOptions.entrySet().iterator(); i.hasNext(); ) {
            Map.Entry me = (Map.Entry) i.next();
            maxRecordsList.add(me.getKey());
        }
        // Now determine an initial value for the dropdown
        Integer maxRecords = getMaxRecords();
        Long initialValue = maxRecords != null ? new Long(maxRecords.intValue()) : null;
        if (initialValue == null || !maxRecordsList.contains(initialValue))
            initialValue = CriteriaDropDownOptions.getDefaultMaxRecordsDropDownOption();
        // Now build the DropDownModel, adding the options
        maxRecordsModel = new DropDownModel(initialValue.toString());
        for (Iterator i = maxRecordsDropDownOptions.entrySet().iterator(); i.hasNext(); ) {
            Map.Entry me = (Map.Entry) i.next();
            maxRecordsModel.addOption((String) me.getValue(), me.getKey().toString());
        }
        getWidgetCache().addModel(MAX_RECORDS, maxRecordsModel);
    }
    return maxRecordsModel;
}
Also used : DropDownModel(org.jaffa.presentation.portlet.widgets.model.DropDownModel)

Example 10 with DropDownModel

use of org.jaffa.presentation.portlet.widgets.model.DropDownModel 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)

Aggregations

DropDownModel (org.jaffa.presentation.portlet.widgets.model.DropDownModel)13 DateTime (org.jaffa.datatypes.DateTime)3 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)3 DateTimeModel (org.jaffa.presentation.portlet.widgets.model.DateTimeModel)3 EditBoxModel (org.jaffa.presentation.portlet.widgets.model.EditBoxModel)3 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)3 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)3 ImageModel (org.jaffa.presentation.portlet.widgets.model.ImageModel)2 CodeHelperOutCodeDto (org.jaffa.components.codehelper.dto.CodeHelperOutCodeDto)1 CodeHelperOutElementDto (org.jaffa.components.codehelper.dto.CodeHelperOutElementDto)1