summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TCallbackOptions/Home.page
blob: cfb041eac04953bfbb083f3ba14aaf92df7d7c65 (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
<com:TContent ID="body">
<h1>TCallbackOptions Samples</h1>

<table class="sampletable">

<tr><td class="samplenote">
A callback button with attached client side options:
</td><td class="sampleaction">
<com:TActiveButton
	Text="click me"
	OnCallback="buttonCallback"
	ActiveControl.CallbackOptions="options"
/>
<com:TCallbackOptions
	ID="options"
	ClientSide.OnLoading="$('callback_status2').hide(); new Effect.BlindDown('callback_status', { duration: 1 });"
	ClientSide.OnComplete="new Effect.BlindUp('callback_status', { duration: 1 }); $('callback_status2').show();"
/>
<div id="callback_status" style="display:none;">please wait 5 seconds for the callback to complete...</div>
<div id="callback_status2" style="display:none;">callback completed!</div>
</td></tr>

<tr><td class="samplenote">
Same example as before, but this time interacting with another Prado control:
</td><td class="sampleaction">
<com:TActiveButton
	Text="click me"
	OnCallback="buttonCallback"
	ActiveControl.CallbackOptions="options2"
/>
<com:TCallbackOptions
	ID="options2"
	ClientSide.OnLoading="$('<%= $this->label1->ClientID %>').innerHTML='please wait 5 seconds for the callback to complete....';"
	ClientSide.OnComplete="$('<%= $this->label1->ClientID %>').innerHTML='callback completed!';"
/>
<br/><com:TLabel ID="label1" ForeColor="Red" Text="waiting for button click.." />
</td></tr>

<tr><td class="samplenote">
The same TCallbackOptions can be shared among different controls, even of different types:
</td><td class="sampleaction">
<com:TActiveButton
	Text="simple button"
	OnCallback="buttonCallback"
	ActiveControl.CallbackOptions="options3"
/>

<br/><com:TActiveCheckBox
	Text="simple checkbox"
	OnCallback="buttonCallback"
	ActiveControl.CallbackOptions="options3"
/>

<br/><com:TActiveDropDownList
	OnCallback="buttonCallback"
	ActiveControl.CallbackOptions="options3"
>
	<com:TListItem Value="value 1" Text="item 1" />
	<com:TListItem Value="value 2" Text="item 2" Selected="true" />
	<com:TListItem Value="value 3" Text="item 3" />
	<com:TListItem Value="value 4" Text="item 4" />
</com:TActiveDropDownList>

<br/><com:TLabel ID="label2" ForeColor="Red" Text="waiting for any control to callback.." />

<com:TCallbackOptions
	ID="options3"
	ClientSide.OnLoading="$('<%= $this->label2->ClientID %>').innerHTML='please wait 5 seconds for the callback to complete....';"
	ClientSide.OnComplete="$('<%= $this->label2->ClientID %>').innerHTML='callback completed!';"
/>

</td></tr>
</table>

<com:TJavascriptLogger />

</com:TContent>