Announcement

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

    timer ui

    Is this possible in SmartClient?

    http://www.timeleft.info/computer-timer.html

    #2
    We're not exactly sure what you're asking here?
    Are you asking if it's possible to replicate the UI / functionality of this app within a SmartClient app?

    We don't have any little "timer" / "stopwatch" User Interface components like this pre-built in the framework, but components like these could certainly be built using SmartClient.
    Let us know what you're after more specifically and we'll try to give you a more complete response!

    Regards
    Isomorphic Software

    Comment


      #3
      Sorry for the lack of detail - We want something like what you see when you're purchasing a ticket from ticketmaster - it gives you a countdown of how much time is left - we'd need to be able to re-position this as well - maybe even overlapping some UI already on the screen?

      Comment


        #4
        It would be very easy to build a draggable countdown timer based on the native browser timing features.
        It could be implemented in various ways. Exactly how to build it starts to get out of the realm of standard support and into consulting, but here's an overview of an approach you could take:

        Essentially you'd want to subclass the UI component that matched the appearance you were after (say a Label with canDragReposition set to true, align and vAlign set to center, and most likely a baseStyle set to something that would give you the desired appearance).

        You'd want to specify a duration attribute set to the duration left for the timer to run (probably in ms).

        You'd want to override getInnerHTML() to return this value formatted into minutes and seconds.

        You'd then want a start() API. This would
        - record the current time (via isc.timeStamp(), say)
        - kick off a recurring call to another method to update the appearance [using isc.Page.setEvent("idle", ...), for example]
        - when the recurring method runs it should compare the start time with the current time to determine how much time has elapsed, and modify the "duration" attribute to reflect the remaining time, and then call redraw() to refresh the display for the user to see.
        When the duration expired, you would want to cancel the recurring timer event, and possibly fire some custom action (an "expired" callback for example, which you could use in your app to pop a dialog notifying the user their time was up).

        You'd likely want a stop() API too - which would just cancel the idle event.

        This would all be very straightforward to build.

        One limitation you should be aware of is that this will rely on the native browser clock - so it may not exactly reflect a timer running on the server to (for example) time out a session or transaction.
        In real usages this would probably be fine. The "countdown timer" would be there mainly to give the user an indication of how much time is left - any actual enforced timeouts would be done on the server side so you wouldn't have any danger of (for example) a hacked client allowing this timeout to be bypassed, etc.
        If this was still a concern you could add functionality to contact the server using custom RPC requests, or the Realtime Messaging capability of Smartclient, possibly. But as we said, this seems unlikely to be necessary in the use-case you describe.

        Hopefully this is enough to get you going!

        Regards
        Isomorphic Software

        Comment


          #5
          how to change IDLE default "10 ms"

          Hi Isomorphic:

          I work on SmartClient 8.2, use isc.Page.setEvent("idle", ...).
          Because DLE is default "10 ms", could I change to 3 mins, 5 mins etc. ?

          I have searched a couple of days, but can't find solution. Please help me.

          Thanks very much.

          Comment

          Working...
          X