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.
A discussion came up in another thread today about responsive design. It seems that it is a work in progress for IBI, so I thought I would share some code I used for a responsive design project I completed a few months ago. I did not have time to try to do it the IBI way, so I resorted to standard HTML/CSS coding to make the responsive design work.
Below is the example code. Remove the first line and the last line, save to an HTML file, then open with a browser. Growing or shrinking the browser should make the page layout change at some point. The page itself is full of commentary, so I won't post any more comments here.
If anyone views this page on an actual mobile device, I would appreciate some feedback because I never get to test on actual mobile devices for security reasons.
<!-- Remove this line
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
width:100%;
height:100%;
background-color:#efefef;
font-family:Calibri,sans-serif;
font-size:62.5%;
margin:8px auto;
margin-top:1%;
margin-bottom:1%;
}
.display_table {
display:table;
background-color:lightgray;
width:100%;
}
.display_cell {
display:table-cell;
width:50%;
font-size:1.6em;
}
#container {
width:100%;
-webkit-box-shadow: 0px 0px 6px 3px rgba(0,0,0,0.47);
-moz-box-shadow: 0px 0px 6px 3px rgba(0,0,0,0.47);
box-shadow: 0px 0px 6px 3px rgba(0,0,0,0.47);
}
/* CSS Media Queries */
@-ms-viewport {
width: device-width;
}
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
[class="display_cell"] { display:block; width:100%; }
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
[class="display_cell"] { display:table-cell; width:50%; }
}
/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
[class="display_cell"] { display:block; width:100%; }
}
/* iPads (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
[class="display_cell"] { display:table-cell; width:50%; }
}
/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
[class="display_cell"] { display:table-cell; width:50%; }
}
/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
[class="display_cell"] { display:block; width:100%; }
}
/*********
iPad 3
*********/
@media
only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape)
and (-webkit-min-device-pixel-ratio : 2) {
[class="display_cell"] { display:table-cell; width:50%; }
}
@media
only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait)
and (-webkit-min-device-pixel-ratio : 2) {
[class="display_cell"] { display:block; width:100%; }
}
/* Desktops and laptops ----------- */
@media only screen
and (min-width : 1224px) {
[class="display_cell"] { display:table-cell; width:50%; }
}
/* Large screens ----------- */
@media only screen
and (min-width : 1824px) {
[class="display_cell"] { display:table-cell; width:50%; }
}
/* iPhone 4 ----------- */
@media
only screen
and (min-device-width : 320px)
and (max-device-width : 480px)
and (orientation : landscape)
and (-webkit-min-device-pixel-ratio : 2) {
[class="display_cell"] { display:block; width:100%; }
}
/* LG Optimus L70 portrait ----------- */
@media
only screen
and (min-device-width : 384px)
and (max-device-width : 640px)
and (orientation : portrait) {
/* Styles */
[class="display_cell"] { display:block; width:100%; }
}
/* Nokia N9 portrait ----------- */
@media
only screen
and (min-device-width : 360px)
and (max-device-width : 640px)
and (orientation : portrait) {
/* Styles */
[class="display_cell"] { display:block; width:100%; }
}
@media
only screen
and (min-device-width : 320px)
and (max-device-width : 480px)
and (orientation : portrait)
and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
[class="display_cell"] { display:block; width:100%; }
}
</style>
</head>
<body>
<div id="container">
<div class="display_table">
<div id="panel1" class="display_cell" style="background-color:#efefef;padding:4px">
<center><h3>DIV #1</h3></center>
This is an example of responsive design using HTML DIV tags,
the table-cell display property and CSS media queries.
<br><br>
Four colored HTML DIVs will be displayed, each with text inside of
them.
<br><br>
The DIVs will have their display properties set to "table-cell" if
there is enough room on the display device, which will result in
two DIVs on top and two on the bottom.
<br><br>
If there is not enough width on the display, the DIVs will have their display
properties set to "block" instead. This will result in all four DIVs being
stacked vertically on the display.
<br></br>
This is accomplished by using CSS media queries, which can change
CSS properties based on the size of the display device. The devices are
tested for both portrait and landscape display modes.
<br><br>
The code for this example is a mix of HTML and CSS, and can be
saved to a local disk file and opened without a web server.
<br>
</div>
<div id="panel2" class="display_cell" style="background-color:#bbffbb;padding:4px">
<center><h3>DIV #2</h3></center>
DIVs can be made to act like cells in an HTML table by changing their display
property to "table-cell" and placing them inside a DIV that has its display
property set to "table".
<br><br>
In this example, there are two "table" DIVs, each with two "table-cell" DIVs
inside of them. This results in what appears to be a 2 by 2 set of text panels.
Each table-cell DIV in each table DIV gets 50% of the display width.
<br><br>
When the browser is resized or a mobile device is changed to either portrait or
landscape mode, one of a group of CSS media queries for the appropriate display
screen size is executed. The table-cell DIVs will have their "display" and "width"
properties adjusted. These CSS properties will be either "display:block" and
"width:100%" (vertically stacked DIVs), or "display:table-cell" and "width:50%"
(for a 2 by 2 display).
<br></br>
The CSS media queries in this example cover a large number of possible mobile
devices, so you should be able to copy and paste them into your projects.
<br>
</div>
</div>
<div class="display_table">
<div id="panel3" class="display_cell" style="background-color:lightyellow;padding:4px">
<center><h3>DIV #3</h3></center>
An example of a CSS media query is shown below:
<br><br>
<code>
/* iPhone 4 ----------- */<br>
@media<br>
only screen
and (min-device-width : 320px)<br>
and (max-device-width : 480px)<br>
and (orientation : landscape)<br>
and (-webkit-min-device-pixel-ratio : 2) {<br>
[class="display_cell"] { display:block; width:100%; }<br>
}<br>
</code>
<br>
This looks for displays (screens) with a minimum device width of 320px, a
maximum device width of 480px, in landscape mode, and a minimum pixel ratio
of 2. If found, the device is likely an iPhone 4. All DIVs with a class of
"display_cell" will have their display properties set to "block" and their
width properties set to "100%", resulting in all the DIVs being stacked
vertically on the iPhone 4.
<br>
</div>
<div id="panel4" class="display_cell" style="background-color:pink;padding:4px">
<center><h3>DIV #4</h3></center>
The Google Chrome web browser has an add-on called "mobile browser emulator".
It gives Chrome the ability to simulate what a responsive design web page will
look like when rendered on different mobile devices. This makes it easy to
see how a page will look on a device without needing to have a physical
device to test on.
<br><br>
More information here: <a href="https://chrome.google.com/webstore/detail/mobile-browser-emulator/lbofcampnkjmiomohpbaihdcbjhbfepf?hl=en">mobile browser emulator</a>
<br>
</div>
</div>
</div>
</body>
</html>
Remove this line -->
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
Originally posted by Waz: Have you tried putting a JSCHART in one to see what it does ?
Yes, that was part of my project a few months ago. The bottom right panel has a range of charts that can be displayed. The charts are selected using a drop-down control.
I just form a hyperlink to the selected WebFOCUS chart. I use JavaScript when the drop-down is changed and change the iframe's src property to the hyperlink (The iframe resizes with the panel/div... see this thread: [CASE-OPENED] auto fit iframe in htm file ).
The chart runs and loads into the iframe, no problem.
I'm not at work now, but I can post some more code tomorrow morning.
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
Originally posted by Squatch: Well, if you get inline jscharts to work with this, that will be interesting. The iframe technique works well for me.
I was able to get inline JavaScript charting software to work with the example code. The charting software I used is open source and called "Chartist.js". It will insert SVG charts into HTML divs, and the SVG resizes when the div does.
I've modified the example to include CSS and script links to where this software exists online, so it doesn't need to be downloaded locally.
The chart will load into div #4 in the example. Two additional classes are needed by the charting software.
I got the chart to work in short order, but found that divs #3 and #4 would no longer stack vertically. The reason was the media queries weren't operating correctly for div #4, which contains the chart.
Original media queries looked for div elements that had the "display_cell" class, then changed div properties to make the divs stack.
But I did not realize that this meant "Find all divs with only one class called "display_cell". That worked in my original example because there was only one class in each div. But in div #4, the charting div, there were now three classes, so the search failed and the stacking didn't happen.
So I changed the media queries to look for divs that contain class "display_cell" instead. Adding an asterisk before the equal sign does that.
Below is the modified responsive design example. Remove the first and last lines before opening in a web browser.
<!-- Remove this line
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
<script>
function draw_chart() {
new Chartist.Line('.ct-chart', {
labels: [1, 2, 3, 4, 5, 6, 7, 8],
series: [
[1, 2, 3, 1, -2, 0, 1, 0],
[-2, -1, -2, -1, -2.5, -1, -2, -1],
[0, 0, 0, 1, 2, 2.5, 2, 1],
[2.5, 2, 1, 0.5, 1, 0.5, -1, -2.5]
]
}, {
high: 3,
low: -3,
showArea: true,
showLine: false,
showPoint: false,
fullWidth: true,
axisX: {
showLabel: false,
showGrid: false
}
});
}
</script>
<style>
body {
width:100%;
height:100%;
background-color:#efefef;
font-family:Calibri,sans-serif;
font-size:62.5%;
margin:8px auto;
margin-top:1%;
margin-bottom:1%;
}
.display_table {
display:table;
background-color:lightgray;
width:100%;
}
.display_cell {
display:table-cell;
width:50%;
font-size:1.6em;
}
#container {
width:100%;
-webkit-box-shadow: 0px 0px 6px 3px rgba(0,0,0,0.47);
-moz-box-shadow: 0px 0px 6px 3px rgba(0,0,0,0.47);
box-shadow: 0px 0px 6px 3px rgba(0,0,0,0.47);
}
/* CSS Media Queries */
@-ms-viewport {
width: device-width;
}
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
[class*="display_cell"] { display:block; width:100%; }
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
[class*="display_cell"] { display:table-cell; width:50%; }
}
/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
[class*="display_cell"] { display:block; width:100%; }
}
/* iPads (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
[class*="display_cell"] { display:table-cell; width:50%; }
}
/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
[class*="display_cell"] { display:table-cell; width:50%; }
}
/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
[class*="display_cell"] { display:block; width:100%; }
}
/*********
iPad 3
*********/
@media
only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape)
and (-webkit-min-device-pixel-ratio : 2) {
[class*="display_cell"] { display:table-cell; width:50%; }
}
@media
only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait)
and (-webkit-min-device-pixel-ratio : 2) {
[class*="display_cell"] { display:block; width:100%; }
}
/* Desktops and laptops ----------- */
@media only screen
and (min-width : 1224px) {
[class*="display_cell"] { display:table-cell; width:50%; }
}
/* Large screens ----------- */
@media only screen
and (min-width : 1824px) {
[class*="display_cell"] { display:table-cell; width:50%; }
}
/* iPhone 4 ----------- */
@media
only screen
and (min-device-width : 320px)
and (max-device-width : 480px)
and (orientation : landscape)
and (-webkit-min-device-pixel-ratio : 2) {
[class*="display_cell"] { display:block; width:100%; }
}
/* LG Optimus L70 portrait ----------- */
@media
only screen
and (min-device-width : 384px)
and (max-device-width : 640px)
and (orientation : portrait) {
/* Styles */
[class*="display_cell"] { display:block; width:100%; }
}
/* Nokia N9 portrait ----------- */
@media
only screen
and (min-device-width : 360px)
and (max-device-width : 640px)
and (orientation : portrait) {
/* Styles */
[class*="display_cell"] { display:block; width:100%; }
}
@media
only screen
and (min-device-width : 320px)
and (max-device-width : 480px)
and (orientation : portrait)
and (-webkit-min-device-pixel-ratio : 2) {
/* Styles */
[class*="display_cell"] { display:block; width:100%; }
}
</style>
</head>
<body onload="draw_chart()">
<div id="container">
<div class="display_table">
<div id="panel1" class="display_cell" style="background-color:#efefef;padding:4px">
<center><h3>DIV #1</h3></center>
This is an example of responsive design using HTML DIV tags,
the table-cell display property and CSS media queries.
<br><br>
Four colored HTML DIVs will be displayed, each with text inside of
them.
<br><br>
The DIVs will have their display properties set to "table-cell" if
there is enough room on the display device, which will result in
two DIVs on top and two on the bottom.
<br><br>
If there is not enough width on the display, the DIVs will have their display
properties set to "block" instead. This will result in all four DIVs being
stacked vertically on the display.
<br></br>
This is accomplished by using CSS media queries, which can change
CSS properties based on the size of the display device. The devices are
tested for both portrait and landscape display modes.
<br><br>
The code for this example is a mix of HTML and CSS, and can be
saved to a local disk file and opened without a web server.
<br>
</div>
<div id="panel2" class="display_cell" style="background-color:#bbffbb;padding:4px">
<center><h3>DIV #2</h3></center>
DIVs can be made to act like cells in an HTML table by changing their display
property to "table-cell" and placing them inside a DIV that has its display
property set to "table".
<br><br>
In this example, there are two "table" DIVs, each with two "table-cell" DIVs
inside of them. This results in what appears to be a 2 by 2 set of text panels.
Each table-cell DIV in each table DIV gets 50% of the display width.
<br><br>
When the browser is resized or a mobile device is changed to either portrait or
landscape mode, one of a group of CSS media queries for the appropriate display
screen size is executed. The table-cell DIVs will have their "display" and "width"
properties adjusted. These CSS properties will be either "display:block" and
"width:100%" (vertically stacked DIVs), or "display:table-cell" and "width:50%"
(for a 2 by 2 display).
<br></br>
The CSS media queries in this example cover a large number of possible mobile
devices, so you should be able to copy and paste them into your projects.
<br>
</div>
</div>
<div class="display_table">
<div id="panel3" class="display_cell" style="background-color:lightyellow;padding:4px">
<center><h3>DIV #3</h3></center>
An example of a CSS media query is shown below:
<br><br>
<code>
/* iPhone 4 ----------- */<br>
@media<br>
only screen
and (min-device-width : 320px)<br>
and (max-device-width : 480px)<br>
and (orientation : landscape)<br>
and (-webkit-min-device-pixel-ratio : 2) {<br>
[class*="display_cell"] { display:block; width:100%; }<br>
}<br>
</code>
<br>
This looks for displays (screens) with a minimum device width of 320px, a
maximum device width of 480px, in landscape mode, and a minimum pixel ratio
of 2. If found, the device is likely an iPhone 4. All DIVs with a class of
"display_cell" will have their display properties set to "block" and their
width properties set to "100%", resulting in all the DIVs being stacked
vertically on the iPhone 4.
<br>
</div>
<div id="panel4" class="display_cell ct-chart ct-perfect-fourth" style="background-color:white;padding:4px">
<center><h3>DIV #4</h3></center>
</div>
</div>
</div>
</body>
</html>
Remove this line -->
This message has been edited. Last edited by: Squatch,
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
FYI, based on the Summit, 8.2.01 actually seems to work with responsiveness. I know they seemed to have fixed a lot of the bugs I saw in 8.1.05 portal.
- FOCUS Man, just FOCUS! ----------------------------- Product: WebFOCUS Version: 8.1.04 Server: Windows 2008 Server
I second Gavin on this one. They actually did some real good between 8.1.05 and 8.2.xx with responsive behavior both with the portal and with AppStudio. They now have included a new property to axe iframes and use divs within the HTML Canvas tool in AppStudio among other things. They also integrated their responsive templates more fully into the product itself, along with adding the ability to create and edit existing or new CSS within the portal or pages for portals. I actually was impressed.
But kudos to Squatch for digging into the code and sharing these awesome examples with us! Thanks Squatch!
8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
Posts: 1113 | Location: USA | Registered: January 27, 2015
It's GA release is set for September (version 8.2.01). That version will not support migration from any other version. Support for previous 7.x and 8.0/8.1 versions does not come until 8.2.02. Be forewarned...
8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
Posts: 1113 | Location: USA | Registered: January 27, 2015