Announcement

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

    #16
    Apologies for the delay - we're looking into this carefully - it is not expected that attributes like your sessionId, applied as dataSource.defaultParams, would end up in dsRequest.data, and this is not the documented behavior.

    We'll check on the cause and update here with the correct way forward.

    Comment


      #17
      There's good news and bad - the good news is that we got to the bottom of your sessionId issue - there was a framework bug and it's been fixed.

      The bug was that defaultParams applied via DataSource or OperationBinding was being incorrectly combined with the criteria of a DSRequest, instead of being combined with its other HTTP params.

      So, the bad news is that your current code for managing your sessionId across server trips will no longer work - once you have a fixed build, your server code will need to use servletRequest.getParameter(), instead of request.getCriteria().

      See the doc for RPCRequest.params, which already mentions this.
       

      Comment


        #18
        Okay thank you. Which build will the fix be in?

        Comment


          #19
          September 19

          Comment


            #20
            Note that, in the meantime (or more generally), you could apply your sessionId to the system-wide RPCManager.actionURL if you always want it to be set with all calls.

            Comment


              #21
              SmartClient Version: v11.0p_2016-05-28/Pro Deployment (built 2016-05-28)

              It looks like the dublicate server fetch is back for the timeline.

              Test Case:
              Code:
                  private Layout getLayout() {
                      HLayout mainLayout = new HLayout();
                      mainLayout.addMember(getTimeline());
                      
                      return mainLayout;
                  }
                  
                  public Timeline getTimeline()
                  {
                      DataSource ds = DataSource.get("test");
                      
                      final Timeline timeline = new Timeline();  
                      timeline.setHeight100();
                      timeline.setLanes(TimelineLaneData.getRecords());  
                      timeline.setDataSource(ds);
                      timeline.setAutoFetchData(true);
                      return timeline;
                  }
                  
                  public static class TimelineLaneData {  
                        
                      private static Lane[] records;  
                    
                      public static Lane[] getRecords() {  
                          if (records == null) {  
                              records = getNewRecords();  
                          }  
                          return records;  
                      }  
                    
                      public TimelineLaneData() {  
                      }  
                    
                      public static Lane[] getNewRecords() {  
                          Lane[] lanes = new Lane[]{  
                          getLane("charlesMadigen", "Charles Madigen", "Managers"),  
                          getLane("tamaraKane", "Tamara Kane", "Developers"),  
                          getLane("darcyFeeney", "Darcy Feeney", "Managers"),  
                          getLane("kaiKong", "Kai Kong", "Developers"),  
                          getLane("shelleyFewel", "Shelley Fewel", "Managers"),  
                          getLane("garretMonroe", "Garret Monroe", "Developers")  
                          };  
                          return lanes;  
                      }  
                    
                      private static Lane getLane(String name, String title, String devGroup) {  
                          Lane lane = new Lane(name, title);  
                          lane.setAttribute("devGroup", devGroup);  
                          return lane;  
                      }  
                  }
              Code:
              <DataSource
                  ID="test"
                  serverConstructor="TestServlet">
                   <fields>
                      <field name="eventId"        type="sequence"    primaryKey="true" hidden="true"    />
                      <field name="startDate"        type="datetime"    />
                      <field name="endDate"        type="datetime"    />
                      <field name="lane"            type="text"    />
                      <field name="undefined"        type="any"    />
                   </fields>
              </DataSource>
              Developer console: Click image for larger version

