The example below demonstrates how to dynamically set the rapidSpellWebLaunchers attribute in the RapidSpellWebMultiple attribute. This, along with outputting a RapidSpellWebLauncher for each text box, is all that is required.
<%@ taglib uri="/WEB-INF/RapidSpellWeb.tld" prefix="RapidSpellWeb" %>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>Keyoti RapidSpell Web</TITLE>
</HEAD> <BODY > <form action='exampleTextBox16b-DynamicMultipleBoxes.jsp' method='post' name='myForm'>
<% int numberOfTextBoxes = 4; String launchersString = "", launcherID, textComponentName; for (int i=0; i<numberOfTextBoxes; i++){ launcherID = "rapidSpellWebLauncher"+i; textComponentName = "myForm.sourceTextBox"+i; %>
<!--------------------- Text box i --------------------------------------------------------> <textarea name="sourceTextBox<%=i%>" wrap='true' cols='55' rows='10'>This is boxx <%=i%>.</textarea> <RapidSpellWeb:rapidSpellWebLauncher id="<%=launcherID%>" rapidSpellWebPage="RapidSpellCheckerPopUp.jsp" textComponentName="<%=textComponentName%>" RSMultipleID="RapidSpellWebMultiple1" />
<br><br> <% launchersString += launcherID; if(i<numberOfTextBoxes-1){ launchersString += ","; } } %>
<RapidSpellWeb:rapidSpellWebMultiple id="RapidSpellWebMultiple1" tabIndex="1" rapidSpellWebLaunchers="<%=launchersString%>"/>
</form> <p><font face='arial, helvetica'><a href="index.html">Back to contents page.</a></font> </BODY> </HTML>
|