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
Next revisionBoth sides next revision
pracro:devas_corner [2010/08/02 14:32] devapracro:devas_corner [2010/08/10 10:52] deva
Line 5: Line 5:
 <?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
 <macro name="test_resume" version="1.0"> <macro name="test_resume" version="1.0">
-  <script> 
-    function foo() 
-      -- this: current widget (widget that triggered the event) 
  
-      this.setChecked(true)+  <resume> 
 +    <script src="regexp.lua"/> 
 +    <script> 
 +      -- inline code 
 +      if(regexp('.+', '')) 
 +      then 
 +        return 'a string' 
 +      else 
 +        return 'another string' 
 +      end 
 +    </script> 
 +  </resume>
  
-      foo = getWidgetByName('test2')+  <scripts> 
 +    <script> 
 +      function foo(
 +        -- this: current widget (widget that triggered the event)
  
-      if ( foo && foo.getType() == 'lineedit'+        this:setChecked(true) 
-      then + 
-         foo.setValue('bleh')+        foo = widget('test2'
 + 
 +        if ( foo && foo:type() == 'lineedit'
 +        then 
 +          foo:setValue('bleh') 
 +        end
       end       end
-    end +    </script> 
-  </script>+  </scripts>
   <widgets caption="Test Resume"   <widgets caption="Test Resume"
           layout="vbox">           layout="vbox">
Line 29: Line 45:
 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>
-<script> +<scripts> 
---example +  <script src="foo.lua"/
-</script> +  <script> 
-<script file="foo.lua"/>+    --example 
 +  </script> 
 +</scripts>
 </code> </code>
  
pracro/devas_corner.txt · Last modified: 2011/01/14 14:49 by deva