Announcement

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

    Calendar event shown on top left corner with "Untitled Window" and hangs screeen

    We have been facing issue with adding events in Calendar component. Our calendar is databound and is using RestDataSource for server communication.

    When we add event, server send back the JSON as below:
    Code:
    {
            'response':{
                'status':0,
                'startRow':0,
                'endRow':1,
                'totalRows':1,
                'data':[
                    {
                        'eventId':1,
                        'name':'Food Event',
                        'startDate':'2011-11-03 10:00:00',
                        'endDate':'2011-11-03 14:00:00',
                        'description':'Food Event in Delhi'
                    }
                ]
         }
    }
    Below is the code for Calendar and it associated RestDataSource

    Code:
        isc.RestDataSource.create({
            ID: "eventDS",
            fields:[
                {name:"eventId", primaryKey: true, type: "sequence"},
                {name:"name"},
                {name:"description"},
                {name:"startDate", type: "datetime"},
                {name:"endDate", type: "datetime"}
            ],
            dataFormat:"json",
            addDataURL:"ajax/view/json/calendar/add_event"
        });     
    
        isc.Calendar.create({
            ID: "eventCalendar", 
            dataSource: eventDS,
            autoFetchData: true
        });
    
        isc.VLayout.create({
            members:[
                eventCalendar
            ],
            height:"100%",
            ID:"app_full_section",
            width:"100%",
            autoDraw:true
        })
    Attached is the screenshot of issue along with snapshot of response data received from server in FireBug. Please have a look

    Please help to get this issue resolved. Its kind of urgent for me. I would appreciate help from any corner.

    Gaurav
    Attached Files
    Last edited by gauravd; 3 Nov 2011, 05:43.

    #2
    It should be fixed as of yesterday. See http://forums.smartclient.com/showthread.php?t=17385
    Although I was getting a second event in the corner and it wasn't hanging in any way.

    Comment


      #3
      Thanks ssieb.

      For this issue fix, do we need to download the whole SC pack (nighly build of 3rd Nov) or just ISC_Calendar.js file. If fix is just in file, can you share it over this thread.

      I really appreciate your help.

      Comment


        #4
        I think it's just in that file. But it really depends on what version you have right now whether that file will be compatible or not. As in, if you're using 2.x now, it's almost certainly not. You're probably better off just to get the 3.0 nightly.

        Comment


          #5
          Yeah we tested the nightly ... the issue is fixed in that.
          Thanks for your pointers.

          Gaurav

          Comment


            #6
            ssieb, with nightly fix, its working fine in firefox but still facing the earlier stated issue (event adds on top left corner and screen hangs) in Google Chrome (version 15.0.874.106 m)

            Is there separate fix for chrome?

            Gaurav

            Comment


              #7
              There's no separate version for chrome. I haven't tried it in chrome yet, I normally just use firefox. You could try clearing out the GWT caches to make sure it rebuilds with the new version.

              Comment


                #8
                Issue is still not fixed. I tried again on Firefox with nightly of 3rd Nov, still the calendar event is shown on top left corner. Good part it that now screen does not freeze.

                Attached is the latest snapshot with nightly of 3rd Nov. It also shows the JSON in response to add event.

                Please help.

                Below is the smartclient for calendar.
                Code:
                    isc.RestDataSource.create({
                        ID: "app_admin_calendar_DS",
                        fields:[
                            {name:"eventId", primaryKey: true, type: "sequence"},
                            {name:"name"},
                            {name:"description"},
                            {name:"startDate", type: "datetime"},
                            {name:"endDate", type: "datetime"}
                        ],
                        dataFormat:"json",
                        addDataURL:"ajax/view/json/cal_event/add"
                    });     
                
                    isc.Calendar.create({
                        ID: "app_admin_calendar", 
                        height:"100%",
                        width:"100%",
                        dataSource: app_admin_calendar_DS
                    });
                
                
                    isc.VLayout.create({
                        members:[
                            "app_admin_calendar",
                        ],
                        height:"100%",
                        width:"100%",
                        ID:"app_admin_cal_top_section",
                        autoDraw:true
                    })
                Attached Files

                Comment


                  #9
                  Then this is a different issue than what I had. Getting the data was never a problem. The only problem I had was that using addEvent to create new events caused the extra corner event. And that has been fixed now. Sorry, I don't have any other suggestions for your issue.

                  Comment


                    #10
                    Technically, this is a usage error: the Calendar hasn't been allowed to fetch and hasn't been given a dataset, so it has nowhere to put the data. You can either call fetchData() to cause the Calendar to fetch, or if you don't want it to show existing saved events (somewhat strange) you can explicitly provide it an empty ResultSet:

                    Code:
                        isc.Calendar.create({
                            ID: "app_admin_calendar", 
                            height:"100%",
                            width:"100%",
                            dataSource: app_admin_calendar_DS,
                            data: isc.ResultSet.create({ 
                                  dataSource: app_admin_calendar_DS, 
                                  initialData:[] 
                            })
                        });
                    However, it would be reasonable for the Calendar to automatically create an empty ResultSet when used this way, and we may enhance it to do so in the future.

                    Comment


                      #11
                      Thanks ssieb and Isomorphic for your help.
                      Isomorphic, your solution worked for me ... thanks. I think it would be good to have default blank datasource associated with every created data bound component. many user might use data bound components to add/edit data without initial fetch ... very possible at least in case of calendar.

                      Isomorphic, may I also bring your attention to my below query (again related to calender). It has been there for few days without anyone responding to it. Its also kind of urgent for me.
                      http://forums.smartclient.com/showthread.php?t=19527

                      I sincerely appreciate your help.

                      Gaurav

                      Comment


                        #12
                        I have the same problem, but I'm working with SmartGWT 2.5, and when I put one of the 3.0 nightly builds, it gives me a lot of different errors I wonder which jar file should I download with this bug fixed.

                        Thanks in advance.

                        Comment


                          #13
                          Don't try to replace individual .jars, use the installation instructions.

                          Comment


                            #14
                            Originally posted by Isomorphic
                            Don't try to replace individual .jars, use the installation instructions.
                            sorry, can you point me where I can find the instructions, I look for them but I couldnīt find it. Thanks.

                            Comment


                              #15
                              If you unzip the the file you downloaded, there are two jar files.
                              You don't mention your development environment, but with Eclipse I just remove the old jars from the build path and add the new ones. You also don't mention what kind of errors you get, so I have no way of helping you more.

                              Comment

                              Working...
                              X