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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Passing checkbox value from fex to the same fex

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Passing checkbox value from fex to the same fex
 Login/Join
 
Platinum Member
posted
Is it possible to use checkboxes in the header of a fex application.
This is needed to make a print mechanism so we can indicate which columns will and will not be printed in PDF. We now use a script, and by clicking on the right mouse a box appears to select 'show in EXCEL or PDF' and then the same fex will be called.

This message has been edited. Last edited by: Kerry,
 
Posts: 103 | Registered: March 18, 2008Report This Post
Expert
posted Hide Post
If you mean is it possible to use checkboxes in the header of an HTML report that are subsequently passed back to the same program to rerun the report in PDF format, then yes, but you most likely will not be able to do that with the GUI tools in Dev Studio or MRE. You will manually have to add code to add check-box html objects to the column titles of the report (HTML only) and then add JavaScript to collect the check-boxes and add them to the focexec call. It sounds like an interesting challenge for you, MrM.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
It may be easiest to create hidden parameter controls (via the GUI) in the static html, for each of the checkable columns. Then your onsubmit code need only copy values between controls, and IBI will take it from there.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
Or easier yet, if you're just putting them in the heading, add a line that says something like "Output Types" and then add a multidrill to that heading line which passes all the necessary parms with an output type as an additional parm. That still gives you the pop-up box type functionality, but handles everything as a url (drilldown) so no additional javascript or report coding is necessary and this can all be done in Dev Studio / MRE.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
First thanks all for your reply.

Would it be possible to show checkboxes by using code like below.
The code below don't show me the right result.


-* File checkcar.fex
-SET &ECHO=ALL;

DEFINE FILE CAR
COL001/A1='';
CHKBOX001/A50='';
END

TABLE FILE CAR
PRINT
CAR.COUNTRY
COL001 AS CHKBOX001
CAR.CAR
CAR.MODEL
CAR.BODYTYPE
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
ENDSTYLE
END
 
Posts: 103 | Registered: March 18, 2008Report This Post
<JG>
posted
I would tend to look at something like this so that the check box is associated with the column title

 
-DEFAULTH &FMT    = 'HTML'
-DEFAULTH &COUNTRY ='COUNTRY'
-DEFAULTH &CAR     ='CAR'
-DEFAULTH &MODEL   ='MODEL'
-DEFAULTH &BODYTYPE='BODYTYPE'

-SET &ASCOUNTRY  = IF '&FMT.EVAL' EQ 'HTML' THEN 'AS '|''''||'Country  <INPUT TYPE=CHECKBOX ID="COUNTRY"  NAME="COUNTRY"  VALUE="COUNTRY">'|'''' ELSE 'AS '|''''||'Country' ||'''';
-SET &ASCAR      = IF '&FMT.EVAL' EQ 'HTML' THEN 'AS '|''''||'Car      <INPUT TYPE=CHECKBOX ID="CAR"      NAME="CAR"      VALUE="CAR">'||'''' ELSE  'AS '|''''||'Car' ||'''';
-SET &ASMODEL    = IF '&FMT.EVAL' EQ 'HTML' THEN 'AS '|''''||'Model    <INPUT TYPE=CHECKBOX ID="MODEL"    NAME="MODEL"    VALUE="MODEL">'||'''' ELSE  'AS '|''''||'Model' ||'''';
-SET &ASBODYTYPE = IF '&FMT.EVAL' EQ 'HTML' THEN 'AS '|''''||'Bodytype <INPUT TYPE=CHECKBOX ID="BODYTYPE" NAME="BODYTYPE" VALUE="BODYTYPE">'|'''' ELSE  'AS '|''''||'Bodytype' ||'''';

TABLE FILE CAR
PRINT
&COUNTRY   &ASCOUNTRY
&CAR       &ASCAR
&MODEL     &ASMODEL
&BODYTYPE  &ASBODYTYPE
HEADING
"Export"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &FMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
-IF '&FMT.EVAL' NE 'HTML' GOTO NONHTM;
TYPE=HEADING,DRILLMENUITEM='PDF',FOCEXEC=test02(FMT='PDF'),
             DRILLMENUITEM='Excel',FOCEXEC=test02(FMT='EXL2K'),$ 