Name:	double_fetch2.PNG
Views:	14
Size:	76.2 KB
ID:	240909

              Comment


                #22
                Have you had a chance to look at this?
                I just updated to SmartClient Version: v11.0p_2016-11-13/Pro Deployment (built 2016-11-13) and I am still getting double fetch requests from my timelines.

                Comment


                  #23
                  This has been fixed and a framework autotest added to prevent future regressions here - please retest with a build dated November 12 or later.

                  Comment


                    #24
                    Well as I said I just tested with November 13 nightly and I am still getting the double fetch request.

                    Comment


                      #25
                      Sorry, we showed the wrong date - we only fixed the problem today, so it will be in tomorrow's builds - November 16.

                      Comment


                        #26
                        Hello,

                        i am running 5.1-p20161119, and for me it is not fixed.

                        When i now call fetchdata on my timeline (same code as when i started this thread last year), i see 3 fetch calls being fired!

                        i have tried with autofetch as well as timeline.fetchdata

                        It it not fixed in the version i quote above?


                        If i comment out fetchdata, server is not being called at all. If i put back the row, three calls are made to the server:

                        Firebug request and response data for your reference below. Please advice, this is not so good for us.

                        Code:
                        <transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">4</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"><_constructor>AdvancedCriteria</_constructor><operator>and</operator><criteria xsi:type="xsd:List"><elem xsi:type="xsd:Object"><fieldName>inTime</fieldName><operator>lessThan</operator><value xsi:type="xsd:datetime">2016-12-29T22:59:59.999</value></elem><elem xsi:type="xsd:Object"><fieldName>outTime</fieldName><operator>greaterThan</operator><value xsi:type="xsd:datetime">2016-11-28T23:00:00.000</value></elem></criteria></criteria><operationConfig xsi:type="xsd:Object"><dataSource>schedule</dataSource><repo xsi:nil="true"/><operationType>fetch</operationType><textMatchStyle>exact</textMatchStyle></operationConfig><startRow xsi:type="xsd:long">0</startRow><endRow xsi:type="xsd:long">200</endRow><componentId>isc_NubaScheduleTimeline_0</componentId><appID>builtinApplication</appID><operation>schedule_fetch</operation><oldValues xsi:type="xsd:Object"><_constructor>AdvancedCriteria</_constructor><operator>and</operator><criteria xsi:type="xsd:List"><elem xsi:type="xsd:Object"><fieldName>inTime</fieldName><operator>lessThan</operator><value xsi:type="xsd:datetime">2016-12-29T22:59:59.999</value></elem><elem xsi:type="xsd:Object"><fieldName>outTime</fieldName><operator>greaterThan</operator><value xsi:type="xsd:datetime">2016-11-28T23:00:00.000</value></elem></criteria></oldValues></elem></operations></transaction>
                        
                        <transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">6</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"><operator>and</operator><_constructor>AdvancedCriteria</_constructor><criteria xsi:type="xsd:List"><elem xsi:type="xsd:Object"><fieldName>inTime</fieldName><operator>lessThan</operator><value xsi:type="xsd:datetime">2016-12-29T22:59:59.998</value></elem><elem xsi:type="xsd:Object"><fieldName>outTime</fieldName><operator>greaterThan</operator><value xsi:type="xsd:datetime">2016-11-28T23:00:00.000</value></elem></criteria></criteria><operationConfig xsi:type="xsd:Object"><dataSource>schedule</dataSource><repo xsi:nil="true"/><operationType>fetch</operationType><textMatchStyle>exact</textMatchStyle></operationConfig><startRow xsi:type="xsd:long">0</startRow><endRow xsi:type="xsd:long">200</endRow><componentId>isc_NubaScheduleTimeline_0</componentId><appID>builtinApplication</appID><operation>schedule_fetch</operation><oldValues xsi:type="xsd:Object"><operator>and</operator><_constructor>AdvancedCriteria</_constructor><criteria xsi:type="xsd:List"><elem xsi:type="xsd:Object"><fieldName>inTime</fieldName><operator>lessThan</operator><value xsi:type="xsd:datetime">2016-12-29T22:59:59.998</value></elem><elem xsi:type="xsd:Object"><fieldName>outTime</fieldName><operator>greaterThan</operator><value xsi:type="xsd:datetime">2016-11-28T23:00:00.000</value></elem></criteria></oldValues></elem></operations></transaction>
                        
                        <transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">7</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"><operator>and</operator><_constructor>AdvancedCriteria</_constructor><criteria xsi:type="xsd:List"><elem xsi:type="xsd:Object"><fieldName>inTime</fieldName><operator>lessThan</operator><value xsi:type="xsd:datetime">2016-12-29T22:59:59.998</value></elem><elem xsi:type="xsd:Object"><fieldName>outTime</fieldName><operator>greaterThan</operator><value xsi:type="xsd:datetime">2016-11-28T23:00:00.000</value></elem></criteria></criteria><operationConfig xsi:type="xsd:Object"><dataSource>schedule</dataSource><repo xsi:nil="true"/><operationType>fetch</operationType><textMatchStyle>exact</textMatchStyle></operationConfig><startRow xsi:type="xsd:long">0</startRow><endRow xsi:type="xsd:long">200</endRow><componentId>isc_NubaScheduleTimeline_0</componentId><appID>builtinApplication</appID><operation>schedule_fetch</operation><oldValues xsi:type="xsd:Object"><operator>and</operator><_constructor>AdvancedCriteria</_constructor><criteria xsi:type="xsd:List"><elem xsi:type="xsd:Object"><fieldName>inTime</fieldName><operator>lessThan</operator><value xsi:type="xsd:datetime">2016-12-29T22:59:59.998</value></elem><elem xsi:type="xsd:Object"><fieldName>outTime</fieldName><operator>greaterThan</operator><value xsi:type="xsd:datetime">2016-11-28T23:00:00.000</value></elem></criteria></oldValues></elem></operations></transaction>
                        
                        
                        //isc_RPCResponseStart-->[{affectedRows:0,data:[...],endRow:2,invalidateCache:false,isDSResponse:true,operationType:"fetch",startRow:0,status:0,totalRows:2}]//isc_RPCResponseEnd
                        //isc_RPCResponseStart-->[{affectedRows:0,data:[...],endRow:2,invalidateCache:false,isDSResponse:true,operationType:"fetch",startRow:0,status:0,totalRows:2}]//isc_RPCResponseEnd
                        //isc_RPCResponseStart-->[{affectedRows:0,data:[...],endRow:2,invalidateCache:false,isDSResponse:true,operationType:"fetch",startRow:0,status:0,totalRows:2}]//isc_RPCResponseEnd

                        Comment


                          #27
                          This change wasn't ported back to 5.1, because the issue of an autoFetchData:true Timeline fetching more than once at initial draw() is not reproducible in 5.1 for us - we have some autotests which test exactly those circumstances.

                          This might imply that order of operations, for example, in your timeline setup code is causing it to be draw()n before it's setup is complete.

                          Can you show a test-case that demonstrates your DS and timeline setup?
                          Last edited by Isomorphic; 29 Nov 2016, 06:08.

                          Comment


                            #28
                            I just switched out the jars from 5.1-p2016-11-10 to the old 5.0-p2015-09-06, and can confirm it works as expected with that version. When i use 5.1, i get 2 calls as mentioned.'


                            Here is my timeline class:
                            Code:
                            public class MyScheduleTimeline extends GenericTimeline{
                            
                                public static final int[] workdays = {1,2,3,4,5,6,7};
                            
                                private HeaderLevel[] dayHeaderLevels;
                                private HeaderLevel[] hourHeaderLevels;
                            
                                public MyScheduleTimeline(final DataSource ds, final DataSource laneDs, boolean canEditEvents, String helpUrl) {
                                    super(laneDs, MyClientServerConstants.FIELD_FULLNAME, true);
                                    Date begin = new Date();
                                    Date end = new Date();
                                    CalendarUtil.addMonthsToDate(end, 1);
                                    setStartDate(begin);
                                    setEndDate(end);
                                    setShowLaneRollOver(true);
                                    setShowQuickEventDialog(false);
                            
                            
                                    setWorkdays(workdays);
                                    setDisableWeekends(false);
                                    setCanEditEvents(canEditEvents);
                            
                                    setCanEditLane(false);
                                    setShowEventDescriptions(true);
                                    setLaneNameField(MyClientServerConstants.FIELD_REPORTERID);//this is what must match the "id" values for the lane data
                                    setDataPageSize(200);
                            
                                    setStartDateField(MyCommonConstants.FIELD_INTIME);
                                    setEndDateField(MyCommonConstants.FIELD_OUTTIME);
                                    setNameField(MyClientServerConstants.FIELD_LOCNAME);
                                    setShowEventDescriptions(true);
                                    setDescriptionField(MyCommonConstants.FIELD_NOTE);
                                    setMinLaneWidth(130);
                                    setTimeFormatter(TimeDisplayFormat.TOSHORTPADDED24HOURTIME);
                            
                                    setHeaderLevels(getDayHeaderLevels());
                                    setLaneFields(new ListGridField[]{new ListGridField("title", MyCommonConstants.constants.reportUser(), MyCommonConstants.FIELD_WIDTH_REPORTERNAME)});
                                    setLaneEventPadding(2);
                                    setEventStyleName("MyEventWindow");
                                    loadLanes();
                                    setCanRemoveEvents(false);
                            
                                    setDataSource(ds);
                                    setAutoFetchData(true);
                                }
                            
                            
                                public IButton getButton(String ID, String title, final HeaderLevel[] headerLevels, final TimeUnit unit, final Integer columnCount) {
                                    IButton button = FieldUtils.createButton(title, null);
                                    button.setID(ID);
                                    button.setAutoFit(true);
                                    button.addClickHandler(new ClickHandler() {
                                        @Override
                                        public void onClick(ClickEvent event) {
                                            setResolution(headerLevels, unit, columnCount, 1);
                                        }
                                    });
                                    return button;
                                }
                            
                                public HeaderLevel[] getDayHeaderLevels(){
                            
                                    if(dayHeaderLevels != null) return dayHeaderLevels;
                            
                                    HeaderLevel week = new HeaderLevel(TimeUnit.WEEK);
                                    week.setHeaderWidth(100);
                                    HeaderLevel day = new HeaderLevel(TimeUnit.DAY);
                                    day.setTitleFormatter(new HeaderLevelTitleCustomizer() {
                                        @Override
                                        public String getTitle(HeaderLevel headerLevel, Date startDate, Date endDate, String defaultValue, Calendar calendar) {
                                            return MyCommonConstants.scheduleDateHeaderFormat.format(startDate);
                                        }
                                    });
                                    day.setHeaderWidth(100);
                                    dayHeaderLevels = new HeaderLevel[]{
                                        week, day
                                    };
                            
                                    return dayHeaderLevels;
                                }
                            
                                public HeaderLevel[] getHourHeaderLevels() {
                            
                                    if (hourHeaderLevels != null) return hourHeaderLevels;
                            
                                    HeaderLevel day = new HeaderLevel(TimeUnit.DAY);
                                    day.setTitleFormatter(new HeaderLevelTitleCustomizer() {
                                        @Override
                                        public String getTitle(HeaderLevel headerLevel, Date startDate, Date endDate, String defaultValue, Calendar calendar) {
                                            return MyCommonConstants.scheduleDateHeaderFormat.format(startDate);
                                        }
                                    });
                                    day.setHeaderWidth(100);
                                    HeaderLevel hour = new HeaderLevel(TimeUnit.HOUR);
                                    hour.setHeaderWidth(100);
                                    hourHeaderLevels = new HeaderLevel[]{
                                        day, hour
                                    };
                            
                                    return hourHeaderLevels;
                                }
                            
                                @Override
                                public String getDateLabelText(String s, Date date, Date date1) {
                                    if(CalendarUtil.isSameDate(date, date1)){
                                        return MyCommonConstants.scheduleDateFormat.format(date);
                                    }
                            
                                    return MyCommonConstants.scheduleDateFormat.format(date) + " " + MyCommonConstants.constants.calendarThrough() + " " + MyCommonConstants.scheduleDateFormat.format(date1);
                                }
                            Datasource:
                            Code:
                             <?xml version="1.0" encoding="UTF-8"?> <DataSource ID="schedule" serverType="generic">        <fields>                <field name="id" type="sequence" hidden="true" primaryKey="true"/>         <field name="fullname" type="text" title="Användare" hidden="false" required="false"                valueXPath="reporter/fullname"/>         <field name="locName" type="text" title="Plats" hidden="false" required="false"                valueXPath="location/name"/>         <field name="reporterId" type="integer" title="Användare" foreignKey="user.id" displayField="fullname" required="false" combo="true"/>         <field name="locationId" type="integer" title="Plats" foreignKey="location.id" displayField="name" required="true" combo="true"/>         <field name="inTime" type="datetime" title="Starttid" required="true" minuteIncrement="10"/>         <field name="outTime" type="datetime" title="Sluttid" required="true" minuteIncrement="15"/>         <field name="note" type="text" title="Anteckning" length="512" required="false"/>         <field name="reminderType" type="enum" title="Påminnelse" required="true" defaultValue="1">         <valueMap>             <value ID="0">Ingen</value>             <value ID="1">5 minuter efter</value>             <value ID="2">15 Minuter innan</value>             <value ID="3">30 Minuter innan</value>             <value ID="4">60 Minuter innan</value>         </valueMap>         </field>         <field name="createdByName" type="text" title="Skapad av" hidden="false" required="false"                valueXPath="createdByName/fullname"/>          <field name="createdOn" type="datetime" title="Skapad tid" required="false"/>         <field name="editedTime" type="datetime" title="Senast ändrad tid" required="false"/>         <field name="editedByName" type="text" title="Ändrad av" hidden="false" required="false"                valueXPath="editedByName/fullname"/>      </fields>            <operationBindings>         <operationBinding operationType="fetch" operationId="user">             <serverMethod>fetchForUser</serverMethod>         </operationBinding>     </operationBindings>             <serverObject lookupStyle="spring" bean="scheduleWebService"/>         </DataSource>

                            Comment


                              #29
                              If, instead of using setStartDate() and setEndDate(), you use a single call to setTimelineRange(), and call it after setHeaderLevels(), does that change what you see?

                              Comment


                                #30
                                OK, i tried the following:

                                1. just moved the setstartdate/setenddate to after the setheaderlevels. This had no effect.

                                2. Changed the code to setTimeLineRange(begin, end). This resulted in an error in the web browser:

                                Code:
                                Error :Cannot change configuration property 'laneFields' to [Lcom.smartgwt.client.widgets.grid.ListGridField;@2bf20001 now that component isc_NubaScheduleTimeline_0 has been created.
                                Which seems strange, since all of this code is performed in the constructor.

                                EDIT: I now tried moving the settimelinerange all the way down above the setDataSource, but it doesn't matter, it only changes the error to whatever is after setTimelineRange

                                Code:
                                Error :Cannot change configuration property 'autoFetchData' to true now that component isc_NubaScheduleTimeline_0 has been created.
                                EDIT2: I moved the settimeline all the way down AFTER setautofetch and setdatasource. I then got no exception, but still 2 fetches, so no that doesn't work either.


                                Below the changed class constructor for reference:

                                Code:
                                public class NubaScheduleTimeline extends GenericTimeline{
                                
                                    public static final int[] workdays = {1,2,3,4,5,6,7};
                                
                                    private HeaderLevel[] dayHeaderLevels;
                                    private HeaderLevel[] hourHeaderLevels;
                                
                                    public NubaScheduleTimeline(final DataSource ds, final DataSource laneDs, boolean canEditEvents, String helpUrl) {
                                        super(laneDs, NubaClientServerConstants.FIELD_FULLNAME, true);
                                        setShowLaneRollOver(true);
                                        setShowQuickEventDialog(false);
                                
                                
                                        setWorkdays(workdays);
                                        setDisableWeekends(false);
                                        setCanEditEvents(canEditEvents);
                                
                                        setCanEditLane(false);
                                        setShowEventDescriptions(true);
                                        setLaneNameField(NubaClientServerConstants.FIELD_REPORTERID);//this is what must match the "id" values for the lane data
                                        setDataPageSize(200);
                                
                                        setStartDateField(NubaCommonConstants.FIELD_INTIME);
                                        setEndDateField(NubaCommonConstants.FIELD_OUTTIME);
                                        setNameField(NubaClientServerConstants.FIELD_LOCNAME);
                                        setShowEventDescriptions(true);
                                        setDescriptionField(NubaCommonConstants.FIELD_NOTE);
                                        setMinLaneWidth(130);
                                        setTimeFormatter(TimeDisplayFormat.TOSHORTPADDED24HOURTIME);
                                
                                        setHeaderLevels(getDayHeaderLevels());
                                
                                        Date begin = new Date();
                                        Date end = new Date();
                                        CalendarUtil.addMonthsToDate(end, 1);
                                        //setStartDate(begin);
                                        //setEndDate(end);
                                        setTimelineRange(begin, end);
                                
                                        setLaneFields(new ListGridField[]{new ListGridField("title", NubaCommonConstants.constants.reportUser(), NubaCommonConstants.FIELD_WIDTH_REPORTERNAME)});
                                        setLaneEventPadding(2);
                                        setEventStyleName("nubaEventWindow");
                                        loadLanes();
                                        setCanRemoveEvents(false);
                                
                                        setDataSource(ds);
                                        setAutoFetchData(true);
                                    }
                                Last edited by mathias; 29 Nov 2016, 08:26.

                                Comment

                                Working...
                                X