October 12, 2011, 06:33 AM
ShruWP format issue
Hi All,
I am facing issue when using the format WP. I am unable to chain 2 drop downs using the WP format.My second drop down is not populating at all if any selection made in the first drop down but when i use the Alpha format the 2nd drop down is populating but not chaining. I understand that i have to use WP format for my logic as i have to hold the output with the header and footer. Kindly let me know where i am ghoing wrong.
Below id my hold file
DEFINE FILE SUB_HOLD
B1/A70 = '"' || PRACT2 || '"';
SUB_DRP/A200 ='PJT1.options[PJT1.options.length] = new Option(' || '''' || SUB_LAW || '''' || ');' ;
END
TABLE FILE SUB_HOLD
PRINT
SUB_DRP AS ''
BY PRACT2 NOPRINT
BY SUB_LAW NOPRINT
ON PRACT2 SUBHEAD
"if (r==<B1"
")"
"{"
ON PRACT2 SUBFOOT
"}"
ON TABLE HOLD AS DRPDWN2 FORMAT WP
END
I am calling this in the javascripting
<SELECT id=combobox18 style="Z-INDEX:7; LEFT: 120px; WIDTH: 250px; POSITION: absolute; TOP: 183px;FONT-FAMILY: Arial;font-size: 10pt" name="PRACT" OnChange="SUBDRP(document.form1.PRACT.options[document.form1.PRACT.selectedIndex].text)"> <option value="PRACT" selected displaytext="PRACT">Practice Group</option> <!--WEBFOCUS TABLE DRPDWN1> </SELECT>
below is where the onchange function is called
function SUBDRP(r)
{
var PJT1 = document.form1.SUBST;
PJT1.options.length = 1;
!IBI.FIL.DRPDWN2;
}
Thanks
Shru
October 12, 2011, 04:56 PM
WazFormat WP adds extra stuff to the output, such as page numbers and print control, at least for very old line printers.
I would suggest a different approach.
Please check out this example, baased on what you posted.
DEFINE FILE CAR
OPTION/A100 = '<option value="' || COUNTRY || '">' || COUNTRY || '</option>' ;
END
TABLE FILE CAR
PRINT OPTION
ON TABLE HOLD AS DRPDWN1 FORMAT ALPHA
END
-RUN
TABLE FILE CAR
PRINT
COMPUTE B1/A70 = IF LAST COUNTRY EQ ' '
THEN 'if (r=="' || COUNTRY || '") {'
ELSE
IF COUNTRY NE LAST COUNTRY
THEN '} if (r=="' || COUNTRY || '") {'
ELSE ' ' ; NOPRINT
COMPUTE SUB_DRP/A200 = B1 | ' PJT1.options[PJT1.options.length] = new Option(' || '''' || CAR || '''' || ');' ;
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS DRPDWN2 FORMAT ALPHA
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title> Focalpoint </title>
<script type="text/javascript">
<!--
function SUBDRP(r)
{
var PJT1 = document.form1.SUBST;
PJT1.options.length = 1;
!IBI.FIL.DRPDWN2;
}
}
//-->
</script>
</head>
<body>
<form name=form1 method="post" action="">
<SELECT id=combobox18 style="Z-INDEX:7; LEFT: 120px; WIDTH: 250px; POSITION: absolute; TOP: 183px;FONT-FAMILY: Arial;font-size: 10pt"
name="PRACT" OnChange="SUBDRP(document.form1.PRACT.options[document.form1.PRACT.selectedIndex].text)">
<option value="PRACT" selected displaytext="PRACT">Practice Group</option>
<!--WEBFOCUS TABLE DRPDWN1>
</SELECT>
<BR>
<SELECT id=SUBST name="SUBST" SIZE=10 style="POSITION: absolute; LEFT: 120px; WIDTH: 250px; TOP: 220px;">
</SELECT>
</form>
</body>
</html>
October 14, 2011, 01:38 AM
ShruThanks Waz!!!! I will try this
October 21, 2011, 02:07 AM
ShruHi Waz,
Thanks for the reply. Sorry I could not reply earlier. This worked like a charm for one chaining. But any thoughts how it works for multiple chaining. I tried replicating the same code for the second chaining and then concatinating it with the first and second but i am getting the chaining for only the first record. Any thoughts.
Thanks
Shru
October 23, 2011, 04:32 PM
WazDid you know that Developer Studio supports Chaining ?
You could also do the chaining your self. Please see
this thread, it uses XMLHTTP object.