- Name Button
- CSS Class CC_Button
- Type NA
The button is a simple but versatile control, in it's least-configured
state it will cause the page to post-back, (a Submitting button). But it can
be overloaded to perform simple navigation, execute javascript and even
be skinned as an image.
It is also the only control within Chan to handle server side events, a Submitting
button can have its Click event bound to a function which will be
executed immediately after the Page_Load() function.
Roadmap
-
Needs a lot of breaking refactoring including renaming the Link property to Href
and giving the user an explicit choice between wether or not it posts back. rather
than checking
if Link="" and onclick doesn't startwith "return"
!
-
Clean up rendering code, implimenting the above should make this easier
| Qualifiers |
Type |
Name |
Default |
Description |
| required |
string |
id |
"" |
Unique identifier within the page for the button |
|
string |
Text |
"" |
The text which will appear on the button (or when Image is set, the Alt text for the image) |
|
string |
Size |
"thin" |
Choice of Thin, Norm, Wide or Mega. Corresponding to the CSS classes of .C__Thin, .C__Norm, .C__Wide and .C__Mega respectively |
|
bool |
Enabled |
true |
Wether or not the button is enabled within the page, directly mapped onto the HTML button disabled property. |
|
bool |
Visible |
true |
Wether or not the button is rendered into the page's HTML. |
|
bool |
ValidateForm |
false |
Wether or not the button causes form validation (only if it's a Submitting button) |
|
string |
Link |
"" |
When set will cause the button to directly navigate to the given URL instead of Submitting. If this starts with "^" then the link will open in a new window (except when Javascript is not available - this will cause the link will open in the current window). |
|
string |
OnClick |
"" |
When set will execute the specified Javascript instead of Submitting unless it starts with "return" (case sensitive), in which case the javascript will execute and the form will only be submitted if that returns true. |
|
string |
Image |
"" |
When set will cause the button to be rendered using the image URL specified with the Text property being used for ALT and TITLE, otherwise it will use a standard form button. |
| Qualifiers |
Type |
Name |
Params |
Description |
|
Event |
Click_BeforePageLoad |
|
Handle to a void(void) function to call immediately before Page_Load() (but after postback processing) if the button is the Submitting button that caused the postback |
|
Event |
Click |
|
Handle to a void(void) function to call immediately after Page_Load() if the button is the Submitting button that caused the postback |