summaryrefslogtreecommitdiff
path: root/server/xml/macros/test_resume.xml
blob: 05afd3fdca1d30369394cf87f9d31e5579d5823c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?xml version='1.0' encoding='UTF-8'?>
<macro name="test_resume" version="1.0">

  <resume>
		<script src="regexp.lua"/>
		<script>
			-- inline code
			if(regexp('.+', ''))
			then
			  return 'a string'
			else
			  return 'another string'
			end
		</script>
  </resume>
	
  <queries>
  </queries>

  <maps>
  </maps>

  <scripts>
    <script language="lua" src="test.lua"/>
    <script language="lua">
      function bar(wdg)
        w = widget(wdg)
        w:setValid(this:checked())
      end

      function foo()
        this:setValid((string.sub(this:value(), 1, 4) == 'test'))
      end
    </script>
  </scripts>

  <widgets caption="Test Resume"
          layout="vbox">

    <lineedit name="test1" value="test"
	      onChange="this:setValid(this:value()~='')"/>
    <checkbox caption="Og svaret eer?"
	      name="test2" value="ja"
	      truevalue="ja" falsevalue="nej"
	      onChange="bar('test1')"/>
    <textedit name="test3" value="tjae"
	      onChange="this:setValid(this:value() == 'a')"/>
      
    <altcombobox name="dims" value="futtefejer" layout="vbox"
		 onChange="this:setValid((string.sub(this:value(), 1, 4) == 'test'))">
      <item caption="Test1" value="test1"/>
      <item caption="Test2" value="test2"/>
      <item caption="Test3" value="test3"/>
      <altitem caption="Test[n]" value="test4" innerwidget="inner">
	<lineedit name="inner"/>
      </altitem>
    </altcombobox>

    <combobox name="combo1" type="select"
				onChange="this:setValid((string.sub(this:value(), 1, 4) == 'test'))">
      <item caption="Test1" value="test1"/>
      <item caption="Test2" value="test2"/>
      <item caption="Test3" value="test3"/>
      <item caption="Test4" value="test4"/>
    </combobox>

    <combobox name="combo2" type="search"
	      onChange="this:setValid((string.sub(this:value(), 1, 4) == 'test'))">
      <item caption="Test1" value="test1"/>
      <item caption="Test2" value="test2"/>
      <item caption="Test3" value="test3"/>
      <item caption="Test4" value="test4"/>
    </combobox>

    <combobox name="combo3" type="edit"
	      onChange="this:setValid((string.sub(this:value(), 1, 4) == 'test'))">
      <item caption="Test1" value="test1"/>
      <item caption="Test2" value="test2"/>
      <item caption="Test3" value="test3"/>
      <item caption="Test4" value="test4"/>
    </combobox>

    <frame layout="hbox">
      <spacer />
      <button caption="Reset" action="reset"/>
      <button caption="Gem" action="commit"/>
    </frame>
  </widgets>
</macro>