Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi

Read-Only Read-Only Topic
Go
Search
Notify
Tools
WP format issue
 Login/Join
 
Silver Member
posted
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


769 Excel,PDF and HTML
 
Posts: 35 | Location: Bangalore | Registered: March 27, 2008Report This Post
Expert
posted Hide Post
Format 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>


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Thanks Waz!!!! I will try this


769 Excel,PDF and HTML
 
Posts: 35 | Location: Bangalore | Registered: March 27, 2008Report This Post
Silver Member
posted Hide Post
Hi 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


769 Excel,PDF and HTML
 
Posts: 35 | Location: Bangalore | Registered: March 27, 2008Report This Post
Expert
posted Hide Post
Did you know that Developer Studio supports Chaining ?

You could also do the chaining your self. Please see this thread, it uses XMLHTTP object.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders