User Tools

Site Tools


pracro:devas_corner

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pracro:devas_corner [2010/08/10 11:14] devapracro:devas_corner [2011/01/14 14:49] (current) deva
Line 1: Line 1:
 ======Deva's corner====== ======Deva's corner======
 +=====Session sharing======
 +Client logon with (patientid, template) tupple.\\
 +Server makes lookup in active sessions for tupples matching the one supplied by the client.\\
 +If none matches, a new session is created and 'returned' to the client.\\
 +If a match exists, the client is queried if it want to take over the session.\\
 +The session state is to be stored with the session (open, closed_no_commit) so the client must actively notify the server when a session is closed without commit.\\
 +If a client is about to take over an active (not closed_no_committed) a warning should be issued, about possible race conditions happening.
  
 =====New Clientside Scripting System===== =====New Clientside Scripting System=====
Line 65: Line 72:
   * ''onChange'': triggered whenever the value of the widget is changed, either programmatically or by the user.   * ''onChange'': triggered whenever the value of the widget is changed, either programmatically or by the user.
   * more to come   * more to come
 +
  
  
 ====The Widget Object==== ====The Widget Object====
 When in a lua function, invoked by an event handler, the calling object (the object invoking the event) will be made available through the value 'this'. When in a lua function, invoked by an event handler, the calling object (the object invoking the event) will be made available through the value 'this'.
-Other object can be retrieved using the ''getWidget('name')'' function.+Other object can be retrieved using the ''widget('name')'' function.
 <code lua> <code lua>
 function foo() function foo()
-   if (this.value == 'bar')+   if (this:value() == 'bar')
    then    then
-      this.setValue('dut')+      this:setValue('dut')
    end    end
  
-   bas = getWidget('mywdg'+   bas = widget('mywdg'
-   if (bas && bas.value == 'bar' )+   if (bas && bas:value() == 'bar' )
    then    then
-      bas.setValue('dims')+      bas:setValue('dims')
    end    end
 end end
pracro/devas_corner.1281431694.txt.gz · Last modified: 2010/08/10 11:14 by deva