Icefaces and ActiveXObject - jsf-2

I am trying to create a panelPopup with Icefaces JSF library.
I use Netbeans and Glassfish. I properly installed the Icefaces Netbeans integration plug-in and created the small test project as an Icefaces project on Netbeans.
When tested, the popup dialog is not really pop out of the page (it is embedded on the page)
The Firebug (when tested on FF) reports as "ActiveXObject not defined".
But the output is constant across FF, IE, Chrome and Opera (all latest versions)
The page code as follows:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:icecore="http://www.icefaces.org/icefaces/core"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head>
<title>ICEfaces 2</title>
<link rel="stylesheet" type="text/css" href="./xmlhttp/css/rime/rime.css"/>
</h:head>
<h:body styleClass="ice-skin-rime">
<h:form id="form">
<ice:panelPopup rendered="true" visible="true">
<f:facet name="header">
popup header contents
</f:facet>
<f:facet name="body">
popup body contents
</f:facet>
</ice:panelPopup>
</h:form>
</h:body>
<h:outputStylesheet library="org.icefaces.component.skins" name="rime.css" />
</html>
Please anyone advice me what is this.

ActiveXObject is a MSIE proprietary JavaScript object. That the error seems to appear in Firefox, I'd bet that the involved JavaScript code is incorrectly using browser detection instead of feature detection and somehow detected your Firefox browser as being a MSIE browser and carelessly attempted to allocate an ActiveXObject instance.
Or, more worse, the JavaScript code is relying that the ActiveXObject is supported by all target webbrowsers and is using it carelessly without doing any browser or feature detection. This browser-wide support is actually untrue, it's only supported by the creation of Microsoft.
That's all what can be said on the information provided as far. You've to run a JavaScript debugger (Firebug? Venkman? etc) and nail down the culprit in the JavaScript code, eventually backtrack it to the server side code and then fix it accordingly or report it to the responsible maintainer.

Related

Spell checker in TWebBrowser (TEmbeddedWB) control

Internet Explorer 10 has built in spell checker and it works just fine. I tried to create a small HTML page to test it with following contents:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META name=GENERATOR content="MSHTML 10.00.9200.16721"></HEAD>
<BODY spellcheck=true contentEditable=true style="MARGIN: 0.5em">
<P>Theze ara mispeled wordz</P>
</BODY></HTML>
All that is needed is to put properties spellcheck=true and contentEditable=true.
I also tried adding <meta http-equiv="X-UA-Compatible" content="IE=10" /> e.g.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<META name=GENERATOR content="MSHTML 10.00.9200.16721"></HEAD>
<BODY spellcheck=true contentEditable=true style="MARGIN: 0.5em">
<P>Theze ara mispeled wordz</P>
</BODY></HTML>
For that matter, using IE=edge instead of IE=10 doesn't make any difference:
What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?
I then tried adding setting FEATURE_BROWSER_EMULATION to registry:
http://www.west-wind.com/weblog/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version
This improved rendering of certain elements which had CSS styles like border-radius so at least I could see it is in IE10 mode, but still no spell checker.
The above page works in Internet Explorer browser and spell check is working.
However, when same content is loaded into TWebBrowser (I use TEmbeddedWB but it is just the same wrapper anyway) it doesn't work.
After googling and googling for solutions, still haven't found one. Do you know is this even possible in WebBrowser control? I need the solution that would work on Windows 7 not just Windows 8. I've seen the registry entry FEATURE_SPELLCHECKING but it applies only to Windows 8.
Are there any alternative solutions that would work within DesignMode of TWebBrowser control? I am looking for curvy red underline thing like in Word or other programs and possible GUI window to offer alternative words.
I think you are out of luck here.
There was a bug report on Microsoft Connect concerning FEATURE_SPELLCHECKING and windows 7. Unfortunately it has been closed "as Designed".
This is the official answer from Microsoft:
Thank you for your feedback.
After additional review, the spelling feature is only supported on
Windows 8 and higher and is not supported on Windows 7. This is
because the spelling feature was built into the Windows 8 platform.
Best regards,
The Internet Explorer Team
try to change it in the registry...
Bye
Nicolas Perichon
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
SOFTWARE Microsoft Internet Explorer Main FeatureControl
FEATURE_BROWSER_EMULATION
contoso.exe = (DWORD) 000090000
10001 (0x2711)Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.
10000 (0x02710) Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10.
info de Microsoft:
msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation

IPAD IOS 6 not displaying Report in Telerik Report Viewer

We are having issues where IPAD IOS 6 not displaying Report in Telerik Report Viewer.
We have an MVC ASP.NET application which calls the ReportViewer.
But Report Viewer does not display the report when the 'Preview' button is selected.
Can you suggest how I can display the telerik report in IPAD IOS 6. Hint: It works in IPAD IOS lower versions than current new version.
Thanks in advance.
I am quite sure that by now you have solved your problem. However, for other people experiencing the same, the problem is often caused by the document being rendered within an iframe and the page uses HTML5 DOCTYPE. I have resolved this issue changing this:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
.....
to this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
.....
as recommended here.

How to implement JSF in Backbase Portal 5.2.1.2?

I am currently trying to add basic JSF (2.0) support to Backbase Portal 5.2.1.2 to use in my custom widgets.
It seems to be working when I access my widget in a static way (e.g. ".../portal/static/portal_name/widgets/widget_name/index.xhtml"), but when I view my widget in the context of a portal (.../portal/portals/portal_name/pages/index) my JSF tags are shown in the HTML source as instead of the parsed output. The same happens to EL variables like #{msg.title}.
If I use the same JSF setup in a 'normal' webapp project, it works just fine as well, so in my eyes, there must be something Backbase specific that is causing this issue.
I would like to know what is causing this to happen, if it could be solved or circumvented or if anyone has successfully managed to implement JSF in this specific version of Backbase. I know implementing JSF worked in Backbase 5.1, but for me it's not an option to revert to that version.
Edit - Added the widget's index.xhtml by request (My actual index.xhtml is slightly bigger, but this fails as well):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xml:lang="en">
<h:head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Help ribbon widget</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</h:head>
<h:body>
<span class="left title">#{msg.help_title}</span>
<h:outputText value="TEST"/>
</h:body>
</html>
Additionally I am using a Border_Layout for my container template if that is of any help.
When I go to Google Chrome inspector's network tab, and look at the request for the widget's index.xhtml file, I can see the correct output, but for some reason this is not the same as what is shown in the combined html.
The problem with this approach is that widget definitions are not currently expected to contain dynamic content.
I'd guess that in your scenario, the *Border_Layout* container is server sider rendering (SSR) the widget. When this happens, if your widget's src URL is relative, the portal will simply read the file from disk and the faces servlet will never be invoked. This is normal, the definition is expected to be static. But there are two immediate solutions:
Firstly, you can switch to client side rendering (CSR). This will result in the client making a http request for the widget definition and it being accessed via the faces servlet. Easiest way to achieve this is to use a custom page template which does not contain a <b:include> tag. This solution does mean it will not work with JS disabled though.
If, however, you wish to keep using SSR, you can use an absolute url for your widget's src property. This means the server needs to make an http request for the widget, thus running it through the faces servlet. There is one more problem here; As the Portal Server expects widget definitions to be static, it will aggessivley cache it, so you'll need to switch off widget caching.
I wouldn't really recommend both of these solutions though in the longer term. I'd recommend you run your JSF app independently in a separate context and then find a way to include it in a widget. You could try to setup something with Backbase Mashup Services, but I'd recommened a simple iframe approach. If you require, I can provide you with a more advanced iframe Backbase widget for creating seamless iframes (no scrollbars etc).
If you need any more support, I'd encourage you to sign up at https://my.backbase.com. Backbase's new support site where you should receive more dedicated help, docs and code samples.

iPad Home Screen Web App Failure

We've got an ipad web app that needs all the screen real estate it can get. The plan is to use the "add to home screen" functionality once the app is done. However, we've run into a major issue when launching the app via the home screen. When using the HTML5 doctype, the page simply seems to render as plain text (none of the stylesheets or javascript files are loaded). Instead, using the XHTML 1.0 Transitional Doctype causes the page to render correctly, but we're using jQuery Mobile, which requires an HTML5 Doctype to work.
I've made attempts to simply use 'full screen' meta tags and such, but they don't seem to work either. This is the current state of our header code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--<!DOCTYPE html>-->
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>PAGE TITLE</title>
<link href="favicon.png" rel="icon" type="image/png" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
<!-- cut other stylesheets and javascript files being loaded -->
<link rel="stylesheet" href="/Vertex.Web/Content/style/tablet/tablet.css" type="text/css" media="all" />
From the research I've done, it sounds like the ipad uses a web.app instead of safarimobile.app when it launches from the home screen. I'm wondering if this is at least part of the problem. One other thought is that the ipad is trying to use a local cache when launching from the home screen, and it's just not liking the relative paths or external URLs when loading stylesheets and javascript.
Fun fact: using both Doctypes in the page will cause correct rendering the first time we open up the page from the home screen, but further attempts will fail due to a parse error (which is expected, since it's a terrible, terrible solution)
Try to add a manifest file, read more here
https://developer.apple.com/library/archive/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html

MyEclipse does not recognize JSF tags

I am new to JSF 2
I have tried to setup a sample JSF 2 Web application, but I have a problem.
I am using myeclipse 8.6 and weblogic 10
I have created a new Web project in myeclipse. Then I added facelet 1.1 and myfaces 2.0.4 libraries to the classpath of my project. I also have added primefaces 2.2.1 API to my project. Then I tried to create a new XHTML file.
My Eclipse does not recognize some tags like "<h:head> and <h:body>", and it does not
recognize primefaces tags. I still have problem with this.
What should I do?
Have you added the tag libraries in your XHTML file ?
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui">
</html>

Resources