Announcement

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

    Data source time type

    Hello all,

    While trying to use SmartGWT in an application, I found a use case in which I must select the time from a ListGrid, but the date type of the DataSource doesn't recognize it, always saving the date as 1st of Jan 1970.

    Is there a way in which I can use sql type time with smartGWT?
    Thank you in advance,
    Driftdone

    #2
    try "datetime"

    Comment


      #3
      I tried using that, it renders correctly the information from DB but I cannot send info to DB, when I'm trying to edit the gridField.
      I tried inserting "00:00:00" but it says: "must be a whole number"
      I tried inserting "Thursday, January 01, 1970 12:00:00 AM" but it says: "
      Code:
       RequestContext - dsRequest.execute() failed: 
      java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
      	at com.isomorphic.util.DefaultValidators$isDate.validate(DefaultValidators.java:407)
      	at com.isomorphic.util.DefaultValidators.processValidator(DefaultValidators.java:264)
      	at com.isomorphic.util.DefaultValidators.validateField(DefaultValidators.java:230)
      	at com.isomorphic.datasource.SimpleType.validateValue(SimpleType.java:89)
      	at com.isomorphic.datasource.SimpleType.create(SimpleType.java:65)
      	at com.isomorphic.datasource.BasicDataSource.validateFieldValue(BasicDataSource.java:1046)
      	at com.isomorphic.datasource.BasicDataSource.validateFieldValue(BasicDataSource.java:993)
      	at com.isomorphic.datasource.BasicDataSource.toRecord(BasicDataSource.java:671)
      	at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:609)
      	at com.isomorphic.datasource.BasicDataSource.toRecords(BasicDataSource.java:572)
      	at com.isomorphic.datasource.DataSource.validateDSRequest(DataSource.java:1794)
      	at com.isomorphic.datasource.DataSource.validateDSRequest(DataSource.java:1743)
      	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1041)
      	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
      	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
      	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
      	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1443)
      	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:173)
      	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:130)
      	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:95)
      	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
      	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:324)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:205)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
      "

      Do you know a good way for setting correct time?

      Thank you,
      Driftdone

      Comment


        #4
        my esp is weak... i've no idea what your code is doing. :) also read the manual and look at the showcase examples.

        sounds to me like you've messed up the datasource/listgrid definitions. start from an example that does what you're trying to do and hack from there...

        (i'm just a user of smartgwt)

        Comment

        Working...
        X