IDEMPIERE-2935 New record on GridMode error on fields with DisplayLogic / minor defensive programming refactor
This commit is contained in:
parent
641d918ebb
commit
7687494731
|
@ -172,23 +172,21 @@ public class GridTabDataBinder implements ValueChangeListener {
|
||||||
|
|
||||||
//Checks if the change in a field modifies the display logic in the dependant fields
|
//Checks if the change in a field modifies the display logic in the dependant fields
|
||||||
Object source = e.getSource();
|
Object source = e.getSource();
|
||||||
|
if (source != null && source instanceof WEditor) {
|
||||||
WEditor editor = (WEditor) source;
|
WEditor editor = (WEditor) source;
|
||||||
|
|
||||||
if( editor != null ){
|
|
||||||
|
|
||||||
ArrayList<GridField> dependants = gridTab.getDependantFields(editor.getColumnName());
|
ArrayList<GridField> dependants = gridTab.getDependantFields(editor.getColumnName());
|
||||||
|
if (dependants != null
|
||||||
if ( dependants != null && !dependants.isEmpty() )
|
&& !dependants.isEmpty()
|
||||||
if( editor.getComponent() != null ) //Editor
|
&& editor.getComponent() != null //Editor
|
||||||
if( editor.getComponent().getParent() != null) //Cell
|
&& editor.getComponent().getParent() != null //Cell
|
||||||
if( editor.getComponent().getParent().getParent() != null ) //Row
|
&& editor.getComponent().getParent().getParent() != null //Row
|
||||||
if( editor.getComponent().getParent().getParent().getParent() != null ) //Rows
|
&& editor.getComponent().getParent().getParent().getParent() != null //Rows
|
||||||
if( editor.getComponent().getParent().getParent().getParent().getParent() != null ){ //Grid
|
&& editor.getComponent().getParent().getParent().getParent().getParent() != null //Grid
|
||||||
|
&& editor.getComponent().getParent().getParent().getParent().getParent() instanceof Grid) {
|
||||||
Grid listBox = (Grid) editor.getComponent().getParent().getParent().getParent().getParent();
|
Grid listBox = (Grid) editor.getComponent().getParent().getParent().getParent().getParent();
|
||||||
RowRenderer<Object[]> renderer = listBox.getRowRenderer();
|
RowRenderer<Object[]> renderer = listBox.getRowRenderer();
|
||||||
GridTabRowRenderer gtr = (GridTabRowRenderer)renderer;
|
GridTabRowRenderer gtr = (GridTabRowRenderer)renderer;
|
||||||
gtr.checkDependants(dependants);
|
gtr.checkDependants(dependants);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue