Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Grouped ListGrid adds to records in 5.1p

    I have a problem with listGrids... when I create a new record in a DynamicForm... I save with this record the method "dynamicForm.submit()" this worked very well in SmartGWT 5p. In 5.1p it adds the record 2 times with the same id (see Screenshot). Click image for larger version

Name:	doubleRecords.jpg
Views:	130
Size:	65.4 KB
ID:	233420


    After adding another record. The new record appears two times. The previous record appears correct then.... so only the latest record appears 2 times in the listGrid (see Screenshot).
    Click image for larger version

Name:	doubleRecords2.jpg
Views:	85
Size:	71.9 KB
ID:	233419


    This happens only for grouped listGrids which contains GroupSums

    SmartGWT 5.1p 13.12.2015
    Browser: Chrome + Firefox

    ListGrid Code:
    Code:
    listGrid = new ListGrid();
    listGrid.setDataSource( dataSource );
    listGrid.setAutoFetchData( true );
    listGrid.setShowFilterEditor( true );
    listGrid.setAllowFilterExpressions( true );
    listGrid.setShowRowNumbers( true );
    listGrid.setFastCellUpdates( true );
    listGrid.setEmptyCellValue( "---" );
    listGrid.setAllowFilterExpressions( true );
    listGrid.setDataFetchMode( FetchMode.BASIC );
    listGrid.setWrapHeaderTitles( true );
    listGrid.setCanResizeFields( true );
    listGrid.setCellPadding( 4 );
    listGrid.setFixedRecordHeights( false );
    listGrid.setGroupByMaxRecords( 1000 );
    listGrid.setBodyOverflow( Overflow.AUTO );
    listGrid.setOverflow( Overflow.AUTO );
    listGrid.setLeaveScrollbarGap( false );
    listGrid.setAutoFitWidthApproach( AutoFitWidthApproach.BOTH );
    listGrid.setAutoFitHeaderHeights( true );
    listGrid.setAutoSizeHeaderSpans( true );
    listGrid.setCanAutoFitFields( false );
    listGrid.setRecordDropAppearance( RecordDropAppearance.BOTH );
    listGrid.setGroupByField( "currency" );
    listGrid.setGroupStartOpen( GroupStartOpen.ALL );
    listGrid.setShowGroupSummary( true );
    listGrid.setShowGroupSummary( true );
    
    
    ListGridField idField = new ListGridField( "id" );
    idField.setWidth( "10%" );
    idField.setAlign( Alignment.CENTER );
    idField.setShowGroupSummary( false );
    idField.setHidden( true );
    idField.setCanEdit( false );
    
    ListGridField descriptionField = new ListGridField( "description" );
    descriptionField.setWidth( "15%" );
    descriptionField.setCanEdit( false );
    
    ListGridField netAmountField = new ListGridField( "net_amount" );
    netAmountField.setSummaryFunction( SummaryFunctionType.SUM );
    netAmountField.setShowGroupSummary( true );
    netAmountField.setWidth( "10%" );
    netAmountField.setAlign( Alignment.CENTER );
    netAmountField.setCanEdit( false );
    netAmountField.setCellFormatter( new CellFormatter()
    {
    public String format( Object value, ListGridRecord record, int rowNum, int colNum )
    {
    if ( value == null )
    return null;
    try
    {
    NumberFormat fmt = NumberFormat.getFormat( "#,##0.00" );
    return fmt.format( Double.valueOf( String.valueOf( value ) ) );
    }
    catch ( Exception e )
    {
    return value.toString();
    }
    }
    } );
    
    ListGridField taxAmountField = new ListGridField( "taxes_amount");
    taxAmountField.setWidth( "10%" );
    taxAmountField.setAlign( Alignment.CENTER );
    taxAmountField.setCanEdit( false );
    taxAmountField.setCellFormatter( new CellFormatter()
    {
    public String format( Object value, ListGridRecord record, int rowNum, int colNum )
    {
    if ( value == null )
    return null;
    try
    {
    NumberFormat fmt = NumberFormat.getFormat( "#,##0.00" );
    return fmt.format( Double.valueOf( String.valueOf( value ) ) );
    }
    catch ( Exception e )
    {
    return value.toString();
    }
    }
    } );
    
    ListGridField totalAmountField = new ListGridField("total_amount" );
    totalAmountField.setSummaryFunction( SummaryFunctionType.SUM );
    totalAmountField.setShowGroupSummary( true );
    totalAmountField.setAlign( Alignment.CENTER );
    totalAmountField.setWidth( "10%" );
    totalAmountField.setCanEdit( false );
    totalAmountField.setCellFormatter( new CellFormatter()
    {
    public String format( Object value, ListGridRecord record, int rowNum, int colNum )
    {
    if ( value == null )
    return null;
    try
    {
    NumberFormat fmt = NumberFormat.getFormat( "#,##0.00" );
    return fmt.format( Double.valueOf( String.valueOf( value ) ) );
    }
    catch ( Exception e )
    {
    return value.toString();
    }
    }
    } );
    
    ListGridField currencyField = new ListGridField( "currency" );
    currencyField.setAlign( Alignment.CENTER );
    currencyField.setWidth( "8%" );
    currencyField.setCanEdit( false );
    
    listGrid.setFields( idField,descriptionField,
    currencyField, netAmountField, taxAmountField, totalAmountField );
    Code:
    16:47:09.290:MMV7:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3185}
    16:47:09.296:MMV7:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3187}
    16:47:09.307:MMV9:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3189}
    16:47:09.311:MMV9:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3191}
    16:47:09.321:MMV2:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3193}
    16:47:09.326:MMV2:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3195}
    16:47:09.333:TMR4:DEBUG:EventHandler:mousing out of [Button ID:isc_Button_69]  mousing over [ScreenSpan ID:isc_Window_9_modalMask]
    16:47:09.335:TMR4:INFO:aria:ARIA state: hidden: true, set on element: [DIVElement]{ID:isc_199}
    16:47:09.341:TMR4:INFO:redraws:isc_Toolbar_7:Scheduling redraw (13 children) (no reason provided)
        Canvas.$q9(_1=>undef, _2=>undef)
        Canvas.markForRedraw(_1=>undef)
        Class.invokeSuper(_1=>null, _2=>"markForRedraw", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef, _11=>undef, _12=>undef, _13=>undef)
        Class.Super(_1=>"markForRedraw", _2=>[object Arguments], _3=>undef)
        Layout.markForRedraw()
        [a]HeaderMenuButton.visibilityChanged(_1=>false)
        Canvas.$807()
        Canvas.setVisibility(_1=>"hidden")
        Canvas.hide()
        ListGrid.$129m(_1=>[Button ID:isc_Button_69])
        [o]Button.handleMouseOut(Obj, null)
        [c]EventHandler.bubbleEvent(_1=>[Button ID:isc_Button_69], _2=>"mouseOut", _3=>null, _4=>false, _5=>null)
        [c]EventHandler.handleEvent(_1=>[Button ID:isc_Button_69], _2=>"mouseOut", _3=>null, _4=>null)
        [c]EventHandler.$kz(_1=>null, _2=>Obj)
        [c]EventHandler.$kx(_1=>null, _2=>Obj)
        [c]EventHandler.$kv(_1=>1450194429300)
        [c]Class.fireCallback(_1=>Obj, _2=>null, _3=>null, _4=>null, _5=>true)
    Stack trace for setTimeout() call:  
        [c]Timer.setTimeout(_1=>Obj, _2=>0, _3=>true, _4=>undef)
        [c]EventHandler.handleMouseMove(_1=>[object MouseEvent])
        [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseMove(), _2=>[object MouseEvent])
        anonymous(event=>[object MouseEvent])
    
    
    16:47:09.347:TMR4:INFO:redraws:isc_Button_69:Scheduling redraw (no reason provided)
        Canvas.$q9(_1=>undef, _2=>undef)
        Canvas.markForRedraw(_1=>undef)
        ListGrid.$129m(_1=>[Button ID:isc_Button_69])
        [o]Button.handleMouseOut(Obj, null)
        [c]EventHandler.bubbleEvent(_1=>[Button ID:isc_Button_69], _2=>"mouseOut", _3=>null, _4=>false, _5=>null)
        [c]EventHandler.handleEvent(_1=>[Button ID:isc_Button_69], _2=>"mouseOut", _3=>null, _4=>null)
        [c]EventHandler.$kz(_1=>null, _2=>Obj)
        [c]EventHandler.$kx(_1=>null, _2=>Obj)
        [c]EventHandler.$kv(_1=>1450194429300)
        [c]Class.fireCallback(_1=>Obj, _2=>null, _3=>null, _4=>null, _5=>true)
        [c]Timer.$in(_1=>"$ir683", _2=>1560, _3=>undef)
        anonymous()
            "isc.Timer.$in(_5,_6)"
    
    16:47:09.352:TMR4:INFO:aria:ARIA state: hidden: true, set on element: [DIVElement]{ID:isc_1FP}
    16:47:09.354:TMR4:DEBUG:Label:isc_Label_6:setRect: {left: 0,
    top: -1000,
    width: undef,
    height: undef}
    16:47:09.384:TMR6:DEBUG:drawing:clearRedrawQueue: [Toolbar ID:isc_Toolbar_7], [Button ID:isc_Button_69]
    16:47:09.387:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3204}
    16:47:09.390:TMR6:INFO:drawing:isc_Toolbar_7:$ra(): redrawing
    16:47:09.392:TMR6:INFO:drawing:isc_Toolbar_7:redrawChildren(): 13 children
    16:47:09.394:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3208}
    16:47:09.397:TMR6:INFO:drawing:isc_Button_59:$ra(): redrawing
    16:47:09.401:TMR6:INFO:sizing:isc_Button_59:Specified size: 30x23, drawn scroll size: 30x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.403:TMR6:DEBUG:sizing:isc_Button_59:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 30,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 30,
    offsetHeight: 23,
    styleLeft: "0px",
    styleTop: "0px",
    styleWidth: "30px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.406:TMR6:DEBUG:drawing:isc_Button_59:Redraw() - Total time to redraw in DOM:9
    16:47:09.408:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3214}
    16:47:09.411:TMR6:INFO:drawing:isc_Button_60:$ra(): redrawing
    16:47:09.414:TMR6:INFO:sizing:isc_Button_60:Specified size: 280x23, drawn scroll size: 280x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.416:TMR6:DEBUG:sizing:isc_Button_60:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 280,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 280,
    offsetHeight: 23,
    styleLeft: "30px",
    styleTop: "0px",
    styleWidth: "280px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.418:TMR6:INFO:drawing:isc_Button_60:redrawPeers(): 0 peers
    16:47:09.420:TMR6:DEBUG:drawing:isc_Button_60:Redraw() - Total time to redraw in DOM:9
    16:47:09.422:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3221}
    16:47:09.425:TMR6:INFO:drawing:isc_Button_61:$ra(): redrawing
    16:47:09.429:TMR6:INFO:sizing:isc_Button_61:Specified size: 168x23, drawn scroll size: 168x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.432:TMR6:DEBUG:sizing:isc_Button_61:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 168,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 168,
    offsetHeight: 23,
    styleLeft: "310px",
    styleTop: "0px",
    styleWidth: "168px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.434:TMR6:DEBUG:drawing:isc_Button_61:Redraw() - Total time to redraw in DOM:9
    16:47:09.437:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3227}
    16:47:09.440:TMR6:INFO:drawing:isc_Button_62:$ra(): redrawing
    16:47:09.444:TMR6:INFO:sizing:isc_Button_62:Specified size: 112x23, drawn scroll size: 112x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.447:TMR6:DEBUG:sizing:isc_Button_62:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 112,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 112,
    offsetHeight: 23,
    styleLeft: "478px",
    styleTop: "0px",
    styleWidth: "112px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.449:TMR6:DEBUG:drawing:isc_Button_62:Redraw() - Total time to redraw in DOM:9
    16:47:09.452:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3233}
    16:47:09.454:TMR6:INFO:drawing:isc_Button_63:$ra(): redrawing
    16:47:09.458:TMR6:INFO:sizing:isc_Button_63:Specified size: 89x23, drawn scroll size: 89x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.460:TMR6:DEBUG:sizing:isc_Button_63:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 89,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 89,
    offsetHeight: 23,
    styleLeft: "590px",
    styleTop: "0px",
    styleWidth: "89px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.462:TMR6:DEBUG:drawing:isc_Button_63:Redraw() - Total time to redraw in DOM:8
    16:47:09.464:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3239}
    16:47:09.467:TMR6:INFO:drawing:isc_Button_64:$ra(): redrawing
    16:47:09.477:TMR6:INFO:sizing:isc_Button_64:Specified size: 112x23, drawn scroll size: 112x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.480:TMR6:DEBUG:sizing:isc_Button_64:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 112,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 112,
    offsetHeight: 23,
    styleLeft: "679px",
    styleTop: "0px",
    styleWidth: "112px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.484:TMR6:DEBUG:drawing:isc_Button_64:Redraw() - Total time to redraw in DOM:17
    16:47:09.488:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3245}
    16:47:09.492:TMR6:INFO:drawing:isc_Button_65:$ra(): redrawing
    16:47:09.496:TMR6:INFO:sizing:isc_Button_65:Specified size: 112x23, drawn scroll size: 112x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.498:TMR6:DEBUG:sizing:isc_Button_65:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 112,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 112,
    offsetHeight: 23,
    styleLeft: "791px",
    styleTop: "0px",
    styleWidth: "112px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.500:TMR6:DEBUG:drawing:isc_Button_65:Redraw() - Total time to redraw in DOM:8
    16:47:09.503:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3251}
    16:47:09.505:TMR6:INFO:drawing:isc_Button_66:$ra(): redrawing
    16:47:09.508:TMR6:INFO:sizing:isc_Button_66:Specified size: 112x23, drawn scroll size: 112x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.511:TMR6:DEBUG:sizing:isc_Button_66:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 112,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 112,
    offsetHeight: 23,
    styleLeft: "903px",
    styleTop: "0px",
    styleWidth: "112px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.513:TMR6:DEBUG:drawing:isc_Button_66:Redraw() - Total time to redraw in DOM:8
    16:47:09.516:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3257}
    16:47:09.519:TMR6:INFO:drawing:isc_Button_67:$ra(): redrawing
    16:47:09.523:TMR6:INFO:sizing:isc_Button_67:Specified size: 112x23, drawn scroll size: 112x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.526:TMR6:DEBUG:sizing:isc_Button_67:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 112,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 112,
    offsetHeight: 23,
    styleLeft: "1015px",
    styleTop: "0px",
    styleWidth: "112px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.529:TMR6:DEBUG:drawing:isc_Button_67:Redraw() - Total time to redraw in DOM:9
    16:47:09.532:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3263}
    16:47:09.535:TMR6:INFO:drawing:isc_Button_68:$ra(): redrawing
    16:47:09.539:TMR6:INFO:sizing:isc_Button_68:Specified size: 112x23, drawn scroll size: 112x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.541:TMR6:DEBUG:sizing:isc_Button_68:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 112,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 112,
    offsetHeight: 23,
    styleLeft: "1127px",
    styleTop: "0px",
    styleWidth: "112px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.543:TMR6:DEBUG:drawing:isc_Button_68:Redraw() - Total time to redraw in DOM:8
    16:47:09.546:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3269}
    16:47:09.550:TMR6:INFO:drawing:isc_Button_69:$ra(): redrawing
    16:47:09.556:TMR6:INFO:sizing:isc_Button_69:Specified size: 112x23, drawn scroll size: 112x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.559:TMR6:DEBUG:sizing:isc_Button_69:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 112,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 112,
    offsetHeight: 23,
    styleLeft: "1239px",
    styleTop: "0px",
    styleWidth: "112px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.562:TMR6:INFO:drawing:isc_Button_69:redrawPeers(): 1 peers
    16:47:09.564:TMR6:INFO:redraws:isc_ListGrid_1_headerMenuButton:Immediate redraw (redrawPeers)
        Canvas.$q9(_1=>"redrawPeers", _2=>false)
        Canvas.redraw(_1=>"redrawPeers")
        Canvas.redrawPeers()
        Canvas.$ra()
        ** recursed on Canvas.redraw
    
    16:47:09.566:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3276}
    16:47:09.570:TMR6:INFO:drawing:isc_ListGrid_1_headerMenuButton:$ra(): redrawing
    16:47:09.573:TMR6:INFO:sizing:isc_ListGrid_1_headerMenuButton:Specified size: 17x23, drawn scroll size: 17x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.576:TMR6:DEBUG:sizing:isc_ListGrid_1_headerMenuButton:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 17,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 17,
    offsetHeight: 23,
    styleLeft: "1334px",
    styleTop: "0px",
    styleWidth: "17px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.578:TMR6:DEBUG:drawing:isc_ListGrid_1_headerMenuButton:Redraw() - Total time to redraw in DOM:8
    16:47:09.580:TMR6:DEBUG:drawing:isc_Button_69:Redraw() - Total time to redraw in DOM:30
    16:47:09.582:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3283}
    16:47:09.585:TMR6:INFO:drawing:isc_Button_70:$ra(): redrawing
    16:47:09.588:TMR6:INFO:sizing:isc_Button_70:Specified size: 117x23, drawn scroll size: 117x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.590:TMR6:DEBUG:sizing:isc_Button_70:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 117,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 117,
    offsetHeight: 23,
    styleLeft: "1351px",
    styleTop: "0px",
    styleWidth: "117px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.592:TMR6:DEBUG:drawing:isc_Button_70:Redraw() - Total time to redraw in DOM:7
    16:47:09.594:TMR6:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3289}
    16:47:09.597:TMR6:INFO:drawing:isc_ListGrid_1_headerMenuButton:$ra(): redrawing
    16:47:09.602:TMR6:INFO:sizing:isc_ListGrid_1_headerMenuButton:Specified size: 17x23, drawn scroll size: 17x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.606:TMR6:DEBUG:sizing:isc_ListGrid_1_headerMenuButton:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 17,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 17,
    offsetHeight: 23,
    styleLeft: "1334px",
    styleTop: "0px",
    styleWidth: "17px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.609:TMR6:DEBUG:drawing:isc_ListGrid_1_headerMenuButton:Redraw() - Total time to redraw in DOM:12
    16:47:09.613:TMR6:INFO:sizing:isc_Toolbar_7:Specified size: 1468x23, drawn scroll size: 1468x23, border: 0x0, margin: 0x0, reason: redraw
    16:47:09.616:TMR6:DEBUG:sizing:isc_Toolbar_7:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 1468,
    scrollHeight: 23,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 1468,
    offsetHeight: 23,
    styleLeft: "0px",
    styleTop: "22px",
    styleWidth: "1468px",
    styleHeight: "23px",
    styleClip: ""}
    16:47:09.618:TMR6:DEBUG:drawing:isc_Toolbar_7:Redraw() - Total time to redraw in DOM:228
    16:47:09.620:TMR6:DEBUG:redraws:clearRedrawQueue: 1 redraws (2 items), 236ms
    16:47:09.626:MMV9:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3299}
    16:47:09.629:MMV9:DEBUG:MessagingDMISocket:isc_MessagingDMISocket_2:$139v: {sendChannel: "CBECDF54-6CA9-4E9B-9995-D4F78EE7D672",
    packet: Obj,
    callback: null,
    sequence: 3301}
    Attached Files

    #2
    After ungrouping the listGrid manually (over the table header option)... the double entry will be removed too. When I regroup the grid again... it is working correct.... no double records.

    Comment


      #3
      This test code is only partial; it doesn't even include the DataSource or form where the save occurs.

      Also, the logs you've posted show lots of unrelated information and show that other activities are going on at the same time, including some Messaging activity.

      Nothing you've posted suggests a framework bug. Lots of different application bugs or usage issues could be the problem.

      To correctly report a bug, create a minimal test case that has just the code necessary to reproduce the problem. The best way to do this is usually to start from a sample, and make just enough changes to reproduce the problem you're seeing. See the Debugging overview for further advice.

      Comment


        #4
        ok... I understand... give me some to time to figure this out... I will come back soon.

        Comment


          #5
          Ok... you are right... I can not reproduce this in a new example.... What does this error mean? This appears after calling "dynamicForm.submit()"

          Thanks
          Andy

          Code:
           public VLayout getEditForm()
              {
          
                  VLayout layout = new VLayout();
                  layout.setBorder( GWebAdmin.border );
          
                  txtDescription = new TextItem( CAssignedPaymentsRec.description );
                  txtDescription.setWidth( "100%" );
          
                  comboType = new SelectItem( "type" );
                  comboType.setWidth( "*" );
                  comboType.setDefaultToFirstOption( true );
                  comboType.setAllowEmptyValue( false );
                  comboType.setRequired( true );
                  comboType.setValueField( CItemSupplyPaymentTypesRec.payment_id );
                  comboType.setDisplayField( CItemSupplyPaymentTypesRec.en );
                  comboType.setOptionDataSource( CItemSupplyPaymentTypesRec.getInstance( 2, null, null, null, null, null, null,
                                                                                         null ) );
          
          
          
                  txtExternalNotes = new TextAreaItem( "external_notes" );
                  txtExternalNotes.setWidth( "*" );
                  txtExternalNotes.setHeight( 200 );
                  txtExternalNotes.setVisible( false );
          
                  txtNotes = new TextAreaItem( "notes" );
                  txtNotes.setWidth( "*" );
                  txtNotes.setHeight( 200 );
          
                  checkBoxActive = new CheckboxItem( "active" );
                  checkBoxActive.setDefaultValue( true );
          
                  txtId = new StaticTextItem( "payment_id" );
                  txtId.setStartRow( true );
                  txtId.setEndRow( true );
                  txtId.setWidth( "*" );
                  txtId.setEmptyDisplayValue( "---" );
          
                  txtCreator = new StaticTextItem( "creator" );
                  txtCreator.setStartRow( true );
                  txtCreationDate = new StaticTextItem( "creation_date" );
                  txtCreationDate.setStartRow( true );
          
                  txtEditor = new StaticTextItem( "editor" );
                  txtEditor.setStartRow( true );
                  txtEditDate = new StaticTextItem("edit_date" );
                  txtEditDate.setStartRow( true );
          
          
                  SpacerItem lineSpacer = new SpacerItem();
                  lineSpacer.setHeight( 10 );
                  lineSpacer.setWidth( "*" );
                  lineSpacer.setColSpan( 8 );
          
          
          
                  editorForm = new DynamicForm();
                  editorForm.setDataSource( listGrid.getDataSource() );
                  editorForm.setAutoFocus( true );
                  editorForm.setWidth100();
                  editorForm.setMargin( 25 );
                  editorForm.setNumCols( 5 );
                  editorForm.setColWidths( "*", "*", 150, "*", "*" );
          
                  editorForm.addItemChangedHandler( new ItemChangedHandler()
                  {
          
                      @Override
                      public void onItemChanged( ItemChangedEvent event )
                      {
                          modified = true;
                      }
                  } );
          
                  editorForm.setFields( comboType, lineSpacer, txtDescription, lineSpacer, txtExternalNotes,
                                        txtNotes, checkBoxActive, lineSpacer, txtId, txtCreator, txtCreationDate, txtEditor,
                                        txtEditDate );
          
                  layout.addMember( editorForm );
          
                  return layout;
              }
          Code:
          public DataSource getDataSource( int typeValue, String idValues )
              {
                  String dataUrl = null;
                  if ( typeValue == 0 )
                  {
                      dataUrl = GWT.getHostPageBaseURL() + "rest/recPayments/getPayments/" + idValues;
                  }
                  else if ( typeValue == 1 )
                  {
                      dataUrl = GWT.getHostPageBaseURL() + "rest/recPayments/getPaymentsOfReceivables/" + idValues;
                  }
            
                  DataSource ds = new DataSource();
                  ds.setID( "someId" );
                  ds.setClientOnly( true );
                  ds.setDataURL( dataUrl );
                  ds.setDataFormat( DSDataFormat.JSON );
          
                  DataSourceSequenceField idField = new DataSourceSequenceField( "payment_id" );
                  idField.setPrimaryKey( true );
          
                  DataSourceTextField descriptionField = new DataSourceTextField( "description");
                  DataSourceTextField typeField = new DataSourceTextField( "type");
                  DataSourceTextField notesField = new DataSourceTextField("notes" );
                  DataSourceTextField externalNotesField =
                      new DataSourceTextField( "external_notes");
                  DataSourceBooleanField activeField = new DataSourceBooleanField( "active");
                  DataSourceTextField creatorField = new DataSourceTextField( "creator" );
                  DataSourceTextField editorField = new DataSourceTextField( "editor");
                  DataSourceDateTimeField creationDateField =
                      new DataSourceDateTimeField( "creation_date");
                  DataSourceDateTimeField editDateField = new DataSourceDateTimeField( "edit_date");
                
                  ds.setFields( idField, typeField, descriptionField, externalNotesField, notesField,
                                activeField, creatorField, creationDateField, editorField, editDateField, taxTypeField,
                                enteredAmountField, showCityField, showDateField, paymentDateField, receivable_idField,
                                artist_nameField, type_nameField, buyout_nameField, agreement_typeField, creditor_nameField );
                  return ds;
          
              }
          Code:
          13:41:33.052 [ERROR] [com.uds.webadmin.GBookingAdmin] 13:41:32.975:TMR9:WARN:Log:ReferenceError: isc_DynamicForm_18 is not defined
          Stack from error.stack:
              anonymous() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:55
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:279
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:347
              DataSource.fireResponseCallbacks() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:716
              DataSource._completeResponseProcessing() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:713
              DataSource._handleClientOnlyReply/_6() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:574
              DataSource._handleClientOnlyReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:575
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:279
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:347
              anonymous() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1655
              $wnd.isc.RPCManager.fireReplyCallback() @ :311
              [c]RPCManager.fireReplyCallbacks() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1660
              [c]RPCManager.performOperationReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1653
              RPCManager._performTransactionReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1638
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:279
              Timer._fireTimeout() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:1326
              Timer.setTimeout/_6<() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:1323
          com.smartgwt.client.core.JsObject$SGWT_WARN: 13:41:32.975:TMR9:WARN:Log:ReferenceError: isc_DynamicForm_18 is not defined
          Stack from error.stack:
              anonymous() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:55
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:279
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:347
              DataSource.fireResponseCallbacks() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:716
              DataSource._completeResponseProcessing() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:713
              DataSource._handleClientOnlyReply/_6() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:574
              DataSource._handleClientOnlyReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:575
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:279
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:347
              anonymous() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1655
              $wnd.isc.RPCManager.fireReplyCallback() @ :311
              [c]RPCManager.fireReplyCallbacks() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1660
              [c]RPCManager.performOperationReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1653
              RPCManager._performTransactionReply() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_DataBinding.js:1638
              [c]Class.fireCallback() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:279
              Timer._fireTimeout() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:1326
              Timer.setTimeout/_6<() @ com.uds.webadmin.GBookingAdmin/sc/modules/ISC_Core.js:1323
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
              at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
              at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:72)
              at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
              at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:296)
              at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:551)
              at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368)
              at java.lang.Thread.run(Thread.java:745)
          Last edited by andyx1975; 16 Dec 2015, 07:38.

          Comment


            #6
            This looks like the result of telling a DynamicForm to submit() or save(), then immediately destroy()ing it (which is invalid).

            It may be a direct call to destroy() the form, or just destroying some Layout or other container which the form is inside of.

            Comment


              #7
              ok you are right... the error above has nothing to do with my issues. Aft Submit... I called window.destroy()... the following code avoids this error.

              Code:
              Scheduler.get().scheduleDeferred( new Command()
                      {
                          @Override
                          public void execute()
                          {
                              window.destroy();
                          }
                      } );
              But this error had indeed nothing to do with my listGrid issues.

              Comment


                #8
                So right now I get the following error... But I do not really find the problem when I compare the code with the showcases

                Code:
                13:17:24.151:MUP0:WARN:ListGrid:isc_ListGrid_1_summaryRow:Invalid call to setDataSource() passing null.  (Set the property 'skipNullDataSourceCheck' on the component to avoid this warning.)  If you're having trouble with loading DataSources, please see the following FAQ: http://forums.smartclient.com/showthread.php?t=8159#aDSLoad

                Comment


                  #9
                  Hi,

                  I finally found the code line that causes the doubled records. If you call the method "listGrid.clearCriteria();", the DataSource does not work proper anymore when the grid is grouped.

                  You can try the following code. If you uncomment the method call "listGrid.clearCriteria();" the grid is working fine. This was not the case in smartGWT 5.0p. So I guess it is a bug... right?
                  Calling listGrid.clearCriteria() should be posiibled when the grid is grouped.



                  Code:
                  import java.util.LinkedHashMap;
                  
                  import com.google.gwt.i18n.client.NumberFormat;
                  import com.smartgwt.client.data.DataSource;
                  import com.smartgwt.client.data.events.DataChangedEvent;
                  import com.smartgwt.client.data.events.DataChangedHandler;
                  import com.smartgwt.client.data.fields.DataSourceFloatField;
                  import com.smartgwt.client.data.fields.DataSourceSequenceField;
                  import com.smartgwt.client.data.fields.DataSourceTextField;
                  import com.smartgwt.client.types.Alignment;
                  import com.smartgwt.client.types.AutoFitWidthApproach;
                  import com.smartgwt.client.types.FetchMode;
                  import com.smartgwt.client.types.GroupStartOpen;
                  import com.smartgwt.client.types.Overflow;
                  import com.smartgwt.client.types.RecordDropAppearance;
                  import com.smartgwt.client.types.SummaryFunctionType;
                  import com.smartgwt.client.util.SC;
                  import com.smartgwt.client.widgets.Window;
                  import com.smartgwt.client.widgets.events.ClickEvent;
                  import com.smartgwt.client.widgets.events.ClickHandler;
                  import com.smartgwt.client.widgets.form.DynamicForm;
                  import com.smartgwt.client.widgets.grid.CellFormatter;
                  import com.smartgwt.client.widgets.grid.ListGrid;
                  import com.smartgwt.client.widgets.grid.ListGridField;
                  import com.smartgwt.client.widgets.grid.ListGridRecord;
                  import com.smartgwt.client.widgets.layout.VLayout;
                  import com.smartgwt.client.widgets.toolbar.ToolStrip;
                  import com.smartgwt.client.widgets.toolbar.ToolStripButton;
                  
                  public class GTestGrid
                  {
                  
                      private ListGrid listGrid;
                      private DynamicForm editorForm;
                  
                      public GTestGrid()
                      {
                          initPopUp();
                      }
                  
                      private void initPopUp()
                      {
                          initListGrid();
                          initEditorForm();
                  
                          VLayout layout = new VLayout();
                          layout.setSize( "100%", "100%" );
                          layout.setMembers( editorForm, getToolBar(), listGrid );
                          layout.setOverflow( Overflow.HIDDEN );
                  
                          Window window = new Window();
                          window.setOverflow( Overflow.HIDDEN );
                          window.setShowShadow( true );
                          window.setShadowSoftness( 10 );
                          window.setShadowOffset( 5 );
                          window.setSize( "100%", "100%" );
                          window.setCanDragResize( true );
                          window.setShowMaximizeButton( true );
                          window.setShowMinimizeButton( true );
                          window.setShowCloseButton( false );
                          window.setAnimateMinimize( true );
                          window.setShowCloseButton( true );
                          window.setModalMaskOpacity( 50 );
                          window.setIsModal( true );
                          window.setShowModalMask( true );
                          window.centerInPage();
                          window.addItem( layout );
                  
                          window.draw();
                  
                          listGrid.getResultSet().addDataChangedHandler( new DataChangedHandler()
                          {
                  
                              @Override
                              public void onDataChanged( DataChangedEvent event )
                              {
                                  double totalAmount = 0;
                  
                                  // Clears filter to get all visible and all invisible records
                                  listGrid.clearCriteria();
                  
                                  // Gets all records of the listGrid
                                  ListGridRecord[] records = listGrid.getRecords();
                  
                                  for ( int i = 0; i < records.length; i++ )
                                  {
                                      totalAmount = totalAmount + records[i].getAttributeAsDouble( CAssignedPaymentsRec.total_amount );
                                  }
                  
                                  SC.say( "Total Amount: " + totalAmount );
                              }
                          } );
                      }
                  
                      private void initListGrid()
                      {
                          DataSource dataSource = getDataSource();
                          listGrid = new ListGrid();
                          listGrid.setMargin( 25 );
                          listGrid.setDataSource( dataSource );
                          listGrid.setAutoFetchData( true );
                          listGrid.setShowFilterEditor( true );
                          listGrid.setAllowFilterExpressions( true );
                          listGrid.setShowRowNumbers( true );
                          listGrid.setFastCellUpdates( true );
                          listGrid.setEmptyCellValue( "---" );
                          listGrid.setAllowFilterExpressions( true );
                          listGrid.setDataFetchMode( FetchMode.BASIC );
                          listGrid.setWrapHeaderTitles( true );
                          listGrid.setCanResizeFields( true );
                          listGrid.setCellPadding( 4 );
                          listGrid.setFixedRecordHeights( false );
                          listGrid.setGroupByMaxRecords( 1000 );
                          listGrid.setBodyOverflow( Overflow.AUTO );
                          listGrid.setOverflow( Overflow.AUTO );
                          listGrid.setLeaveScrollbarGap( false );
                          listGrid.setAutoFitWidthApproach( AutoFitWidthApproach.BOTH );
                          listGrid.setAutoFitHeaderHeights( true );
                          listGrid.setAutoSizeHeaderSpans( true );
                          listGrid.setCanAutoFitFields( false );
                          listGrid.setRecordDropAppearance( RecordDropAppearance.BOTH );
                  
                          // Live Filter in keypress
                          // listGrid.setFilterOnKeypress( true );
                          // listGrid.setFetchDelay( 900 );
                  
                          listGrid.setCanAddFormulaFields( true );
                          listGrid.setCanAddSummaryFields( true );
                  
                          // Sets Columns
                          setColumns( listGrid );
                  
                      }
                  
                      private void setColumns( ListGrid listGrid )
                      {
                          ListGridField idField = new ListGridField( "id" );
                          idField.setWidth( "10%" );
                          idField.setAlign( Alignment.CENTER );
                          idField.setShowGroupSummary( false );
                          idField.setHidden( true );
                          idField.setCanEdit( false );
                  
                          ListGridField descriptionField = new ListGridField( "description" );
                          descriptionField.setWidth( "60%" );
                          descriptionField.setCanEdit( false );
                  
                          ListGridField netField = new ListGridField( "netAmount" );
                          netField.setSummaryFunction( SummaryFunctionType.SUM );
                          netField.setShowGroupSummary( true );
                          netField.setShowGridSummary( true );
                          netField.setWidth( "10%" );
                          netField.setAlign( Alignment.CENTER );
                          netField.setCellFormatter( new CellFormatter()
                          {
                              public String format( Object value, ListGridRecord record, int rowNum, int colNum )
                              {
                                  if ( value == null )
                                      return null;
                                  try
                                  {
                                      NumberFormat fmt = NumberFormat.getFormat( "#,##0.00" );
                                      return fmt.format( Double.valueOf( String.valueOf( value ) ) );
                                  }
                                  catch ( Exception e )
                                  {
                                      return value.toString();
                                  }
                              }
                          } );
                  
                          ListGridField taxField = new ListGridField( "taxAmount" );
                          taxField.setWidth( "10%" );
                          taxField.setSummaryFunction( SummaryFunctionType.SUM );
                          taxField.setShowGroupSummary( true );
                          taxField.setShowGridSummary( true );
                          taxField.setAlign( Alignment.CENTER );
                          taxField.setCellFormatter( new CellFormatter()
                          {
                              public String format( Object value, ListGridRecord record, int rowNum, int colNum )
                              {
                                  if ( value == null )
                                      return null;
                                  try
                                  {
                                      NumberFormat fmt = NumberFormat.getFormat( "#,##0.00" );
                                      return fmt.format( Double.valueOf( String.valueOf( value ) ) );
                                  }
                                  catch ( Exception e )
                                  {
                                      return value.toString();
                                  }
                              }
                          } );
                  
                          ListGridField grossField = new ListGridField( "grossAmoumnt" );
                          grossField.setSummaryFunction( SummaryFunctionType.SUM );
                          grossField.setShowGroupSummary( true );
                          grossField.setShowGridSummary( true );
                          grossField.setAlign( Alignment.CENTER );
                          grossField.setWidth( "10%" );
                          grossField.setCellFormatter( new CellFormatter()
                          {
                              public String format( Object value, ListGridRecord record, int rowNum, int colNum )
                              {
                                  if ( value == null )
                                      return null;
                                  try
                                  {
                                      NumberFormat fmt = NumberFormat.getFormat( "#,##0.00" );
                                      return fmt.format( Double.valueOf( String.valueOf( value ) ) );
                                  }
                                  catch ( Exception e )
                                  {
                                      return value.toString();
                                  }
                              }
                          } );
                  
                          ListGridField currencyField = new ListGridField( "currency" );
                          currencyField.setAlign( Alignment.CENTER );
                          currencyField.setWidth( "8%" );
                          currencyField.setCanEdit( false );
                  
                          listGrid.setFields( idField, descriptionField, netField, taxField, grossField );
                  
                          // Group ListGrid
                          listGrid.setGroupByField( "currency" );
                          listGrid.setGroupStartOpen( GroupStartOpen.ALL );
                          listGrid.setShowGroupSummary( true );
                          listGrid.setShowGridSummary( true );
                  
                      }
                  
                      private DataSource getDataSource()
                      {
                          DataSource ds = new DataSource();
                          ds.setID( "payments" );
                          ds.setClientOnly( true );
                  
                          DataSourceSequenceField idField = new DataSourceSequenceField( "id", "ID" );
                          idField.setPrimaryKey( true );
                          idField.setHidden( true );
                  
                          DataSourceTextField descriptionField = new DataSourceTextField( "description", "Description" );
                          descriptionField.setRequired( true );
                          DataSourceFloatField netField = new DataSourceFloatField( "netAmount", "Net Amount" );
                          netField.setRequired( true );
                          DataSourceFloatField taxField = new DataSourceFloatField( "taxAmount", "Tax Amount" );
                          taxField.setRequired( true );
                          DataSourceFloatField grossField = new DataSourceFloatField( "grossAmoumnt", "Gross Amount" );
                          grossField.setRequired( true );
                  
                          DataSourceTextField currencyField = new DataSourceTextField( "currency", "Currency" );
                          currencyField.setValueMap( getCurrencys() );
                          currencyField.setRequired( true );
                  
                          ds.setFields( idField, descriptionField, netField, taxField, grossField, currencyField );
                  
                          return ds;
                      }
                  
                      private void initEditorForm()
                      {
                          editorForm = new DynamicForm();
                          editorForm.setDataSource( listGrid.getDataSource() );
                          editorForm.setAutoFocus( true );
                          editorForm.setWidth100();
                          editorForm.setMargin( 25 );
                          editorForm.setUseAllDataSourceFields( true );
                  
                          editorForm.editNewRecord();
                      }
                  
                      private ToolStrip getToolBar()
                      {
                          ToolStrip toolbar = new ToolStrip();
                          toolbar.setWidth100();
                  
                          ToolStripButton buttonAddToGrid = new ToolStripButton( "Add To Grid" );
                          buttonAddToGrid.addClickHandler( new ClickHandler()
                          {
                              public void onClick( ClickEvent event )
                              {
                                  if ( editorForm.validate() == true )
                                  {
                                      editorForm.submit();
                                  }
                              }
                          } );
                  
                          ToolStripButton buttonNewRecord = new ToolStripButton( "New Record" );
                          buttonNewRecord.addClickHandler( new ClickHandler()
                          {
                              public void onClick( ClickEvent event )
                              {
                                  editorForm.editNewRecord();
                              }
                          } );
                  
                          toolbar.addButton( buttonNewRecord );
                          toolbar.addButton( buttonAddToGrid );
                  
                          return toolbar;
                  
                      }
                  
                      public LinkedHashMap<String, String> getCurrencys()
                      {
                          LinkedHashMap<String, String> items = new LinkedHashMap<String, String>();
                  
                          items.put( "1", "EUR" );
                          items.put( "2", "GBP" );
                          items.put( "3", "CHF" );
                          items.put( "4", "SEK" );
                          items.put( "5", "DKK" );
                          items.put( "6", "PLN" );
                          items.put( "7", "BGN" );
                          items.put( "8", "CZK" );
                          items.put( "9", "HUF" );
                          items.put( "10", "HRK" );
                          items.put( "11", "RUB" );
                          items.put( "12", "RON" );
                  
                          return items;
                      }
                  
                  }
                  Last edited by andyx1975; 21 Dec 2015, 06:54.

                  Comment


                    #10
                    What is the purpose of that clearCriteria() call? It looks like it would clear user-entered criteria as soon as the server responds with data that match those criteria, as well as anytime data is saved. This seems bizarre - is that actually the effect you want?

                    Comment


                      #11
                      hi,

                      thanks for getting back. The purpose is as follows:

                      - I want to get all Records of a listGrid... So I call the method listGrid.getRecords()
                      - But listGrid.getRecords() only returns the visble records
                      - If the user enters a filter criteria. I do not get all listGridRecods
                      - Therefore I call listGrid.clearCriteria() before I call "listGrid.getRecords()

                      Is there a better way to get the visible + invisible Records in a groupedList, without the grouping headers?
                      Last edited by andyx1975; 21 Dec 2015, 09:28.

                      Comment


                        #12
                        This seems to work... is this a good solution?

                        Code:
                        public Record[] getAssignments()
                            {
                                RecordList recordList = null;
                                if ( listGrid.isGrouped() )
                                {
                                    recordList = listGrid.getOriginalRecordList();
                                }
                                else
                                {
                                    recordList = listGrid.getResultSet();
                                }
                        
                                Record[] result = (Record[]) recordList.toArray();
                        
                                return result;
                            }

                        Comment


                          #13
                          That's the correct way to get all the records that are potentially visible to the user if they opened all groups, or just ungrouped.

                          If that's what you want, there's no need for a clearCriteria() call, and placing a clearCriteria() where you did (ever time DataChanged fires) would have unspecified results, since you'd basically be in a kind of loop (clearCriteria() itself potentially triggers a new DataChanged notification).

                          Comment


                            #14
                            Ok... I see... thank you very much!!!

                            Comment

                            Working...
                            X