use of org.jaffa.presentation.portlet.widgets.model.GridModel in project jaffa-framework by jaffa-projects.
the class FileExplorerForm method expandRow.
public void expandRow(String rowId) {
GridModel m = (GridModel) getWidgetCache().getModel("fileTree");
GridModelRow row = m.getRowById(new Integer(rowId).intValue());
if (row.get(COL_EXPANDED) != null && ((Boolean) row.get(COL_EXPANDED)).booleanValue()) {
if (log.isDebugEnabled())
log.debug("Row already expanded");
return;
}
row.addElement(COL_EXPANDED, new Boolean(true));
row.addElement(COL_DISPLAYED, new Boolean(true));
m.setTarget(row);
int nextRowNum = m.getRowNum(row) + 1;
int level = ((Integer) row.get(COL_LEVEL)).intValue() + 1;
addToTree(m, (File) row.get(COL_FILE), nextRowNum, level);
}
use of org.jaffa.presentation.portlet.widgets.model.GridModel in project jaffa-framework by jaffa-projects.
the class LabelEditorForm method getRowsWM.
/**
* Getter for property Rows. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
* This gets the current data from the component.
* @return Value of property Rows.
*/
public GridModel getRowsWM() {
GridModel rows = (GridModel) getWidgetCache().getModel("rows");
if (rows == null) {
rows = new GridModel();
populateRows(rows);
getWidgetCache().addModel("rows", rows);
}
return rows;
}
use of org.jaffa.presentation.portlet.widgets.model.GridModel in project jaffa-framework by jaffa-projects.
the class ValidationRulesEditorAction method do_ValidatorsUrls_Update_Clicked.
/**
* Invoked if a update button on a row is selected.
* @param rowId The selected row on the screen.
* @return The FormKey for the Update screen.
*/
public FormKey do_ValidatorsUrls_Update_Clicked(String rowId) {
ValidationRulesEditorForm myForm = (ValidationRulesEditorForm) form;
ValidationRulesEditorComponent myComp = (ValidationRulesEditorComponent) myForm.getComponent();
FormKey fk = null;
GridModel model = (GridModel) myForm.getValidatorsUrlsWM();
GridModelRow selectedRow = model.getRowById(Integer.parseInt(rowId));
if (selectedRow != null) {
try {
String fileName = (String) selectedRow.get("validatorsUrl");
if (!fileName.equals(myComp.getValidationRulesFile())) {
myComp.setFileContents(null);
myComp.setValidationRulesFile(fileName);
myComp.loadFileContents();
}
myComp.determineAndSetNextScreen();
} catch (ApplicationExceptions e) {
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
}
// Direct User back to current form
if (fk == null)
fk = myComp.determineFormKey();
return fk;
}
use of org.jaffa.presentation.portlet.widgets.model.GridModel in project jaffa-framework by jaffa-projects.
the class ValidationRulesEditorAction method do_Rules_Update_Clicked.
/**
* Invoked if a update button on a row is selected.
* @param rowId The selected row on the screen.
* @return The FormKey for the Update screen.
*/
public FormKey do_Rules_Update_Clicked(String rowId) {
ValidationRulesEditorForm myForm = (ValidationRulesEditorForm) form;
ValidationRulesEditorComponent myComp = (ValidationRulesEditorComponent) myForm.getComponent();
FormKey fk = null;
GridModel model = (GridModel) myForm.getRulesWM();
GridModelRow selectedRow = model.getRowById(Integer.parseInt(rowId));
if (selectedRow != null) {
try {
String fileName = (String) selectedRow.get("name");
if (!fileName.equals(myComp.getValidationRulesFile())) {
myComp.setFileContents(null);
myComp.setValidationRulesFile(fileName);
myComp.loadFileContents();
}
myComp.determineAndSetNextScreen();
} catch (ApplicationExceptions e) {
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
}
// Direct User back to current form
if (fk == null)
fk = myComp.determineFormKey();
return fk;
}
use of org.jaffa.presentation.portlet.widgets.model.GridModel in project jaffa-framework by jaffa-projects.
the class BusinessEventLogFinderAction method do_Rows_View_Clicked.
// .//GEN-END:_2_be
// .//GEN-BEGIN:_do_Rows_View_Clicked_1_be
/**
* Invokes the viewObject() method on the component.
* @param rowNum The selected row on the Results screen.
* @return The FormKey for the View screen.
*/
public FormKey do_Rows_View_Clicked(String rowNum) {
FormKey fk = null;
// .//GEN-END:_do_Rows_View_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_Rows_View_Clicked_1
// .//GEN-LAST:_do_Rows_View_Clicked_1
// .//GEN-BEGIN:_do_Rows_View_Clicked_2_be
BusinessEventLogFinderForm myForm = (BusinessEventLogFinderForm) form;
BusinessEventLogFinderComponent myComp = (BusinessEventLogFinderComponent) myForm.getComponent();
GridModel model = (GridModel) myForm.getRowsWM();
GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
if (selectedRow != null) {
try {
// .//GEN-END:_do_Rows_View_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_Rows_View_Clicked_2
// .//GEN-LAST:_do_Rows_View_Clicked_2
// .//GEN-BEGIN:_do_Rows_View_Clicked_3_be
fk = myComp.viewObject((java.lang.String) selectedRow.get("logId"));
} catch (ApplicationExceptions e) {
if (log.isDebugEnabled())
log.debug("Viewer Failed");
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
}
// .//GEN-END:_do_Rows_View_Clicked_3_be
// Add custom code after returning from the component //GEN-FIRST:_do_Rows_View_Clicked_3
// .//GEN-LAST:_do_Rows_View_Clicked_3
// .//GEN-BEGIN:_do_Rows_View_Clicked_4_be
// The Viewer will be rendered in a new window
// We don't want to see the existing HistoryNav in that window
// Hence, initialize the HistoryNav
HistoryNav.initializeHistoryNav(request);
// Direct User back to current form
if (fk == null)
fk = myComp.getResultsFormKey();
return fk;
}
Aggregations