Announcement

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

    Connect calendar to an database

    I want to bind my smartgwt calendar event datasource with my mongo database.
    1. How can I save an new event ?
    2. How should I connect the CRUD operations api (which datasource object suppose to operate with) to the db?
    3. Can somebody explain the question in general, what should be done to make smartgwt datasource dependent to some DB?

    #2
    Nobody?

    Comment


      #3
      Hi nasdaq,

      did you already read the Quick Start Guide? I'd suggest to start there.
      I don't know if CRUD will be straight forward with a database that does not support SQL(?). Most likely you'll need the LGPL version of SmartGWT and have to write the server part of your application yourself.

      Best regards
      Blama

      Comment


        #4
        Originally posted by Blama View Post
        Hi nasdaq,

        did you already read the Quick Start Guide? I'd suggest to start there.
        I don't know if CRUD will be straight forward with a database that does not support SQL(?). Most likely you'll need the LGPL version of SmartGWT and have to write the server part of your application yourself.

        Best regards
        Blama
        Hi Blama,

        Thanks for your reply, now I have different issue. How can I bound my Calendar to a DataSource at all. I've made a custom DataSource and assign that to my calendar

        CalendarEventDataSource calendarEventDataSource = new CalendarEventDataSource();

        Calendar calendar = new Calendar();
        calendar.setDataSource(calendarEventDataSource);
        calendar.setAutoFetchData(true);

        But when i get to executeAdd

        @Override
        protected void executeAdd(final String requestId, final DSRequest request, final DSResponse response) {
        // TODO Auto-generated method stub
        JavaScriptObject data = request.getData();
        CalendarEvent calEvent= new CalendarEvent(data);
        CalendarEventDto calendarEventDto = new CalendarEventDto();
        copyValues(calEvent, calendarEventDto);
        service.createEvent(calendarEventDto, new AsyncCallback<Void>() { ...........

        my DSRequest seems to be void

        protected void copyValues(CalendarEvent from, CalendarEventDto to) {
        to.setNameField(from.getAttribute("nameField"));
        to.setDescField(from.getAttribute("descField"));
        to.setStartDateField(from.getAttributeAsDate("startDateField"));
        to.setEndDateField(from.getAttributeAsDate("endDateField"));
        }

        What am I doing wrong?

        Comment


          #5
          Hi nasdaq,

          actually I can't help here as I never did I non-SmartGWT-backend application.
          I'd assume that you only need to make the backend and tell the RPCManager the URL, then on the severside handle the incoming data in SmartGWT format.
          Clientside is most likely SmartGWT-only. But best have a look in the Quick Start Guide.

          Best regards
          Blama

          Comment

          Working...
          X