Creates a set of HTML radio buttons.
wcRadioList(cntrlHandle, "select last_name from customers", "last", "ALIGN=Top", "Smith", &buf);
int wcRadioList(void *controlHandle, char *select, char *name, char *attributes, char *defaultSelection, char **buffer)
controlHandle | The handle to the control structure. |
select | The query that retrieves the items to be displayed in the group of radio buttons. Use SQL SELECT syntax. One radio button is created for each row retrieved by the SELECT. If you retrieve one column, the INPUT tags for the radio buttons use the following pattern:
<INPUT TYPE=radio NAME=name [attributes] VALUE=column>If you select two columns, the INPUT tags for the radio buttons use the following pattern: <INPUT TYPE=radio NAME=name [attributes] VALUE=column1>column2 |
name | A value to be used in the NAME attribute of the HTML <INPUT> tags that are generated by wcRadioList( ). |
attributes | Settings for the attributes of the HTML <INPUT> tags that are generated by wcRadioList( ). To set multiple attributes, separate the attribute settings with space characters. For more information about the attributes, refer to your HTML documentation. |
defaultSelection | The button that is selected when the HTML page is displayed, providing the user with a default selection. If this parameter is NULL, no default selection is provided. |
buffer | A storage area where you can keep the HTML output from the wcRadioList( ) function. Use this parameter to store the HTML so you can examine or manipulate it. If this parameter is NULL, the HTML output is returned directly into the output HTML page. |
0 | Success. |
Error code | Failure or exception. For a list of possible error codes, see Error Messages. |
The following code shows how WcRadioList( ) is used in an application.
/* Declare the event handling function */ int nameButtons(controlHandle) void *controlHandle; { wcRadioList(cntrlHandle, "select last_name from customers", "last", "ALIGN=Top", "Smith", &buf); } int requestLoop(controlHandle) void *controlHandle; { char *pageText; wcConOpen(controlHandle, 0); /* Associate nameButtons( ) with the "RadioButtons" event */ wcSetEventHandler(controlHandle, "RadioButtons", nameButtons); /* Load and explode the AppPage */ wcLoad(controlHandle, "page", &pageText); WebExplode(controlHandle, pageText, NULL); wcConClose(controlHandle); }
The nameButtons( ) function is called when WebExplode( ) encounters the following tag in the AppPage:
<HTML> <BODY> ... <?MIEVENT NAME="RadioButtons"> ... </HTML> </BODY>
wcCheckboxList( )
wcSelectList( )