Announcement

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

    ListGrid Filter Editor datechooser problem

    Hi, I am using SmartGwt 2.5 nightly build 2011-08-05 with gwt 2.3. Browser FireFox 5.0, Chrome 13.0.782.112 m
    After change to smartgwt 2.5 and gwt 2.3 I can't get daterange dialogbox from ListGridFilterEditor (I am not sure if this is related to my problem)

    When I click date picker in ListGridFilterEditor I get only date chooser instead of daterange dialog box.

    below logs from dev console when I click date picker in ListGridFilterEditor:
    Code:
    18:15:20.097:TMR4:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_WndAwarie_2_modalMask]
    18:15:21.230:TMR9:DEBUG:EventHandler:mousing out of [ScreenSpan ID:isc_WndAwarie_2_modalMask]  mousing over [Window ID:isc_WndAwarie_2]
    18:15:21.256:TMR4:DEBUG:EventHandler:mousing out of [Window ID:isc_WndAwarie_2]  mousing over [Canvas ID:isc_Canvas_0]
    18:15:21.405:TMR7:DEBUG:EventHandler:mousing out of [Canvas ID:isc_Canvas_0]  mousing over [Window ID:isc_WndAwarie_2]
    18:15:21.490:TMR2:DEBUG:EventHandler:mousing out of [Window ID:isc_WndAwarie_2]  mousing over [RecordEditor ID:isc_ListGrid_2filterEditor]
    18:15:21.503:TMR5:DEBUG:EventHandler:mousing out of [RecordEditor ID:isc_ListGrid_2filterEditor]  mousing over [DynamicForm ID:isc_DynamicForm_8]
    18:15:21.503:TMR5:DEBUG:Label:isc_Label_1:setRect: {left: 0,
    top: -1000,
    width: undef,
    height: undef}
    18:15:21.515:TMR8:INFO:redraws:isc_Label_1:Scheduling redraw (setContents)
        Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Canvas.$q9(_1=>"setContents",  _2=>undef)
        Canvas.markForRedraw(_1=>"setContents")
        Canvas.setContents(_1=>"Pokaż kalendarzyk")
        [c]Hover.show(_1=>"Pokaż kalendarzyk",  _2=>Obj,  _3=>undef,  _4=>undef)
        FormItem.$170()
        [c]Hover.setAction(_1=>[DateTimeItem ID:isc_DateTimeItem_9 name:dataDo],  _2=>FormItem.$170(),  _3=>null,  _4=>500)
        FormItem.$113(_1=>"picker")
        DynamicForm.$11y(_1=>Obj,  _2=>"mouseMove")
        DynamicForm.handleMouseMove(_1=>Obj,  _2=>undef)
        [c]EventHandler.bubbleEvent(_1=>[DynamicForm ID:isc_DynamicForm_8],  _2=>"mouseMove",  _3=>undef,  _4=>undef)
        [c]EventHandler.$kz(_1=>null,  _2=>Obj)
        [c]EventHandler.$kx(_1=>null,  _2=>Obj)
        [c]EventHandler.$kv(_1=>1313511321514)
        [c]Class.fireCallback(_1=>Obj,  _2=>undef,  _3=>Array[1],  _4=>[Class EventHandler],  _5=>true) on [Class Timer]
    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])
    
    
    18:15:21.516:TMR8:INFO:sizing:isc_Label_1:Specified size: 100x1, drawn scroll size: 100x38, border: 0x0, margin: 0x0, old size: 100x38, reason: undefined
    18:15:21.516:TMR8:DEBUG:sizing:isc_Label_1:clipHandle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 100,
    scrollHeight: 38,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 100,
    offsetHeight: 38,
    styleLeft: "0px",
    styleTop: "-1000px",
    styleWidth: "100px",
    styleHeight: "38px",
    styleClip: ""}
    18:15:21.517:TMR8:DEBUG:sizing:isc_Label_1:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 100,
    scrollHeight: 38,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 100,
    offsetHeight: 38,
    styleLeft: "",
    styleTop: "",
    styleWidth: "",
    styleHeight: "",
    styleClip: ""}
    18:15:21.517:TMR8:DEBUG:Label:isc_Label_1:setRect: {left: null,
    top: -9999,
    width: 100,
    height: 1}
    18:15:21.518:TMR8:INFO:redraws:isc_Label_1:Immediate redraw of dirty widget (show() while dirty)
        Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Canvas.$q9(_1=>"show() while dirty",  _2=>false)
        Canvas.redraw(_1=>"show() while dirty")
        Canvas.setVisibility(_1=>"inherit")
        Canvas.show()
        [c]Hover.show(_1=>"Pokaż kalendarzyk",  _2=>Obj,  _3=>undef,  _4=>undef)
        FormItem.$170()
        [c]Hover.setAction(_1=>[DateTimeItem ID:isc_DateTimeItem_9 name:dataDo],  _2=>FormItem.$170(),  _3=>null,  _4=>500)
        FormItem.$113(_1=>"picker")
        DynamicForm.$11y(_1=>Obj,  _2=>"mouseMove")
        DynamicForm.handleMouseMove(_1=>Obj,  _2=>undef)
        [c]EventHandler.bubbleEvent(_1=>[DynamicForm ID:isc_DynamicForm_8],  _2=>"mouseMove",  _3=>undef,  _4=>undef)
        [c]EventHandler.$kz(_1=>null,  _2=>Obj)
        [c]EventHandler.$kx(_1=>null,  _2=>Obj)
        [c]EventHandler.$kv(_1=>1313511321514)
        [c]Class.fireCallback(_1=>Obj,  _2=>undef,  _3=>Array[1],  _4=>[Class EventHandler],  _5=>true) on [Class Timer]
    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])
    
    
    18:15:21.519:TMR8:INFO:drawing:isc_Label_1:$ra(): redrawing
    18:15:21.521:TMR8:INFO:sizing:isc_Label_1:Specified size: 100x1, drawn scroll size: 100x38, border: 0x0, margin: 0x0, old size: 100x38, reason: redraw
    18:15:21.521:TMR8:DEBUG:sizing:isc_Label_1:clipHandle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 100,
    scrollHeight: 38,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 100,
    offsetHeight: 1,
    styleLeft: "0px",
    styleTop: "-9999px",
    styleWidth: "100px",
    styleHeight: "1px",
    styleClip: ""}
    18:15:21.521:TMR8:DEBUG:sizing:isc_Label_1:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 100,
    scrollHeight: 38,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 100,
    offsetHeight: 38,
    styleLeft: "",
    styleTop: "",
    styleWidth: "",
    styleHeight: "",
    styleClip: ""}
    18:15:21.522:TMR8:DEBUG:drawing:isc_Label_1:Redraw() - Total time to redraw in DOM:2
    18:15:21.522:TMR8:DEBUG:Label:isc_Label_1:setRect: {left: 902,
    top: 152,
    width: 100,
    height: 1}
    18:15:21.522:TMR8:DEBUG:clickMask:Added unmasked targets:isc_Label_1 [+ decendants] to clickMask with ID: isc_WndAwarie_2
    18:15:21.527:RDQ1:DEBUG:drawing:clearRedrawQueue: [Label ID:isc_Label_1]
    18:15:21.527:RDQ1:DEBUG:redraws:clearRedrawQueue: 0 redraws (1 items), 1ms
    18:15:21.824:MDN4:INFO:EventHandler:Target Canvas for event 'mousedown': [DynamicForm ID:isc_DynamicForm_8]
    18:15:21.827:MDN4:DEBUG:EventHandler:Bubbling event 'prepareForDragging', target '[DynamicForm ID:isc_DynamicForm_8]' has handler: DynamicForm.prepareForDragging()
    18:15:21.827:MDN4:DEBUG:EventHandler:Event 'prepareForDragging' bubbled to top
    18:15:21.827:MDN4:DEBUG:dragDrop:No dragTarget, not dragging
    18:15:21.827:MDN4:DEBUG:EventHandler:Event 'mouseDown' bubbled to top
    18:15:21.827:MDN4:DEBUG:EventHandler:Event 'mouseStillDown' bubbled to top
    18:15:21.829:MDN4:INFO:EventHandler:Target Canvas for event 'undefined': [DynamicForm ID:isc_DynamicForm_8]
    18:15:21.875:MUP5:INFO:EventHandler:Target Canvas for event 'mouseup': [DynamicForm ID:isc_DynamicForm_8]
    18:15:21.879:MUP5:DEBUG:EventHandler:Event 'mouseUp' bubbled to top
    18:15:21.879:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.879:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.879:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.879:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.879:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.879:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.880:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.880:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.880:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.880:MUP5:DEBUG:Page:handleEvent(click): firing action =>     return logHiliteCanvas.hide();
    18:15:21.883:MUP5:INFO:Date:Unable to determine input format associated with display format undefined - returning default input format
    18:15:21.884:MUP5:DEBUG:DateChooser:isc_DateChooser_0:setRect: {left: 814,
    top: 55,
    width: undef,
    height: undef}
    18:15:21.887:MUP5:INFO:redraws:isc_DateChooser_0:Scheduling redraw (no reason provided)
        Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Canvas.$q9(_1=>undef,  _2=>undef)
        Canvas.markForRedraw(_1=>undef)
        DateChooser.setData(_1=>Date(08/09/2011))
        FormItem.showPicker(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Class.invokeSuper(_1=>null,  _2=>"showPicker",  _3=>undef,  _4=>undef,  _5=>undef,  _6=>undef,  _7=>undef,  _8=>undef,  _9=>undef,  _10=>undef)
        Class.Super(_1=>"showPicker",  _2=>[object Arguments],  _3=>undef)
        DateItem.showPicker()
        anonymous(_4=>[DynamicForm ID:isc_DynamicForm_8],  _5=>[DateTimeItem ID:isc_DateTimeItem_9 name:dataDo],  _6=>Obj{name:picker})
        FormItem.$116(_1=>"picker")
        DynamicForm.handleClick(_1=>Obj,  _2=>undef)
        [c]EventHandler.bubbleEvent(_1=>[DynamicForm ID:isc_DynamicForm_8],  _2=>"click",  _3=>undef,  _4=>undef)
        [c]EventHandler.handleClick(_1=>[DynamicForm ID:isc_DynamicForm_8],  _2=>undef)
        [c]EventHandler.$k5(_1=>[object MouseEvent],  _2=>undef)
        [c]EventHandler.handleMouseUp(_1=>[object MouseEvent],  _2=>undef)
        [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(),  _2=>[object MouseEvent])
        anonymous(event=>[object MouseEvent])
    
    18:15:21.887:MUP5:INFO:clickMask:showing click mask, action: isc_DateChooser_0.hide(), autoHide true , ID: isc_DateChooser_0, focusCanvas: [DynamicForm ID:isc_DynamicForm_8]
    18:15:21.888:MUP5:DEBUG:Label:isc_Label_1:setRect: {left: 0,
    top: -1000,
    width: undef,
    height: undef}
    18:15:21.889:MUP5:DEBUG:Label:isc_Label_1:setRect: {left: 0,
    top: -1000,
    width: undef,
    height: undef}
    18:15:21.889:MUP5:INFO:redraws:isc_DateChooser_0:Immediate redraw of dirty widget (show() while dirty)
        Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Canvas.$q9(_1=>"show() while dirty",  _2=>false)
        Canvas.redraw(_1=>"show() while dirty")
        Canvas.setVisibility(_1=>"inherit")
        Canvas.show()
        Class.invokeSuper(_1=>null,  _2=>"show",  _3=>undef,  _4=>undef,  _5=>undef,  _6=>undef,  _7=>undef,  _8=>undef,  _9=>undef,  _10=>undef)
        Class.Super(_1=>"show",  _2=>[object Arguments],  _3=>undef)
        DateChooser.show()
        FormItem.showPicker(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        ** recursed on Class.invokeSuper
    
    18:15:21.891:MUP5:INFO:drawing:isc_DateChooser_0:$ra(): redrawing
    18:15:21.897:MUP5:INFO:sizing:isc_DateChooser_0:Specified size: 150x171, drawn scroll size: 146x172, border: 0x0, margin: 4x4, old size: 146x172, reason: redraw
    18:15:21.898:MUP5:DEBUG:sizing:isc_DateChooser_0:clipHandle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 146,
    scrollHeight: 172,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 146,
    offsetHeight: 167,
    styleLeft: "814px",
    styleTop: "55px",
    styleWidth: "146px",
    styleHeight: "167px",
    styleClip: ""}
    18:15:21.898:MUP5:DEBUG:sizing:isc_DateChooser_0:handle sizes: {scrollLeft: 0,
    scrollTop: 0,
    scrollWidth: 146,
    scrollHeight: 172,
    clientWidth: undef,
    clientHeight: undef,
    offsetWidth: 146,
    offsetHeight: 172,
    styleLeft: "",
    styleTop: "",
    styleWidth: "",
    styleHeight: "",
    styleClip: ""}
    18:15:21.901:MUP5:INFO:drawing:isc_DateChooser_0:redrawPeers(): 1 peers
    18:15:21.901:MUP5:DEBUG:drawing:isc_DateChooser_0:Redraw() - Total time to redraw in DOM:10
    18:15:21.902:MUP5:DEBUG:clickMask:Added unmasked targets:isc_DateChooser_0,isc_EdgedCanvas_6 [+ decendants] to clickMask with ID: isc_DateChooser_0
    18:15:21.902:MUP5:INFO:nativeFocus:isc_DateChooser_0:about to call native focus()
        Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Canvas.setFocus(_1=>true,  _2=>undef)
        Canvas.focus(_1=>undef)
        FormItem.showPicker(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
        Class.invokeSuper(_1=>null,  _2=>"showPicker",  _3=>undef,  _4=>undef,  _5=>undef,  _6=>undef,  _7=>undef,  _8=>undef,  _9=>undef,  _10=>undef)
        Class.Super(_1=>"showPicker",  _2=>[object Arguments],  _3=>undef)
        DateItem.showPicker()
        anonymous(_4=>[DynamicForm ID:isc_DynamicForm_8],  _5=>[DateTimeItem ID:isc_DateTimeItem_9 name:dataDo],  _6=>Obj{name:picker})
        FormItem.$116(_1=>"picker")
        DynamicForm.handleClick(_1=>Obj,  _2=>undef)
        [c]EventHandler.bubbleEvent(_1=>[DynamicForm ID:isc_DynamicForm_8],  _2=>"click",  _3=>undef,  _4=>undef)
        [c]EventHandler.handleClick(_1=>[DynamicForm ID:isc_DynamicForm_8],  _2=>undef)
        [c]EventHandler.$k5(_1=>[object MouseEvent],  _2=>undef)
        [c]EventHandler.handleMouseUp(_1=>[object MouseEvent],  _2=>undef)
        [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseUp(),  _2=>[object MouseEvent])
        anonymous(event=>[object MouseEvent])
    
    18:15:21.903:FCS6:DEBUG:nativeFocus:onfocus fired on: [DateChooser ID:isc_DateChooser_0]
    18:15:21.907:MUP5:DEBUG:EventHandler:Event 'click' bubbled to top
    18:15:21.919:RDQ8:DEBUG:drawing:clearRedrawQueue: [DateChooser ID:isc_DateChooser_0]
    18:15:21.920:RDQ8:DEBUG:redraws:clearRedrawQueue: 0 redraws (1 items), 1ms
    18:15:21.947:TMR0:DEBUG:EventHandler:mousing over [DateChooser ID:isc_DateChooser_0]
    18:15:22.590:TMR1:DEBUG:EventHandler:mousing out of [DateChooser ID:isc_DateChooser_0]  mousing over [ScreenSpan ID:isc_WndAwarie_2_modalMask]
    18:15:22.597:TMR4:DEBUG:EventHandler:mousing out of [ScreenSpan ID:isc_WndAwarie_2_modalMask]  mousing over [Window ID:isc_WndAwarie_2]
    18:15:22.606:TMR7:DEBUG:EventHandler:mousing out of [Window ID:isc_WndAwarie_2]  mousing over [Canvas ID:isc_Canvas_0]
    18:15:22.631:TMR2:DEBUG:EventHandler:mousing out of [Canvas ID:isc_Canvas_0]  mousing over [GridBody ID:isc_ListGrid_2_body]
    18:15:23.024:TMR1:DEBUG:EventHandler:mousing out of [GridBody ID:isc_ListGrid_2_body]  mousing over [DynamicForm ID:isc_DynamicForm_6]
    18:15:23.025:TMR1:DEBUG:Label:isc_Label_1:setRect: {left: 0,
    top: -1000,
    width: undef,
    height: undef}
    18:15:23.054:TMR0:DEBUG:EventHandler:mousing out of [DynamicForm ID:isc_DynamicForm_6]  mousing over [PaneContainer ID:isc_TabSet_2_paneContainer]
    18:15:23.062:TMR3:DEBUG:EventHandler:mousing out of [PaneContainer ID:isc_TabSet_2_paneContainer]  mousing over [VLayout ID:isc_VLayout_3]
    18:15:23.076:TMR6:DEBUG:EventHandler:mousing out of [VLayout ID:isc_VLayout_3]  mousing over [ScreenSpan ID:isc_WndAwarie_2_modalMask]
    18:15:23.882:BLR5:DEBUG:nativeFocus:onblur fired on: [DateChooser ID:isc_DateChooser_0]
    18:15:24.542:TMR7:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_WndAwarie_2_modalMask]
    18:15:34.244:TMR9:DEBUG:EventHandler:mousing over [GridBody ID:isc_ListGrid_2_body]
    18:15:34.838:MOU6:DEBUG:Label:isc_Label_1:setRect: {left: 0,
    top: -1000,
    width: undef,
    height: undef}
    18:16:02.828:TMR9:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_WndAwarie_2_modalMask]
    18:16:03.486:TMR6:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_WndAwarie_2_modalMask]
    18:16:06.358:TMR5:DEBUG:EventHandler:mousing over [ScreenSpan ID:isc_WndAwarie_2_modalMask]
    18:16:09.091:FCS7:DEBUG:nativeFocus:onfocus fired on: [DateChooser ID:isc_DateChooser_0]
    18:16:10.865:KDN8:INFO:EventHandler:keyDown event with Canvas target: [DateChooser ID:isc_DateChooser_0], native target: [DIVElement]{ID:isc_6Z}
    18:16:10.865:KDN8:DEBUG:EventHandler:Event 'keyDown' bubbled to top
    18:16:11.024:KDN9:INFO:EventHandler:keyPress event with Canvas target: [DateChooser ID:isc_DateChooser_0], native target: [DIVElement]{ID:isc_6Z}
    18:16:11.025:KDN9:DEBUG:EventHandler:keyPress not handled natively
    18:16:11.026:KDN9:DEBUG:EventHandler:Event 'keyPress' bubbled to top
    18:16:11.026:KDN9:INFO:EventHandler:keyPress event with Canvas target: [DateChooser ID:isc_DateChooser_0], native target: [DIVElement]{ID:isc_6Z}
    18:16:11.026:KDN9:DEBUG:EventHandler:Event 'keyDown' bubbled to top
    18:16:11.027:KPR0:INFO:EventHandler:keyPress event with Canvas target: [DateChooser ID:isc_DateChooser_0], native target: [DIVElement]{ID:isc_6Z}
    18:16:11.028:KPR0:DEBUG:EventHandler:keyPress not handled natively
    18:16:11.028:KPR0:DEBUG:EventHandler:Event 'keyPress' bubbled to top
    18:16:11.074:BLR1:DEBUG:nativeFocus:onblur fired on: [DateChooser ID:isc_DateChooser_0]
    18:16:11.136:KUP2:INFO:EventHandler:keyUp event with Canvas target: null, native target: [DIVElement]{ID:isc_6Z}
    18:16:11.136:KUP2:INFO:EventHandler:Target Canvas for event 'keyup': [DateChooser ID:isc_DateChooser_0]
    18:16:11.140:KUP2:DEBUG:EventHandler:Event 'keyUp' bubbled to top
    Could somebody tell me why it works in different way ? (I have created simple test case project (base on the same smartgwt and gwt version) with ListGrid displaying dates with FilterEditor and I can get date range dialog box)
    There is some API to control such behaviour ?

    #2
    See DataSource.supportsAdvancedCriteria() - since the DateRangeItem generates AdvancedCriteria, it will not be used if your DataSource is not marked as supporting AdvancedCriteria.

    If this doesn't appear to the problem, we'll need to see a minimal test case that we can run.

    Comment


      #3
      Thanks for reply, to make it clear:
      When datasource has setClientOnly(true), in EditorFilter I will get DateRangeItem (my standalone test case project)
      What was confusing to me - in smartgwt 2.4 (my whole application was based on it) I has RangeDateItem in FilterEditor. I have whole server logic process it.
      Right know I have to call setWillHandleAdvancedCriteria(true) to get DateRangeItem in EditorFilter. Moreover there was change in advancedcriteria structure message in xml. Before was criteria/elem/* for DateRangeItem right know "elem" tag does not exist. So I need to change server side logic.

      Comment


        #4
        We switched the default because another, much larger set of people were confused about AdvancedCriteria being automatically submitted by FilterEditors.

        We don't know of an encoding change - can you show code where this occurs?

        Comment


          #5
          Sorry for a delay, unfortunately I don't have example of xml message before change to smartgwt 2.5, all I have is xpath expression to parse fetch request and get search criteria:
          Code:
          //criteria/fieldName |  //criteria/value | //criteria/elem/fieldName | //criteria/elem/operator | //criteria/elem/value
          now xml request look like this:
          Code:
          <request>
            <data>
              <AwarieDS constructor="AdvancedCriteria">
                <operator>equal</operator>
                <criteria>
                  <fieldName>dataOd</fieldName>
                  <operator>greaterOrEqual</operator>
                  <value>2011-08-29T22:00:00</value>
                </criteria>
                <criteria>
                  <fieldName>dataOd</fieldName>
                  <operator>lessOrEqual</operator>
                  <value>2011-08-30T21:59:59</value>
                </criteria>
                <criteria>
                  <fieldName>dataDo</fieldName>
                  <operator>greaterOrEqual</operator>
                  <value>2011-08-29T22:00:00</value>
                </criteria>
                <criteria>
                  <fieldName>dataDo</fieldName>
                  <operator>lessOrEqual</operator>
                  <value>2011-08-30T21:59:59</value>
                </criteria>
                <criteria>
                  <fieldName>userLogin</fieldName>
                  <operator>startsWith</operator>
                  <value>a</value>
                </criteria>
                <fieldName>userId</fieldName>
                <value>2</value>
              </AwarieDS>
            </data>
            <dataSource>AwarieDS</dataSource>
            <operationType>fetch</operationType>
            <startRow>0</startRow>
            <endRow>30</endRow>
            <textMatchStyle>substring</textMatchStyle>
            <componentId>isc_ListGrid_0</componentId>
            <oldValues />
          </request>
          for a datasource:
          Code:
          public class AwarieDS extends RestDataSource {
          	private static AwarieDS ds;
          	private static Integer userId;
          	public static AwarieDS getInstance(Integer a_userId){
          		if (ds == null){
          			ds = new AwarieDS("AwarieDS");
          		}
          		userId = a_userId;
          		return ds;
          	}
          	public AwarieDS(String id) {
          		setID(id);
          		setDataFormat(DSDataFormat.XML);
          		setDataProtocol(DSProtocol.POSTXML);
          		setDataURL(GWT.getModuleBaseURL() + "Awaria.Service");
          		OperationBinding addOB = new OperationBinding();
          		addOB.setOperationType(DSOperationType.ADD);
          		OperationBinding updateOB = new OperationBinding();
          		updateOB.setOperationType(DSOperationType.UPDATE);
          		OperationBinding removeOB= new OperationBinding();
          		removeOB.setOperationType(DSOperationType.REMOVE);
          		OperationBinding fetchOB= new OperationBinding();
          		fetchOB.setOperationType(DSOperationType.FETCH);
          		setOperationBindings(fetchOB,addOB,removeOB,updateOB);
          		setWillHandleAdvancedCriteria(true);
          		DataSourceIntegerField dsifIdAwarii= new DataSourceIntegerField("idAwarii");
          		dsifIdAwarii.setPrimaryKey(true);
          //		dsifIdAwarii.setHidden(true);
          		DataSourceIntegerField dsifUserId = new DataSourceIntegerField("userId");
          		dsifUserId.setForeignKey("UzytkownikDS.userId");
          		dsifUserId.setHidden(true);
          		DataSourceTextField dstfUserLogin = new DataSourceTextField("userLogin");
          			
          		DataSourceIntegerField dsifIdSlow = new DataSourceIntegerField("idSlow");
          //		dsifIdSlow.setHidden(true);
          		DataSourceTextField dstfNazwaSlow = new DataSourceTextField("nazwaSlow", "Kategoria");
          		
          		DataSourceIntegerField dsifIdElSl = new DataSourceIntegerField("idElSl");
          		dsifIdElSl.setForeignKey("ElementyDS.idElSl");
          //		dsifIdElSl.setHidden(true);
          		DataSourceTextField dstfNazwaElem = new DataSourceTextField("nazwaElem" ,"Element");
          		
          		DataSourceDateTimeField dsdtfDataOd = new DataSourceDateTimeField("dataOd");
          		DataSourceDateTimeField dsdtfDataDo= new DataSourceDateTimeField("dataDo");
          		setFields(dsifIdAwarii, dsifIdSlow, dstfNazwaSlow, dsifIdElSl, dstfNazwaElem,dsifUserId, dstfUserLogin,dsdtfDataOd, dsdtfDataDo);
          		
          	}
          
          	public AwarieDS(JavaScriptObject jsObj) {
          		super(jsObj);
          		// TODO Auto-generated constructor stub
          	}
          	protected Object transformRequest(DSRequest dsRequest){
          		
          		if (dsRequest.getOperationType() == DSOperationType.FETCH){
          			JSOHelper.setAttribute(dsRequest.getData(), "fieldName", "userId");
          			JSOHelper.setAttribute(dsRequest.getData(), "operator", "equal");
          			JSOHelper.setAttribute(dsRequest.getData(), "value", userId);
          			
          		}else{
          			JSOHelper.setAttribute(dsRequest.getData(), "userId", userId);
          		}
          		return super.transformRequest(dsRequest);
          	}
          
          }
          as you can see the xpath expression:
          Code:
          //criteria/elem/fieldName | //criteria/elem/operator | //criteria/elem/value
          is no longer valid because there is no "elem" tag in xml message

          Comment


            #6
            Sorry about this surprise change, but we won't be going back to the old format. However, we will (as part of 3.0) clean up the serialization a little and document exactly what to expect.

            Comment


              #7
              That is ok, new format of xml message is much simpler to parse, but I think have found bug.
              When window with grid with DateRangeItem is created and show, advanced criteria passed in xml message during fetching has a "elem" tag:
              Code:
              <request>
                <data>
                  <AwarieDS constructor="AdvancedCriteria">
                    <operator>equal</operator>
                    <criteria>
                      <_constructor>AdvancedCriteria</_constructor>
                      <operator>and</operator>
                      <criteria>
                        <elem>
                          <fieldName>dataOd</fieldName>
                          <operator>greaterOrEqual</operator>
                          <value>2011-08-31T22:00:00</value>
                        </elem>
                        <elem>
                          <fieldName>dataOd</fieldName>
                          <operator>lessOrEqual</operator>
                          <value>2011-09-01T21:59:59</value>
                        </elem>
                      </criteria>
                    </criteria>
                    <criteria>
                      <fieldName>userLogin</fieldName>
                      <operator>startsWith</operator>
                      <value>a</value>
                    </criteria>
                    <fieldName>userId</fieldName>
                    <value>2</value>
                  </AwarieDS>
                </data>
                <dataSource>AwarieDS</dataSource>
                <operationType>fetch</operationType>
                <startRow>0</startRow>
                <endRow>30</endRow>
                <textMatchStyle>substring</textMatchStyle>
                <componentId>isc_ListGrid_10</componentId>
                <oldValues />
              </request>
              but when I search again (clicking "filter" button in editorfilter) xml message has a new format:
              Code:
              <request>
                <data>
                  <AwarieDS constructor="AdvancedCriteria">
                    <operator>equal</operator>
                    <criteria>
                      <fieldName>dataOd</fieldName>
                      <operator>greaterOrEqual</operator>
                      <value>2011-08-31T22:00:00</value>
                    </criteria>
                    <criteria>
                      <fieldName>dataOd</fieldName>
                      <operator>lessOrEqual</operator>
                      <value>2011-09-01T21:59:59</value>
                    </criteria>
                    <criteria>
                      <fieldName>userLogin</fieldName>
                      <operator>startsWith</operator>
                      <value>a</value>
                    </criteria>
                    <fieldName>userId</fieldName>
                    <value>2</value>
                  </AwarieDS>
                </data>
                <dataSource>AwarieDS</dataSource>
                <operationType>fetch</operationType>
                <startRow>0</startRow>
                <endRow>30</endRow>
                <textMatchStyle>substring</textMatchStyle>
                <componentId>isc_ListGrid_10</componentId>
                <oldValues />
              </request>
              as you can see those are the very same criteria but xml message structure is different.
              From now on, xml message will be always in new strukture. To get old one I have to close window and open it again (window is destroyed and created again)

              Comment


                #8
                Both criteria appear to be invalid ("equal" is not an operatorId that should have sub-criteria). Can you show code that reproduces a change in criteria format, but with valid criteria?

                Comment


                  #9
                  Thanks for a quick reply, look at the datasource in my previous posts. There is transformRequest method which adds operator, fieldname and value tags. In every fetch request I need to pass logged user info. By the way my next question would be how to add additional criteria in transformRequest method to achieve message like:
                  Code:
                  <criteria>
                        <fieldName>userId</fieldName>
                        <operator>equal</operator>
                        <value>2</value>
                  </criteria>
                  (inside criteria tag) - parsing would more simple
                  Last edited by lazinskip; 1 Sep 2011, 12:54.

                  Comment


                    #10
                    I have checked xml message structure without transformRequest method. Results remain the same. First fetch old xml structure, every next in new xml structure.

                    Comment


                      #11
                      Depending on whether a range has been entered for a date, the FilterEditor of a ListGrid may product simple criteria, AdvancedCriteria consisting of one Criterion, or AdvancedCriteria consisting of a logical operator and multiple sub-Criteria.

                      This is correct behavior.

                      The problem is that you are blindly applying 3 attributes to the criteria, without first checking if the inbound criteria is an AdvancedCriteria with a top-level logical operator (which it appears to be in second case). The predictable result is broken criteria.

                      If you getCriteria() and the result is AdvancedCriteria, you can use helpers such as DataSource.combineCriteria() to add an additional Criterion, then supply the final criteria via dsRequest.setData(finalCriteria.getJSObj()).

                      Comment


                        #12
                        Depending on whether a range has been entered for a date, the FilterEditor of a ListGrid may product simple criteria, AdvancedCriteria consisting of one Criterion, or AdvancedCriteria consisting of a logical operator and multiple sub-Criteria.
                        ok, but it doesn't explain why with the same conditions in editorFilter first fetch has different structure than next requests.
                        for the first request xml message:
                        Code:
                        <request>
                          <data>
                            <AwarieDS constructor="AdvancedCriteria">
                              <operator>equal</operator>
                              <criteria>
                                <_constructor>AdvancedCriteria</_constructor>
                                <operator>and</operator>
                                <criteria>
                                  <elem>
                                    <fieldName>dataOd</fieldName>
                                    <operator>greaterOrEqual</operator>
                                    <value>2011-08-31T22:00:00</value>
                                  </elem>
                                  <elem>
                                    <fieldName>dataOd</fieldName>
                                    <operator>lessOrEqual</operator>
                                    <value>2011-09-02T21:59:59</value>
                                  </elem>
                                </criteria>
                              </criteria>
                              <criteria>
                                <_constructor>AdvancedCriteria</_constructor>
                                <operator>and</operator>
                                <criteria>
                                  <elem>
                                    <fieldName>dataDo</fieldName>
                                    <operator>greaterOrEqual</operator>
                                    <value>2011-08-31T22:00:00</value>
                                  </elem>
                                  <elem>
                                    <fieldName>dataDo</fieldName>
                                    <operator>lessOrEqual</operator>
                                    <value>2011-09-02T21:59:59</value>
                                  </elem>
                                </criteria>
                              </criteria>
                              <criteria>
                                <fieldName>userLogin</fieldName>
                                <operator>startsWith</operator>
                                <value>a</value>
                              </criteria>
                              <fieldName>userId</fieldName>
                              <value>2</value>
                            </AwarieDS>
                          </data>
                          <dataSource>AwarieDS</dataSource>
                          <operationType>fetch</operationType>
                          <startRow>0</startRow>
                          <endRow>30</endRow>
                          <textMatchStyle>substring</textMatchStyle>
                          <componentId>isc_ListGrid_2</componentId>
                          <oldValues />
                        </request>
                        every next request (without changing anything in filterEditor) has xml request:
                        Code:
                        <request>
                          <data>
                            <AwarieDS constructor="AdvancedCriteria">
                              <operator>equal</operator>
                              <criteria>
                                <fieldName>dataOd</fieldName>
                                <operator>greaterOrEqual</operator>
                                <value>2011-08-31T22:00:00</value>
                              </criteria>
                              <criteria>
                                <fieldName>dataOd</fieldName>
                                <operator>lessOrEqual</operator>
                                <value>2011-09-02T21:59:59</value>
                              </criteria>
                              <criteria>
                                <fieldName>dataDo</fieldName>
                                <operator>greaterOrEqual</operator>
                                <value>2011-08-31T22:00:00</value>
                              </criteria>
                              <criteria>
                                <fieldName>dataDo</fieldName>
                                <operator>lessOrEqual</operator>
                                <value>2011-09-02T21:59:59</value>
                              </criteria>
                              <criteria>
                                <fieldName>userLogin</fieldName>
                                <operator>startsWith</operator>
                                <value>a</value>
                              </criteria>
                              <fieldName>userId</fieldName>
                              <value>2</value>
                            </AwarieDS>
                          </data>
                          <dataSource>AwarieDS</dataSource>
                          <operationType>fetch</operationType>
                          <startRow>0</startRow>
                          <endRow>30</endRow>
                          <textMatchStyle>substring</textMatchStyle>
                          <componentId>isc_ListGrid_2</componentId>
                          <oldValues />
                        </request>
                        as I have mentioned removing transformRequest method from my code doesn't change this behaviour

                        Comment


                          #13
                          Yes, this is the criteria *after you've applied random properties to it*. Remove your code and you will see that criteria with the same meaning are passed the first and second time.

                          Comment


                            #14
                            I think we can't understand each other
                            I have removed code and still first request is different from next requests. To be perfectly sure I have created standalone test case.
                            My entry point:

                            Code:
                            public class SgwtListGridFilterEditor implements EntryPoint {
                            	private HLayout hlTlo = new HLayout();
                            		private ListGrid lgDaty = new ListGrid();
                            			private ListGridField lgfIdDaty = new ListGridField("idDaty");
                            			private ListGridField lgfDataOd = new ListGridField("dataOd");
                            			private ListGridField lgfDataDo = new ListGridField("dataDo");
                            
                            	/**
                            	 * This is the entry point method.
                            	 */
                            	public void onModuleLoad() {
                            		DateUtil.setShortDatetimeDisplayFormatter(new DateDisplayFormatter() {
                            			
                            			@Override
                            			public String format(Date date) {
                            				DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");
                            				
                            				return dtf.format(date);
                            			}
                            		});
                            		DateUtil.setDateInputFormat("YMD");
                            		DateUtil.setDateParser(new DateParser() {
                            			
                            			@Override
                            			public Date parse(String dateString) {
                            				DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");
                            				Date wynik = dtf.parse(dateString);
                            				return wynik;
                            			}
                            		});
                            		hlTlo.setSize("100%", "100%");
                            		hlTlo.setShowEdges(true);
                            			lgDaty.setDataSource(DatyDS.getInstance());
                            			lgDaty.setAutoFetchData(false);
                            			lgDaty.setShowFilterEditor(true);
                            			lgDaty.setCanMultiSort(false);
                            			lgDaty.setCanEdit(true);
                            				lgfIdDaty.setWidth("10%");
                            				
                            				lgfDataOd.setWidth("45%");
                            				lgfDataDo.setWidth("45%");
                            			lgDaty.setFields(lgfIdDaty, lgfDataOd, lgfDataDo);
                            		hlTlo.addMember(lgDaty);	
                            		hlTlo.draw();
                            
                            	}
                            }
                            my datasource
                            Code:
                            public class DatyDS extends RestDataSource {
                            	private static DatyDS datyDs;
                            	public static DatyDS getInstance(){
                            		if (datyDs == null){
                            			datyDs = new DatyDS("datyDS");
                            		}
                            		return datyDs;
                            	}
                            	public DatyDS(String id) {
                            		super();
                            		setID(id);
                            		setDataFormat(DSDataFormat.XML);
                            		setDataProtocol(DSProtocol.POSTXML);
                            		setDataURL("/DatyDs.xml");
                            		OperationBinding addOB = new OperationBinding();
                            		addOB.setOperationType(DSOperationType.ADD);
                            		OperationBinding updateOB = new OperationBinding();
                            		updateOB.setOperationType(DSOperationType.UPDATE);
                            		OperationBinding removeOB= new OperationBinding();
                            		removeOB.setOperationType(DSOperationType.REMOVE);
                            		OperationBinding fetchOB= new OperationBinding();
                            		fetchOB.setOperationType(DSOperationType.FETCH);
                            		setOperationBindings(fetchOB,addOB,removeOB,updateOB);
                            		setRecordXPath("/Lista/rekord");
                            		DataSourceIntegerField dsifIdDaty = new DataSourceIntegerField("idDaty", "Nr rekordu");
                            		dsifIdDaty.setPrimaryKey(true);
                            		DataSourceDateTimeField dsdtfDataOd = new DataSourceDateTimeField("dataOd");
                            		DataSourceDateTimeField dsdtfDataDo = new DataSourceDateTimeField("dataDo");
                            		setFields(dsifIdDaty,dsdtfDataOd, dsdtfDataDo);
                            		setWillHandleAdvancedCriteria(true);
                            		
                            	}
                            	protected Object transformRequest(DSRequest dsRequest){
                            	
                            	if (dsRequest.getOperationType() == DSOperationType.FETCH){
                            		System.out.println(xmlSerialize(dsRequest.getData()));
                            	}
                            	return super.transformRequest(dsRequest);
                            }
                            xml file served by web server:
                            Code:
                            <?xml version="1.0" encoding="UTF-8"?>
                            <Lista>
                            	<rekord>
                            		<idDaty>1</idDaty>
                            		<dataOd>2011-08-01 10:24:56</dataOd>
                            		<dataDo>2011-08-02 11:14:56</dataDo>
                            	</rekord>
                            	<rekord>
                            		<idDaty>2</idDaty>
                            		<dataOd>2011-08-02 11:34:11</dataOd>
                            		<dataDo>2011-08-05 14:11:34</dataDo>
                            	</rekord>
                            	<rekord>
                            		<idDaty>3</idDaty>
                            		<dataOd>2011-08-06 17:56:23</dataOd>
                            	</rekord>
                            </Lista>
                            first request:
                            Code:
                            <datyDS constructor="AdvancedCriteria">
                                <operator>and</operator>
                                <criteria>
                                	<_constructor>AdvancedCriteria</_constructor>
                                	<operator>and</operator>
                                	<criteria>
                                		<elem>
                                			<fieldName>dataOd</fieldName>
                                			<operator>greaterOrEqual</operator>
                                			<value>2011-09-03T22:00:00</value>
                                		</elem>
                                		<elem>
                                			<fieldName>dataOd</fieldName>
                                			<operator>lessOrEqual</operator>
                                			<value>2011-09-05T21:59:59</value>
                                		</elem>
                                	</criteria>
                                </criteria>
                                <criteria>
                                	<_constructor>AdvancedCriteria</_constructor>
                                	<operator>and</operator>
                                	<criteria>
                                		<elem>
                                			<fieldName>dataDo</fieldName>
                                			<operator>greaterOrEqual</operator>
                                			<value>2011-09-04T22:00:00</value>
                                		</elem>
                                		<elem>
                                			<fieldName>dataDo</fieldName>
                                			<operator>lessOrEqual</operator>
                                			<value>2011-09-06T21:59:59</value>
                                		</elem>
                                	</criteria>
                                </criteria>
                            </datyDS>
                            next request:
                            Code:
                            <datyDS constructor="AdvancedCriteria">
                                <operator>and</operator>
                                <criteria>
                                	<fieldName>dataOd</fieldName>
                                	<operator>greaterOrEqual</operator>
                                	<value>2011-09-03T22:00:00</value>
                                </criteria>
                                <criteria>
                                	<fieldName>dataOd</fieldName>
                                	<operator>lessOrEqual</operator>
                                	<value>2011-09-05T21:59:59</value>
                                </criteria>
                                <criteria>
                                	<fieldName>dataDo</fieldName>
                                	<operator>greaterOrEqual</operator>
                                	<value>2011-09-04T22:00:00</value>
                                </criteria>
                                <criteria>
                                	<fieldName>dataDo</fieldName>
                                	<operator>lessOrEqual</operator>
                                	<value>2011-09-06T21:59:59</value>
                                </criteria>
                            </datyDS>
                            as you can see there is no any attempts to change criteria passed from framework but still requests differ.
                            I don't understand why in first request there are "elem tags and in second request structure is simpler.

                            Comment


                              #15
                              The two criteria are equivalent, the second is a valid simplification of the structure of the first, not a difference in serialization.

                              As far as <elem> vs absence of <elem>, as we previously indicated we will be documenting and normalizing the XML serialized structure of AdvancedCriteria - as it stands you can simply ignore the <elem> tags.

                              Comment

                              Working...
                              X