[SOLVED] Mouseover example for column title and data element
Hi All,
I copied the example below from an old post and I'm getting an error. I'm on 8.201M
A couple questions ... 1) Can someone run this and see if it works for them? And if not, let me know what the issue is.
2)Is this still the best/preferred way to accomplish this functionality?
Thanks
Here's the example using the CAR file ...
-*-- Hover / Mouseover example using html title --------------------------------
-SET &TITLE_MSG =
- '<span style="cursor: default;" ' | 'title=''View details''>Country</span>';
DEFINE FILE CAR
CONTINENT/A10 =
IF COUNTRY IN ('FRANCE', 'W GERMANY', 'ITALY', 'ENGLAND') THEN 'Europe' ELSE
IF COUNTRY IN ('JAPAN') THEN 'Asia' ELSE '???';
MOUSEOVER/A255 =
'<span style="cursor: default;" title=''The continent is ' |
CONTINENT | '''>' | COUNTRY | '</span>';
END
TABLE FILE CAR
PRINT
MOUSEOVER AS '&TITLE_MSG'
MODEL AS 'Model'
BY COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT HTML
END
Here's the error message I get ...
0 ERROR AT OR NEAR LINE 17 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC003) THE FIELDNAME IS NOT RECOGNIZED: View (FOC009) INCOMPLETE REQUEST STATEMENT BYPASSING TO END OF COMMANDThis message has been edited. Last edited by: FP Mod Chuck,
WebFocus 8.201M, Windows, App Studio
May 09, 2018, 11:43 AM
David Briars
I put 'View Details' in double quotes, rather than 2 single quotes, and the page renders fine.
-SET &TITLE_MSG =
- '<span style="cursor: default;" ' | 'title="View details">Country</span>';
DEFINE FILE CAR
CONTINENT/A10 =
IF COUNTRY IN ('FRANCE', 'W GERMANY', 'ITALY', 'ENGLAND') THEN 'Europe' ELSE
IF COUNTRY IN ('JAPAN') THEN 'Asia' ELSE '???';
MOUSEOVER/A255 =
'<span style="cursor: default;" title=''The continent is ' |
CONTINENT | '''>' | COUNTRY | '</span>';
END
TABLE FILE CAR
PRINT
MOUSEOVER AS '&TITLE_MSG'
MODEL AS 'Model'
BY COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT HTML
END
-EXIT
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
May 09, 2018, 11:56 AM
FP Mod Chuck
jfr99
I get the same error and not sure of the cause. In the master file you can create the DEFINE with a TITLE and DESCRIPTION of the field and use SET POPUPDESC = ON in your fex or server profile (edasprof.prf). I think that is the preferred method now.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 09, 2018, 12:15 PM
jfr99
Hi David ... That worked for me as well. Thanks
Chuck ... I'm mostly interested in a mouseover for a data element so is this still the best/preferred method there?
Thanks
WebFocus 8.201M, Windows, App Studio
May 09, 2018, 12:24 PM
Francis Mariani
The original post was from 2006, when we did not have POPUPDESC. The code works when the appropriate quotes are used - double-quotes like David mentioned.
Unfortunately, while POPUPDESC does what it's supposed to do, my example does more: it provides more information than a description - it includes data values.
Slightly cleaned up code - ready for 2030 AD.
-*-- Hover / Mouseover example using html title --------------------------------
-SET &TITLE_MSG = '<span style="cursor: default;" ' | 'title="View details">Country</span>';
DEFINE FILE CAR
CONTINENT/A10 =
IF COUNTRY IN ('FRANCE', 'W GERMANY', 'ITALY', 'ENGLAND') THEN 'Europe' ELSE
IF COUNTRY IN ('JAPAN') THEN 'Asia' ELSE '???';
MOUSEOVER/A255 =
'<span style="cursor: default;" title="The continent is ' |
CONTINENT || '">' || COUNTRY || '</span>';
END
-RUN
TABLE FILE CAR
PRINT
MOUSEOVER AS '&TITLE_MSG'
MODEL AS 'Model'
BY COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT HTML
END
-RUN
This message has been edited. Last edited by: Francis Mariani,
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
May 09, 2018, 12:27 PM
Francis Mariani
BTW, it's unfortunate that we cannot include the TITLE and DESCRIPTION attributes in a DEFINE that's in a fex, not in a mas.
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
May 09, 2018, 02:23 PM
jfr99
Here's another example using the CAR file. I created a profit field and a mouseover for the Title and the data element. I would like to have the information in the data element mouseover be on two lines. Retail Cost on one line and Dealer Cost on another line. How do I put a line break in the mouseover. Thanks
Here's the code ...
-*
-SET &TITLE_MSG = '<span style="cursor: default;" ' | 'title="Retail Cost minus Dealer Cost">Profit</span>';
-*
DEFINE FILE CAR
PROFIT/D7 = RETAIL_COST - DEALER_COST;
T1_PROFIT/A12 = FPRINT(PROFIT, 'D7', 'A12');
T1_RETAIL_COST/A12 = FPRINT(RETAIL_COST, 'D7', 'A12');
T1_DEALER_COST/A12 = FPRINT(DEALER_COST, 'D7', 'A12');
MO_PROFIT/A255 =
'<span style="cursor: default;" title=''Retail Cost = ' | T1_RETAIL_COST | 'Dealer Cost = ' |
T1_DEALER_COST | '''>' | T1_PROFIT | '</span>';
END
-*
TABLE FILE CAR
PRINT
MO_PROFIT AS '&TITLE_MSG'
RETAIL_COST
DEALER_COST
PROFIT
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=MO_PROFIT, JUSTIFY=RIGHT, $
ENDSTYLE
END
WebFocus 8.201M, Windows, App Studio
May 09, 2018, 02:46 PM
Francis Mariani
This is an example of an embedded new-line in the title attribute:
-SET &TITLE_MSG = '<span style="cursor: default;" ' | 'title="Retail Cost minus Dealer Cost">Profit</span>';
DEFINE FILE CAR
PROFIT/D7 = RETAIL_COST - DEALER_COST;
T1_PROFIT/A12 = FPRINT(PROFIT, 'D7', 'A12');
T1_RETAIL_COST/A12 = FPRINT(RETAIL_COST, 'D7', 'A12');
T1_DEALER_COST/A12 = FPRINT(DEALER_COST, 'D7', 'A12');
MO_PROFIT/A255 =
'<span style="cursor: default;" title="'
|| 'Retail Cost = ' || (' ' | LJUST(12, T1_RETAIL_COST, 'A12'))
|| ( ' ' | '&|#013;'
|| 'Dealer Cost = ' || (' ' | LJUST(12, T1_DEALER_COST, 'A12'))
|| '">') || T1_PROFIT || '</span>';
END
-RUN
TABLE FILE CAR
PRINT
MO_PROFIT AS '&TITLE_MSG'
RETAIL_COST
DEALER_COST
PROFIT
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=MO_PROFIT, JUSTIFY=RIGHT, $
ENDSTYLE
END
-RUN
& # 0 1 3 ; is a new line. The | in & | # 0 1 3 ; is required because WF interprets the ampersand as a Dialogue Manager variable.
Anything more sophisticated than my example above requires CSS, and/or JavaScript or jQuery. (as per the second link below, you could embed a tab character to line up the titles)