pracro:devas_corner
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pracro:devas_corner [2010/08/02 14:31] – deva | pracro:devas_corner [2011/01/14 14:49] (current) – deva | ||
---|---|---|---|
Line 1: | Line 1: | ||
======Deva' | ======Deva' | ||
+ | =====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 ' | ||
+ | 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 5: | Line 12: | ||
<?xml version=' | <?xml version=' | ||
<macro name=" | <macro name=" | ||
- | < | ||
- | function foo() | ||
- | -- this: current widget (widget that triggered the event) | ||
- | -- this.value: current value | ||
- | -- this.name: current name | ||
- | -- this.type: current type (eg. ' | ||
- | this.setChecked(true) | + | < |
+ | <script src=" | ||
+ | < | ||
+ | -- inline code | ||
+ | if(regexp(' | ||
+ | then | ||
+ | return 'a string' | ||
+ | else | ||
+ | return ' | ||
+ | end | ||
+ | </ | ||
+ | </ | ||
- | | + | < |
+ | < | ||
+ | function | ||
+ | -- this: current widget (widget that triggered the event) | ||
- | | + | this: |
- | then | + | |
- | | + | foo = widget(' |
+ | |||
+ | | ||
+ | then | ||
+ | foo:setValue(' | ||
+ | end | ||
end | end | ||
- | | + | |
- | </script> | + | </scripts> |
<widgets caption=" | <widgets caption=" | ||
layout=" | layout=" | ||
Line 32: | Line 52: | ||
The script tag can either consist of inline code, or be a reference to a serverside file, that will be inserted in-place by the server before it is sent to the client. | The script tag can either consist of inline code, or be a reference to a serverside file, that will be inserted in-place by the server before it is sent to the client. | ||
<code xml> | <code xml> | ||
- | < | + | < |
- | --example | + | |
- | </ | + | < |
- | <script file=" | + | |
+ | </ | ||
+ | </scripts> | ||
</ | </ | ||
+ | |||
====The Widget Events==== | ====The Widget Events==== | ||
Line 42: | Line 65: | ||
Currently the script is referred by its name, and called whenever the widget changes its value.\\ | Currently the script is referred by its name, and called whenever the widget changes its value.\\ | ||
In the new system, the script attribute is removed and replaced by event attributes. The event attributes will themselves contain lua code and not simply a name. In order to call ' | In the new system, the script attribute is removed and replaced by event attributes. The event attributes will themselves contain lua code and not simply a name. In order to call ' | ||
- | The return values will no longer be used. Instead widget methods will be added to control the validation state of each widget, eg. setValid(true|false), setInvalid(), | + | The return values will no longer be used. Instead widget methods will be added to control the validation state of each widget, eg. '' |
Since it is no longer required (due to redundancy) the '' | Since it is no longer required (due to redundancy) the '' | ||
+ | |||
====Event Handlers==== | ====Event Handlers==== | ||
* '' | * '' | ||
- | * '' | + | * more to come |
- | * and many more | + | |
====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 ' | 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 ' | ||
- | Other object can be retrieved using the '' | + | Other object can be retrieved using the '' |
<code lua> | <code lua> | ||
function foo() | function foo() | ||
- | if (this.value == ' | + | if (this:value() == ' |
then | then | ||
- | this.setValue(' | + | this:setValue(' |
end | end | ||
- | bas = getWidget(' | + | bas = widget(' |
- | if (bas && bas.value == ' | + | if (bas && bas:value() == ' |
then | then | ||
- | bas.setValue(' | + | bas:setValue(' |
end | end | ||
end | end | ||
</ | </ | ||
A small number of methods are common to all widget types. These include are: | A small number of methods are common to all widget types. These include are: | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
+ | * '' | ||
Others are specific to certain widget types, such as (and many more): | Others are specific to certain widget types, such as (and many more): | ||
- | * '' | + | * '' |
- | * '' | + | |
- | * '' | + | |
=====New protocol===== | =====New protocol===== |
pracro/devas_corner.1280752307.txt.gz · Last modified: 2010/08/02 14:31 by deva