-NONHTM
ENDSTYLE
END
-RUN
 
 
Report This Post
Expert
posted Hide Post
JG,

In your example, the check-box values are not passed back to the program, so the program does not know which columns were selected by the user.

Some JavaScript added to your code and a few tweaks solves the problem:

-SET &ECHO=ALL;

-DEFAULTH &FMT    = 'HTML'
-DEFAULTH &COUNTRY =''
-DEFAULTH &CAR     =''
-DEFAULTH &MODEL   =''
-DEFAULTH &BODYTYPE=''

-SET &HEAD1 = IF &FMT EQ 'HTML' THEN 'Export' ELSE '';

-SET &PCOUNTRY  = IF &COUNTRY  EQ 'N' THEN '-*' ELSE 'COUNTRY ';
-SET &PCAR      = IF &CAR      EQ 'N' THEN '-*' ELSE 'CAR     ';
-SET &PMODEL    = IF &MODEL    EQ 'N' THEN '-*' ELSE 'MODEL   ';
-SET &PBODYTYPE = IF &BODYTYPE EQ 'N' THEN '-*' ELSE 'BODYTYPE';

-SET &ASCOUNTRY  = IF &FMT EQ 'HTML' THEN 'AS ''<input type=checkbox id="COUNTRY" > Country ''' ELSE 'AS ''Country''';
-SET &ASCAR      = IF &FMT EQ 'HTML' THEN 'AS ''<input type=checkbox id="CAR"     > Car     ''' ELSE 'AS ''Car''';
-SET &ASMODEL    = IF &FMT EQ 'HTML' THEN 'AS ''<input type=checkbox id="MODEL"   > Model   ''' ELSE 'AS ''Model''';
-SET &ASBODYTYPE = IF &FMT EQ 'HTML' THEN 'AS ''<input type=checkbox id="BODYTYPE"> Bodytype''' ELSE 'AS ''Bodytype''';

TABLE FILE CAR
PRINT
COUNTRY NOPRINT
&PCOUNTRY.EVAL   &ASCOUNTRY
&PCAR.EVAL       &ASCAR
&PMODEL.EVAL     &ASMODEL
&PBODYTYPE.EVAL  &ASBODYTYPE

HEADING
"Customized Car Report"
"&HEAD1"

ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &FMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$

-IF &FMT NE 'HTML' GOTO NONHTM;

TYPE=HEADING, LINE=2,
DRILLMENUITEM='PDF',   JAVASCRIPT = RerunReport('PDF'),
DRILLMENUITEM='Excel', JAVASCRIPT = RerunReport('EXL2K'),
$
-NONHTM
ENDSTYLE
END
-RUN

-NONHTM
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<script language='javascript'>
function RerunReport(FMT)
{
focexurl1 = document.location +
'&|FMT=' + FMT +
'&|COUNTRY='  + GetCheckBoxValue(document.getElementById('COUNTRY')) +
'&|CAR='      + GetCheckBoxValue(document.getElementById('CAR'))     +
'&|MODEL='    + GetCheckBoxValue(document.getElementById('MODEL'))   +
'&|BODYTYPE=' + GetCheckBoxValue(document.getElementById('BODYTYPE'));
;

window.open(focexurl1,'win1');
}

// Return Y or N depending on the checked status of a check box
function GetCheckBoxValue(CheckBox)
{
if (CheckBox.checked == true) x = 'Y'; else x = 'N';

return(x);
}

</script>
-HTMLFORM END

I realize this is antiquated but it does work.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
<JG>
posted
Francis,

Thanks for adding the finishing touches,
I know that what I posted did not return the values it was meant only to illustrate
a method of actually displaying the check boxes in reply to the sample code posted by
MrM.

And bye the way Francis there is definitely nothing wrong with some the older ways
of doing things.
To be honest they are generally much more reliable and user friendly than of some
of the newer rubbish that is around now.
 
Report This Post
Platinum Member
posted Hide Post
thanks all.

I will use the examples.
 
Posts: 103 | Registered: March 18, 2008Report This Post
<JG>
posted
MrM

To get Francis's modified code to work you need to change

focexurl1 = document.location +

to

focexurl1 = document.location + '?IBIF_ex=test02' +
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Passing checkbox value from fex to the same fex

Copyright © 1996-2020 Information Builders