Announcement

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

    SmartGWTEE/GWT RPC call -> java.util.Calendar

    I was trying to do a generic GWT RPC call with the service and async service interfaces on client side and a server side implementation with helper methods that add minutes and hours to a given date object. (GWT API)

    The server methods use java.util.Calendar in order to transform the changes and return a Date object. The reason for that is that the java.util.Calendar is not available on client side, though it's very useful and handy to work with date calculations.

    But the RPC call didn't succeed, do I need to include the gwt-servlet.jar again? Or is there another way in SmartGWTEE to do an RPC call?
    Third question would be, is there a calendar class on client side that has the same functionality as java.util.Calendar?
    I tried Joda Time today but the compilation did not succeed, telling me the source for the DateTime class is missing ...

    Can you give me a suggestion for this?

    Thank you very much.

    #2
    When you have Pro+, don't use GWT-RPC at all. DataSource operations of type="custom" or RPC DMIs (see the DMI Overview) provide this capability with much less code, and can be combined into a single in-order queue of requests via queuing.

    As far as Calendar, what specific function do you need? Core GWT provides DateTimeFormat for flexible formatting.

    Comment


      #3
      It's not only about formatting.
      The problem is the date picker that only sets the date, not the time.

      I have a time SpinnerItem right next to it for entering the hour and minute (for a statistic data sql call - date/time from/to - for hibernate I need a two Date objects that's for sure).

      And some how I must e.g. marry the entered time and date to the dateFrom object to get the milliseconds adjusted correctly -> With the java.util.Calendar that works quite nice calling the setHour and so on methods. I do not want to use the depricated Date methods, I just use Date for initializing with System.currentMilliSeconds and getTime().

      Formatting is no problem, I use the DateUtil class in order to set it up application wide ...

      Comment


        #4
        Actually the easiest way would be having a date picker that has combo boxes at the bottom for entering hours, minutes and seconds in addition.
        By pressing confirm it just should set the entered values to a date object, then calendar calculations in this case are not neccessary.
        Are there plans to extend that control?

        Thank you.

        Comment


          #5
          Yeah, this is a longstanding GWT (not SmartGWT) annoyance, the issue has 321 stars and some discussion of workarounds.

          DateTimeItem provides textual entry of full date and time values, or a DateItem and TimeItem can be used in tandem. If you're interested in a specific date and time picking interface, consider Feature Sponsorship.

          Comment


            #6
            I know, I've read this article already, that's why I tried to use joda-time today, but this should not be the solution I think.

            I'm about to create a showcase for one of our customers still using the evaluation. In case we decide to switch over from JSF to SmartGWT I think we will buy the enterprise edition, also considering the feature sponsorship.

            For now I will cut off the time for presentation to be faster in development with the other presentation features.

            Thanks much for your help!

            Comment


              #7
              Just a last question on this.
              Regarding the graphical stuff (date picker popup including the time selection combo boxes), is that a GWT issue?
              Or is it just about the java.util.Calendar class that has to be supported by GWT?

              Comment


                #8
                It's just java.util.Calendar where GWT support is needed. For something like an enhanced widget, you can just sponsor it with us.

                Comment

                Working...
                X