Updated EditRow to manage to more than one row
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@111328 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9243ec04e3
commit
c8e081d048
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client.rows;
|
package org.gcube.portlets.user.td.tablewidget.client.rows;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DeleteRowsSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DeleteRowsSession;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||||
|
@ -22,29 +24,29 @@ public class EditRowDialog extends Window {
|
||||||
protected String HEIGHT = "456px";
|
protected String HEIGHT = "456px";
|
||||||
protected TRId trId;
|
protected TRId trId;
|
||||||
protected EventBus eventBus;
|
protected EventBus eventBus;
|
||||||
protected RowRaw row;
|
protected ArrayList<RowRaw> rows;
|
||||||
protected DeleteRowsSession deleteRowsSession;
|
protected DeleteRowsSession deleteRowsSession;
|
||||||
|
|
||||||
private boolean addRow;
|
private boolean addRow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit selected row
|
* Edit selected rows
|
||||||
*
|
*
|
||||||
* @param trId
|
* @param trId
|
||||||
* @param row
|
* @param rows
|
||||||
* @param eventBus
|
* @param eventBus
|
||||||
*/
|
*/
|
||||||
public EditRowDialog(TRId trId, RowRaw row, EventBus eventBus) {
|
public EditRowDialog(TRId trId, ArrayList<RowRaw> rows, EventBus eventBus) {
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.row = row;
|
//this.rows = rows;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
addRow = false;
|
addRow = false;
|
||||||
if (row == null) {
|
if (rows == null) {
|
||||||
UtilsGXT3.alert("Attentions", "No row selected");
|
UtilsGXT3.alert("Attentions", "No row selected");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
initWindow();
|
initWindow();
|
||||||
EditRowPanel editRowPanel = new EditRowPanel(this, trId, row,
|
EditRowPanel editRowPanel = new EditRowPanel(this, trId, rows,
|
||||||
eventBus);
|
eventBus);
|
||||||
add(editRowPanel);
|
add(editRowPanel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ import com.sencha.gxt.widget.core.client.event.TriggerClickEvent.TriggerClickHan
|
||||||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||||
import com.sencha.gxt.widget.core.client.form.DateField;
|
import com.sencha.gxt.widget.core.client.form.DateField;
|
||||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||||
|
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||||
import com.sencha.gxt.widget.core.client.form.Radio;
|
import com.sencha.gxt.widget.core.client.form.Radio;
|
||||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
import com.sencha.gxt.widget.core.client.form.validator.RegExValidator;
|
import com.sencha.gxt.widget.core.client.form.validator.RegExValidator;
|
||||||
|
@ -71,22 +72,27 @@ import com.sencha.gxt.widget.core.client.form.validator.RegExValidator;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
|
private static final String ITEM_CREATE_ROW = "NewRow";
|
||||||
|
|
||||||
private static final String GEOMETRY_REGEXPR = "(\\s*POINT\\s*\\(\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*\\)\\s*$)"
|
private static final String GEOMETRY_REGEXPR = "(\\s*POINT\\s*\\(\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*\\)\\s*$)"
|
||||||
+ "|(\\s*LINESTRING\\s*\\((\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*,)+\\s*((-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*)\\)\\s*$)";
|
+ "|(\\s*LINESTRING\\s*\\((\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*,)+\\s*((-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*)\\)\\s*$)";
|
||||||
|
|
||||||
protected String WIDTH = "510px";
|
private static final String WIDTH = "510px";
|
||||||
protected String HEIGHT = "370px";
|
private static final String HEIGHT = "370px";
|
||||||
protected String FIELDSHEIGHT = "370px";
|
private static final String FIELDSHEIGHT = "370px";
|
||||||
protected int LABELSIZE = 120;
|
private static final int LABELSIZE = 120;
|
||||||
|
|
||||||
protected EditRowDialog parent;
|
private EditRowDialog parent;
|
||||||
protected TRId trId;
|
private TRId trId;
|
||||||
protected EventBus eventBus;
|
private EventBus eventBus;
|
||||||
protected ArrayList<ColumnData> columns;
|
private ArrayList<ColumnData> columns;
|
||||||
protected RowRaw rowRaw;
|
private ArrayList<RowRaw> rowsRaw;
|
||||||
protected boolean editRow;
|
private boolean editRow;
|
||||||
|
|
||||||
protected VerticalLayoutContainer v;
|
private VerticalLayoutContainer v;
|
||||||
|
|
||||||
|
private ArrayList<String> rowsId;
|
||||||
|
|
||||||
private TextButton btnSave;
|
private TextButton btnSave;
|
||||||
private TextButton btnClose;
|
private TextButton btnClose;
|
||||||
|
|
||||||
|
@ -97,20 +103,20 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
*
|
*
|
||||||
* @param parent
|
* @param parent
|
||||||
* @param trId
|
* @param trId
|
||||||
* @param rowRaw
|
* @param rowsRaw
|
||||||
* @param eventBus
|
* @param eventBus
|
||||||
*/
|
*/
|
||||||
public EditRowPanel(EditRowDialog parent, TRId trId, RowRaw rowRaw,
|
public EditRowPanel(EditRowDialog parent, TRId trId,
|
||||||
EventBus eventBus) {
|
ArrayList<RowRaw> rowsRaw, EventBus eventBus) {
|
||||||
super();
|
super();
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.rowRaw = rowRaw;
|
this.rowsRaw = rowsRaw;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.editRow = true;
|
this.editRow = true;
|
||||||
Log.debug("Create EditRowPanel(): [" + trId.toString() + " , RowRaw:"
|
Log.debug("Create EditRowPanel(): [" + trId.toString() + " , RowsRaw:"
|
||||||
+ rowRaw + "]");
|
+ rowsRaw + "]");
|
||||||
if (rowRaw == null) {
|
if (rowsRaw == null || rowsRaw.isEmpty()) {
|
||||||
UtilsGXT3.alert("Attentions", "No row selected");
|
UtilsGXT3.alert("Attentions", "No row selected");
|
||||||
} else {
|
} else {
|
||||||
init();
|
init();
|
||||||
|
@ -166,8 +172,8 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(columns.size()<1){
|
if (columns.size() < 1) {
|
||||||
btnSave.disable();
|
btnSave.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,10 +196,45 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
|
|
||||||
ArrayList<FieldLabel> fields = generateFields();
|
rowsId=new ArrayList<String>();
|
||||||
for (FieldLabel fl : fields) {
|
if (editRow) {
|
||||||
v.add(fl, new VerticalLayoutData(1, -1, new Margins(1)));
|
for (RowRaw rowRaw : rowsRaw) {
|
||||||
|
FieldSet fieldSet = new FieldSet();
|
||||||
|
fieldSet.setCollapsible(false);
|
||||||
|
fieldSet.setItemId(rowRaw.getRowId());
|
||||||
|
rowsId.add(rowRaw.getRowId());
|
||||||
|
|
||||||
|
VerticalLayoutContainer fieldSetLayout = new VerticalLayoutContainer();
|
||||||
|
fieldSetLayout.setScrollMode(ScrollMode.AUTO);
|
||||||
|
fieldSet.add(fieldSetLayout);
|
||||||
|
|
||||||
|
ArrayList<FieldLabel> fields = generateFields(rowRaw);
|
||||||
|
for (FieldLabel fl : fields) {
|
||||||
|
fieldSetLayout.add(fl, new VerticalLayoutData(1, -1,
|
||||||
|
new Margins(1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
v.add(fieldSet, new VerticalLayoutData(1, -1, new Margins(1)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
FieldSet fieldSet = new FieldSet();
|
||||||
|
fieldSet.setCollapsible(false);
|
||||||
|
fieldSet.setItemId(ITEM_CREATE_ROW);
|
||||||
|
rowsId.add(ITEM_CREATE_ROW);
|
||||||
|
|
||||||
|
VerticalLayoutContainer fieldSetLayout = new VerticalLayoutContainer();
|
||||||
|
fieldSetLayout.setScrollMode(ScrollMode.AUTO);
|
||||||
|
fieldSet.add(fieldSetLayout);
|
||||||
|
|
||||||
|
ArrayList<FieldLabel> fields = generateFields(null);
|
||||||
|
for (FieldLabel fl : fields) {
|
||||||
|
fieldSetLayout.add(fl, new VerticalLayoutData(1, -1,
|
||||||
|
new Margins(1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
v.add(fieldSet, new VerticalLayoutData(1, -1, new Margins(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
container.forceLayout();
|
container.forceLayout();
|
||||||
|
@ -236,7 +277,7 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ArrayList<FieldLabel> generateFields() {
|
protected ArrayList<FieldLabel> generateFields(RowRaw rowRaw) {
|
||||||
ArrayList<FieldLabel> fields = new ArrayList<FieldLabel>();
|
ArrayList<FieldLabel> fields = new ArrayList<FieldLabel>();
|
||||||
|
|
||||||
for (ColumnData col : columns) {
|
for (ColumnData col : columns) {
|
||||||
|
@ -254,8 +295,8 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
|| col.getTypeCode().compareTo(
|
|| col.getTypeCode().compareTo(
|
||||||
ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
||||||
|
|
||||||
FieldLabel dimensionLabel = retrieveDimensionLabel(col,
|
FieldLabel dimensionLabel = retrieveDimensionLabel(rowRaw,
|
||||||
label);
|
col, label);
|
||||||
dimensionLabel.setLabelWidth(LABELSIZE);
|
dimensionLabel.setLabelWidth(LABELSIZE);
|
||||||
fields.add(dimensionLabel);
|
fields.add(dimensionLabel);
|
||||||
} else {
|
} else {
|
||||||
|
@ -424,8 +465,8 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FieldLabel retrieveDimensionLabel(final ColumnData col,
|
protected FieldLabel retrieveDimensionLabel(RowRaw rowRaw,
|
||||||
String label) {
|
final ColumnData col, String label) {
|
||||||
Log.debug("retriveDimensionLabel on:" + col);
|
Log.debug("retriveDimensionLabel on:" + col);
|
||||||
// comboDimension
|
// comboDimension
|
||||||
DimensionRowsProperties propsDimension = GWT
|
DimensionRowsProperties propsDimension = GWT
|
||||||
|
@ -503,146 +544,164 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
protected void save() {
|
protected void save() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int lenght = v.getWidgetCount();
|
int lenght = v.getWidgetCount();
|
||||||
HashMap<String, String> maps = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
HashMap<String, HashMap<String, String>> rowsMaps = new HashMap<String, HashMap<String, String>>();
|
||||||
|
|
||||||
for (; i < lenght; i++) {
|
for (; i < lenght; i++) {
|
||||||
FieldLabel fieldLabel = (FieldLabel) v.getWidget(i);
|
FieldSet fieldSet = (FieldSet) v.getWidget(i);
|
||||||
String columnId = fieldLabel.getId();
|
VerticalLayoutContainer fieldSetLayout = (VerticalLayoutContainer) fieldSet
|
||||||
ColumnData colCurrent = null;
|
.getWidget();
|
||||||
for (ColumnData col : columns) {
|
int j = 0;
|
||||||
if (col.getColumnId().compareTo(columnId) == 0) {
|
int fieldSetLayoutLenght = fieldSetLayout.getWidgetCount();
|
||||||
colCurrent = col;
|
HashMap<String, String> maps = new HashMap<String, String>();
|
||||||
break;
|
for (; j < fieldSetLayoutLenght; j++) {
|
||||||
|
FieldLabel fieldLabel = (FieldLabel) fieldSetLayout
|
||||||
|
.getWidget(j);
|
||||||
|
String columnId = fieldLabel.getId();
|
||||||
|
ColumnData colCurrent = null;
|
||||||
|
for (ColumnData col : columns) {
|
||||||
|
if (col.getColumnId().compareTo(columnId) == 0) {
|
||||||
|
colCurrent = col;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (colCurrent == null) {
|
||||||
if (colCurrent == null) {
|
Log.debug("Current col is null");
|
||||||
Log.debug("Current col is null");
|
|
||||||
btnSave.enable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (colCurrent.getTypeCode().compareTo(
|
|
||||||
ColumnTypeCode.DIMENSION.toString()) == 0
|
|
||||||
|| colCurrent.getTypeCode().compareTo(
|
|
||||||
ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
ComboBox<DimensionRow> comboDimension = (ComboBox<DimensionRow>) fieldLabel
|
|
||||||
.getWidget();
|
|
||||||
DimensionRow dimRow = comboDimension.getValue();
|
|
||||||
if (dimRow == null
|
|
||||||
|| (dimRow != null && (dimRow.getRowId() == null || dimRow
|
|
||||||
.getRowId().isEmpty()))) {
|
|
||||||
UtilsGXT3.alert("Attentions", "Select a valid value for "
|
|
||||||
+ colCurrent.getLabel());
|
|
||||||
btnSave.enable();
|
btnSave.enable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
maps.put(columnId, dimRow.getRowId());
|
if (colCurrent.getTypeCode().compareTo(
|
||||||
} else {
|
ColumnTypeCode.DIMENSION.toString()) == 0
|
||||||
if (colCurrent.getDataTypeName().compareTo(
|
|| colCurrent.getTypeCode().compareTo(
|
||||||
ColumnDataType.Boolean.toString()) == 0) {
|
ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
||||||
HorizontalPanel hpanel = (HorizontalPanel) fieldLabel
|
@SuppressWarnings("unchecked")
|
||||||
|
ComboBox<DimensionRow> comboDimension = (ComboBox<DimensionRow>) fieldLabel
|
||||||
.getWidget();
|
.getWidget();
|
||||||
Radio radioTrue = (Radio) hpanel.getWidget(0);
|
DimensionRow dimRow = comboDimension.getValue();
|
||||||
maps.put(columnId, radioTrue.getValue().toString());
|
if (dimRow == null
|
||||||
|
|| (dimRow != null && (dimRow.getRowId() == null || dimRow
|
||||||
|
.getRowId().isEmpty()))) {
|
||||||
|
UtilsGXT3.alert(
|
||||||
|
"Attentions",
|
||||||
|
"Select a valid value for "
|
||||||
|
+ colCurrent.getLabel());
|
||||||
|
btnSave.enable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
maps.put(columnId, dimRow.getRowId());
|
||||||
} else {
|
} else {
|
||||||
if (colCurrent.getDataTypeName().compareTo(
|
if (colCurrent.getDataTypeName().compareTo(
|
||||||
ColumnDataType.Date.toString()) == 0) {
|
ColumnDataType.Boolean.toString()) == 0) {
|
||||||
DateField date = (DateField) fieldLabel.getWidget();
|
HorizontalPanel hpanel = (HorizontalPanel) fieldLabel
|
||||||
if (date == null || date.getCurrentValue() == null) {
|
.getWidget();
|
||||||
maps.put(columnId, null);
|
Radio radioTrue = (Radio) hpanel.getWidget(0);
|
||||||
} else {
|
maps.put(columnId, radioTrue.getValue().toString());
|
||||||
Date d = date.getCurrentValue();
|
|
||||||
String dateS = sdf.format(d);
|
|
||||||
maps.put(columnId, dateS);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (colCurrent.getDataTypeName().compareTo(
|
if (colCurrent.getDataTypeName().compareTo(
|
||||||
ColumnDataType.Text.toString()) == 0) {
|
ColumnDataType.Date.toString()) == 0) {
|
||||||
TextField text = (TextField) fieldLabel.getWidget();
|
DateField date = (DateField) fieldLabel.getWidget();
|
||||||
String val = text.getCurrentValue();
|
if (date == null || date.getCurrentValue() == null) {
|
||||||
if (val == null) {
|
maps.put(columnId, null);
|
||||||
val = "";
|
} else {
|
||||||
|
Date d = date.getCurrentValue();
|
||||||
|
String dateS = sdf.format(d);
|
||||||
|
maps.put(columnId, dateS);
|
||||||
}
|
}
|
||||||
maps.put(columnId, val);
|
|
||||||
} else {
|
} else {
|
||||||
if (colCurrent.getDataTypeName().compareTo(
|
if (colCurrent.getDataTypeName().compareTo(
|
||||||
ColumnDataType.Geometry.toString()) == 0) {
|
ColumnDataType.Text.toString()) == 0) {
|
||||||
TextField geometry = (TextField) fieldLabel
|
TextField text = (TextField) fieldLabel
|
||||||
.getWidget();
|
.getWidget();
|
||||||
if (geometry.isValid()) {
|
String val = text.getCurrentValue();
|
||||||
String val = geometry.getCurrentValue();
|
if (val == null) {
|
||||||
if (val == null) {
|
val = "";
|
||||||
val = "";
|
|
||||||
}
|
|
||||||
maps.put(columnId, val);
|
|
||||||
} else {
|
|
||||||
UtilsGXT3
|
|
||||||
.alert("Attentions",
|
|
||||||
"The value of "
|
|
||||||
+ colCurrent
|
|
||||||
.getLabel()
|
|
||||||
+ " is not a valid text representation for geometry type ( e.g. POINT(34 56) or LINESTRING(65 34, 56.43 78.65)!");
|
|
||||||
btnSave.enable();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
maps.put(columnId, val);
|
||||||
} else {
|
} else {
|
||||||
if (colCurrent.getDataTypeName().compareTo(
|
if (colCurrent.getDataTypeName().compareTo(
|
||||||
ColumnDataType.Integer.toString()) == 0) {
|
ColumnDataType.Geometry.toString()) == 0) {
|
||||||
TextField integ = (TextField) fieldLabel
|
TextField geometry = (TextField) fieldLabel
|
||||||
.getWidget();
|
.getWidget();
|
||||||
@SuppressWarnings("unused")
|
if (geometry.isValid()) {
|
||||||
Integer intege;
|
String val = geometry.getCurrentValue();
|
||||||
try {
|
if (val == null) {
|
||||||
intege = new Integer(
|
val = "";
|
||||||
integ.getCurrentValue());
|
}
|
||||||
} catch (NumberFormatException e) {
|
maps.put(columnId, val);
|
||||||
|
} else {
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Attentions",
|
.alert("Attentions",
|
||||||
colCurrent.getLabel()
|
"The value of "
|
||||||
+ " is no a valid Integer type");
|
+ colCurrent
|
||||||
|
.getLabel()
|
||||||
|
+ " is not a valid text representation for geometry type ( e.g. POINT(34 56) or LINESTRING(65 34, 56.43 78.65)!");
|
||||||
btnSave.enable();
|
btnSave.enable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
maps.put(columnId, integ.getCurrentValue());
|
|
||||||
} else {
|
} else {
|
||||||
if (colCurrent.getDataTypeName().compareTo(
|
if (colCurrent.getDataTypeName().compareTo(
|
||||||
ColumnDataType.Numeric.toString()) == 0) {
|
ColumnDataType.Integer.toString()) == 0) {
|
||||||
TextField numeric = (TextField) fieldLabel
|
TextField integ = (TextField) fieldLabel
|
||||||
.getWidget();
|
.getWidget();
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
Double d;
|
Integer intege;
|
||||||
String val = numeric.getCurrentValue();
|
|
||||||
if (val == null) {
|
|
||||||
Log.debug("Attentions"
|
|
||||||
+ colCurrent.getLabel()
|
|
||||||
+ " is no a valid Numeric type");
|
|
||||||
UtilsGXT3
|
|
||||||
.alert("Attentions",
|
|
||||||
colCurrent
|
|
||||||
.getLabel()
|
|
||||||
+ " is no a valid Numeric type");
|
|
||||||
btnSave.enable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
d = new Double(val);
|
intege = new Integer(
|
||||||
|
integ.getCurrentValue());
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
Log.debug("Attentions"
|
|
||||||
+ colCurrent.getLabel()
|
|
||||||
+ " is no a valid Numeric type");
|
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Attentions",
|
.alert("Attentions",
|
||||||
colCurrent
|
colCurrent
|
||||||
.getLabel()
|
.getLabel()
|
||||||
+ " is no a valid Numeric type");
|
+ " is no a valid Integer type");
|
||||||
btnSave.enable();
|
btnSave.enable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
maps.put(columnId,
|
|
||||||
numeric.getCurrentValue());
|
|
||||||
} else {
|
|
||||||
|
|
||||||
|
maps.put(columnId,
|
||||||
|
integ.getCurrentValue());
|
||||||
|
} else {
|
||||||
|
if (colCurrent.getDataTypeName()
|
||||||
|
.compareTo(
|
||||||
|
ColumnDataType.Numeric
|
||||||
|
.toString()) == 0) {
|
||||||
|
TextField numeric = (TextField) fieldLabel
|
||||||
|
.getWidget();
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
Double d;
|
||||||
|
String val = numeric
|
||||||
|
.getCurrentValue();
|
||||||
|
if (val == null) {
|
||||||
|
Log.debug("Attentions"
|
||||||
|
+ colCurrent.getLabel()
|
||||||
|
+ " is no a valid Numeric type");
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Attentions",
|
||||||
|
colCurrent
|
||||||
|
.getLabel()
|
||||||
|
+ " is no a valid Numeric type");
|
||||||
|
btnSave.enable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
d = new Double(val);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Log.debug("Attentions"
|
||||||
|
+ colCurrent.getLabel()
|
||||||
|
+ " is no a valid Numeric type");
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Attentions",
|
||||||
|
colCurrent
|
||||||
|
.getLabel()
|
||||||
|
+ " is no a valid Numeric type");
|
||||||
|
btnSave.enable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
maps.put(columnId,
|
||||||
|
numeric.getCurrentValue());
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -650,14 +709,17 @@ public class EditRowPanel extends FramedPanel implements MonitorDialogListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rowsMaps.put(fieldSet.getItemId(), maps);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EditRowSession editRowSession;
|
EditRowSession editRowSession;
|
||||||
if (editRow) {
|
if (editRow) {
|
||||||
editRowSession = new EditRowSession(trId, columns, maps,
|
editRowSession = new EditRowSession(trId, columns, rowsMaps,
|
||||||
rowRaw.getRowId());
|
rowsId);
|
||||||
} else {
|
} else {
|
||||||
editRowSession = new EditRowSession(trId, columns, maps);
|
editRowSession = new EditRowSession(trId, columns, rowsMaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
callEditRow(editRowSession);
|
callEditRow(editRowSession);
|
||||||
|
|
Loading…
Reference in New Issue