wcRadioList( )

Syntax . . Returns . . Tips . . Program Example . . Related Topics . . A-Z Index . . Home

Creates a set of HTML radio buttons.

Example

wcRadioList(cntrlHandle, "select last_name from customers",
             "last", "ALIGN=Top", "Smith", &buf);

Syntax

int wcRadioList(void *controlHandle,
                 char *select,
                 char *name,
                 char *attributes,
                 char *defaultSelection,
                 char **buffer)
controlHandleThe handle to the control structure.
selectThe 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
nameA value to be used in the NAME attribute of the HTML <INPUT> tags that are generated by wcRadioList( ).
attributesSettings 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.
defaultSelectionThe 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.
bufferA 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.

Returns

0Success.
Error codeFailure or exception. For a list of possible error codes, see Error Messages.

Tips

Program Example

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>

Related Topics

wcCheckboxList( )
wcSelectList( )


Top of Page . . Syntax . . Returns . . Tips . . Program Example . . A-Z Index . . Home