Controlling Rotate Banners using Radio Buttons
|
|
<%
PrintWriter Out = new PrintWriter(out, true);
AC_Info aci = new AC_Info(request, application);
String AC_list[] = { CCG1, CCG2, CCG3, CCG4};
RotateBanner RB = new RotateBanner(aci, AC_list, 4);
RB.CGM(Out);
%>
|
<script type='text/ecmascript'> // Implement
Callback
function
change_banner(grp, num){
<%Out.print(RB.getBannerUpdateMethodName());%>(num)
}
</script>
|
<!--Display Check Boxes and control the Layers using the buttons-->
<%
String RadioB_list[] = { "ORCL", "MSFT", "INTC", "SUNW" };
RadioButtons RadioB = new RadioButtons
(aci, RadioB_list, 4);
// Register the Callback.
RadioB.setCB_AddMethod("change_banner");
RadioB.CGM(Out,300,
30, null); //Call Code generation method
%>
|
|
|
|
|
|
<%
PrintWriter Out = new PrintWriter(out, true);
AC_Info aci = new AC_Info(request, application);
String AC_list[] = { CCG1, CCG2, CCG3, CCG4};
RotateBanner RB = new RotateBanner(aci, AC_list, 4);
String RadioB_list[] = { "ORCL", "MSFT", "INTC", "SUNW" };
RadioButtons RadioB = new RadioButtons (aci, RadioB_list, 4);
//If user clicks on Rotate Banners, keep the Radio buttons
insynk
RB.setCallBackName(RadioB.getButtonSetMethodName());
%>
<script type='text/ecmascript'>
// Implement Callback
function change_banner(grp, num) {
<% Out.print(RB.getBannerUpdateMethodName());
%>(num)
}
</script>
<!--Display Check Boxes and control the Layers using the buttons-->
<%
// Register the Callback.
RadioB.setCB_AddMethod("change_banner");
RadioB.CGM(Out,
300, 30, null);
// Call Code generation method
RB.CGM(Out);
%>
|
|
Controlling
Show Layers using Check Boxes
|
|
// Include a JSP file that contains Objects for subcomponents.
// The names of the CCG-Objects are CCG1, CCG2, CCG3 and CCG4.
<%@ include file="subcomponents.jsp" %>
<%
PrintWriter Out = new PrintWriter(out, true);
String RB_list[] = { CCG1, CCG2, CCG3, CCG4};
AC_Info aci = new AC_Info(request, application);
ShowLayer SL = new ShowLayer(aci, RB_list, 4);
SL.CGM(Out);
// Include the code Block
%>
// A Communication function for the components SL
& CB
function switch_the_state(grp, state, num) {
var stt = 'hidden'; // If
Check-box is set to OFF
if (state == 1) stt = 'visible'; //
If Check-box is set to ON
<%Out.print(SL.getShowLayerName());%>(num, stt)
}
</script>
<!-- Display Check Boxes and control the Layers using the buttons -->
<g transform='translate(300 30)'>
<%
String CB_list[] = { "ORCL", "MSFT", "INTC", "SUNW" };
int def_states[] = { 1,0,0,0 };
CheckBoxes CB = new CheckBoxes(aci, CB_list, 4);
CB.setCB_AddMethod("switch_the_state");
CB.setDefaultStates(def_states);
CB.CGM(Out);
// Include the code Block
%>
</g>
|
|