Class TCallbackClientScript
TCallbackClientScript class.
The TCallbackClientScript class provides corresponding methods that can be executed on the client-side (i.e. the browser client that is viewing the page) during a callback response. The avaiable methods includes setting/clicking input elements, changing Css styles, hiding/showing elements, and adding visual effects to elements on the page. The client-side methods can be access through the CallbackClient property available in TPage. For example, to hide "$myTextBox" element during callback response, do - $this->getPage()->getCallbackClient()->hide($myTextBox);
Constructor Summary |
public |
Constructor.
|
Method Summary |
void
|
Add a Css class name to the element.
|
void
|
|
void
|
Visual Effect: Gradually make the element appear.
|
void
|
Append a HTML fragement to the element.
|
void
|
Visual Effect: Blind down.
|
void
|
Visual Effect: Blind up.
|
void
|
Executes a client-side statement.
|
void
|
Client script to check or uncheck a checkbox or radio button.
|
void
|
Client script to click on an element.
|
void
|
Visual Effect: Drop out.
|
void
|
Evaluate a block of javascript enclosed in a boundary.
|
void
|
Visual Effect: Gradually fade the element.
|
void
|
Focus on a particular element.
|
void
|
Visual Effect: Fold.
|
array
|
|
void
|
Visual Effect: Gradually make an element grow to a predetermined size.
|
void
|
Hides an element by changing its CSS display style to "none".
|
void
|
Visual Effect: High light the element for about 2 seconds.
|
void
|
Insert a HTML fragement after the element.
|
void
|
Insert a HTML fragement in before the element.
|
void
|
Prepend a HTML fragement to the element.
|
void
|
Visual Effect: Gradually grow and fade the element.
|
void
|
Visual Effect: Pulsate.
|
void
|
Raise the client side event (given by $eventName) on a particular element.
|
void
|
Removes an element from the HTML page.
|
void
|
Remove a Css class name from the element.
|
protected
void
|
replace
( TControl $element, string $content, string $method, string $boundary)
Replace the content of an element with new content. The new content can be a string or a TControl component. If the <tt>content</tt> parameter is a TControl component, its rendered method will be called and its contents will be used for replacement.
|
void
|
Replace the content of an element with new content contained in writer.
|
void
|
Scroll the top of the browser viewing area to the location of the element.
|
void
|
select
( TControl $control, string $method, string|int $value, string $type)
Client script to select/clear/check a drop down list, check box list, or radio button list.
|
void
|
Sets the attribute of a particular control.
|
void
|
Sets the options of a select input element.
|
void
|
Set the opacity on a html element or control.
|
void
|
Sets the style of element. The style must be a key-value array where the key is the style property and the value is the style value.
|
void
|
Client script to set the value of a particular input element.
|
void
|
Visual Effect: Shake the element.
|
void
|
Shows an element by changing its CSS display style as empty.
|
void
|
Visual Effect: Shrink the element.
|
void
|
Visual Effect: Slide down.
|
void
|
Visual Effect: Side up.
|
void
|
Visual Effect: Squish the element.
|
void
|
Visual Effect: Switch Off effect.
|
void
|
Toggles the visibility of the element.
|
void
|
Update the element's innerHTML with new content.
|
void
|
Add a visual effect the element.
|
Methods Inherited From TComponent |
TComponent::addParsedObject(), TComponent::attachEventHandler(), TComponent::canGetProperty(), TComponent::canSetProperty(), TComponent::createdOnTemplate(), TComponent::detachEventHandler(), TComponent::evaluateExpression(), TComponent::evaluateStatements(), TComponent::getEventHandlers(), TComponent::getSubProperty(), TComponent::hasEvent(), TComponent::hasEventHandler(), TComponent::hasProperty(), TComponent::raiseEvent(), TComponent::setSubProperty(), TComponent::__get(), TComponent::__set()
|
Constructor Details |
__construct
Constructor.
|
Method Details |
addCssClass
public void addCssClass |
(TControl $element , string $cssClass ) |
Add a Css class name to the element.
Input |
TControl | $element | control element or element id |
string | $cssClass | CssClass name to add. |
Output |
Exception |
|
addPostDataLoader
public void addPostDataLoader |
(mixed $name ) |
Input |
mixed | $name | |
Output |
Exception |
|
appear
public void appear |
(TControl $element , array $options ) |
Visual Effect: Gradually make the element appear.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
appendContent
public void appendContent |
(TControl $element , string $content ) |
Append a HTML fragement to the element.
Input |
TControl | $element | control element or element id |
string | $content | HTML fragement or the control to be rendered |
Output |
Exception |
|
blindDown
public void blindDown |
(TControl $element , array $options ) |
Visual Effect: Blind down.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
blindUp
public void blindUp |
(TControl $element , array $options ) |
Visual Effect: Blind up.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
callClientFunction
public void callClientFunction |
(string $function , array $params ) |
Executes a client-side statement.
Input |
string | $function | javascript function name |
array | $params | list of arguments for the function |
Output |
Exception |
|
check
public void check |
(TControl $checkbox , boolean $checked ) |
Client script to check or uncheck a checkbox or radio button.
Input |
TControl | $checkbox | control element or element id |
boolean | $checked | check or uncheck the checkbox or radio button. |
Output |
Exception |
|
click
Client script to click on an element.
is unpredictable.</b>
Input |
TControl | $control | control element or element id |
Output |
Exception |
|
dropOut
public void dropOut |
(TControl $element , array $options ) |
Visual Effect: Drop out.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
evaluateScript
Evaluate a block of javascript enclosed in a boundary.
Input |
THtmlWriter | $writer | writer for the content. |
Output |
Exception |
|
fade
public void fade |
(TControl $element , array $options ) |
Visual Effect: Gradually fade the element.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
focus
Focus on a particular element.
Input |
TControl | $element | control element or element id. |
Output |
Exception |
|
fold
public void fold |
(TControl $element , array $options ) |
Visual Effect: Fold.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
getClientFunctionsToExecute
public array getClientFunctionsToExecute |
() |
Output |
array
| list of client function to be executed during callback response. |
Exception |
|
grow
public void grow |
(TControl $element , array $options ) |
Visual Effect: Gradually make an element grow to a predetermined size.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
hide
Hides an element by changing its CSS display style to "none".
Input |
TControl | $element | control element or element id |
Output |
Exception |
|
highlight
public void highlight |
(TControl $element , array $options ) |
Visual Effect: High light the element for about 2 seconds.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
insertContentAfter
public void insertContentAfter |
(TControl $element , string $content ) |
Insert a HTML fragement after the element.
Input |
TControl | $element | control element or element id |
string | $content | HTML fragement or the control to be rendered |
Output |
Exception |
|
insertContentBefore
public void insertContentBefore |
(TControl $element , string $content ) |
Insert a HTML fragement in before the element.
Input |
TControl | $element | control element or element id |
string | $content | HTML fragement or the control to be rendered |
Output |
Exception |
|
prependContent
public void prependContent |
(TControl $element , string $content ) |
Prepend a HTML fragement to the element.
Input |
TControl | $element | control element or element id |
string | $content | HTML fragement or the control to be rendered |
Output |
Exception |
|
puff
public void puff |
(TControl $element , array $options ) |
Visual Effect: Gradually grow and fade the element.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
pulsate
public void pulsate |
(TControl $element , array $options ) |
Visual Effect: Pulsate.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
raiseClientEvent
public void raiseClientEvent |
(TControl $control , string $eventName ) |
Raise the client side event (given by $eventName) on a particular element.
Input |
TControl | $control | control element or element id |
string | $eventName | Event name, e.g. "click" |
Output |
Exception |
|
remove
Removes an element from the HTML page.
Input |
TControl | $element | control element or element id |
Output |
Exception |
|
removeCssClass
public void removeCssClass |
(TControl $element , string $cssClass ) |
Remove a Css class name from the element.
Input |
TControl | $element | control element or element id |
string | $cssClass | CssClass name to remove. |
Output |
Exception |
|
replace
protected void replace |
(TControl $element , string $content , string $method , string $boundary ) |
Replace the content of an element with new content. The new content can be a string or a TControl component. If the <tt>content</tt> parameter is a TControl component, its rendered method will be called and its contents will be used for replacement.
Input |
TControl | $element | control element or HTML element id. |
string | $content | HTML fragement or the control to be rendered |
string | $method | replacement method, default is to replace the outter html content. |
string | $boundary | provide a custom boundary. |
Output |
Exception |
|
replaceContent
public void replaceContent |
(TControl $element , string $content ) |
Replace the content of an element with new content contained in writer.
Input |
TControl | $element | control element or HTML element id. |
string | $content | HTML fragement or the control to be rendered |
Output |
Exception |
|
scrollTo
public void scrollTo |
(TControl $element ) |
Scroll the top of the browser viewing area to the location of the element.
Input |
TControl | $element | control element or element id |
Output |
Exception |
|
select
public void select |
(TControl $control , string $method , string|int $value , string $type ) |
Client script to select/clear/check a drop down list, check box list, or radio button list.
The second parameter determines the selection method. Valid methods are - Value, select or check by value
- Values, select or check by a list of values
- Index, select or check by index (zero based index)
- Indices, select or check by a list of index (zero based index)
- Clear, clears or selections or checks in the list
- All, select all
- Invert, invert the selection.
Input |
TControl | $control | list control |
string | $method | selection method |
string|int | $value | the value or index to select/check. |
string | $type | selection control type, either 'check' or 'select' |
Output |
Exception |
|
setAttribute
public void setAttribute |
(TControl $control , string $name , string $value ) |
Sets the attribute of a particular control.
Input |
TControl | $control | control element or element id |
string | $name | attribute name |
string | $value | attribute value |
Output |
Exception |
|
setListItems
public void setListItems |
(TControl $control , TCollection $items ) |
Sets the options of a select input element.
Input |
TControl | $control | control element or element id |
TCollection | $items | a list of new options |
Output |
Exception |
|
setOpacity
public void setOpacity |
(TControl $element , float $value ) |
Set the opacity on a html element or control.
Input |
TControl | $element | control element or element id |
float | $value | opacity value between 1 and 0 |
Output |
Exception |
|
setStyle
public void setStyle |
(TControl $element , array $styles ) |
Sets the style of element. The style must be a key-value array where the key is the style property and the value is the style value.
Input |
TControl | $element | control element or element id |
array | $styles | list of key-value pairs as style property and style value. |
Output |
Exception |
|
setValue
public void setValue |
(TControl $input , string $text ) |
Client script to set the value of a particular input element.
Input |
TControl | $input | control element to set the new value |
string | $text | new value |
Output |
Exception |
|
shake
public void shake |
(TControl $element , array $options ) |
Visual Effect: Shake the element.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
show
Shows an element by changing its CSS display style as empty.
Input |
TControl | $element | control element or element id |
Output |
Exception |
|
shrink
public void shrink |
(TControl $element , array $options ) |
Visual Effect: Shrink the element.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
slideDown
public void slideDown |
(TControl $element , array $options ) |
Visual Effect: Slide down.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
slideUp
public void slideUp |
(TControl $element , array $options ) |
Visual Effect: Side up.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
squish
public void squish |
(TControl $element , array $options ) |
Visual Effect: Squish the element.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
switchOff
public void switchOff |
(TControl $element , array $options ) |
Visual Effect: Switch Off effect.
Input |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
toggle
public void toggle |
(TControl $element , string $effect , array $options ) |
Toggles the visibility of the element.
Input |
TControl | $element | control element or element id |
string | $effect | visual effect, such as, 'appear' or 'slide' or 'blind'. |
array | $options | additional options. |
Output |
Exception |
|
update
Update the element's innerHTML with new content.
Input |
TControl | $element | control element or element id |
TControl | $content | new HTML content, if content is of a TControl, the controls render method is called. |
Output |
Exception |
|
visualEffect
public void visualEffect |
(string $type , TControl $element , array $options ) |
Add a visual effect the element.
Input |
string | $type | visual effect function name. |
TControl | $element | control element or element id |
array | $options | visual effect key-value pair options. |
Output |
Exception |
|
|