Servoy6 iframe css gereration bug

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Servoy6 iframe css gereration bug

Postby socorro » Mon Mar 12, 2012 12:04 pm

Hi ALL,

After migrating our web client application in Sevoy 6 , IE is not displaying the forms properly (using iframe)

I found the problem: servoy form css is generating “#sv_*” instead of “#id*.
For that reason the servoy form elements can not find their respective css.

Next If a open a new tab and run directly the link http://xxx/servoy-webclient/solutions/s ... I,0,,0,312 everything is Ok and also the page containing the iframe becomes immediately refreshed and the form is displayed properly.

Here the pictures:
1.-Example
<html>
<head>
<title>Your title</title>
</head>
<body style='margin:0px; padding:0px;'><center>
<iframe src="http://xxx/servoy-webclient/solutions/solution/wstb_training_webreg/method/webr_app_start/argument/AGAI,0,,0,312" height="100%" width="70%" scrolling="no" frameborder='0' marginwidth='0px' marginheight='0px' style='margin:0px; padding:0px; border-size:0px;'>Warning text.</iframe>
</center>
</valign>
</body>
</html>

2.-Bad
bad_style.JPG
Bad Results
bad_style.JPG (226.03 KiB) Viewed 4477 times


3.-Good
final.jpg
Good Results
final.jpg (344.82 KiB) Viewed 4477 times

Is it a bug?
Cheers,
Socorro Moorlag-Marquez Mejia
http://www.stb.nl
Last edited by socorro on Mon Mar 12, 2012 12:45 pm, edited 2 times in total.
Servoy Developer
STB Automatisering & Advies BV
SAN Partner
socorro
 
Posts: 7
Joined: Fri Dec 14, 2007 6:38 pm

Re: Servoy6 iframe css gereration bug

Postby ngervasi » Tue Mar 13, 2012 12:16 am

Is your iFrame loading from an external server (cross domain)? I had the same issue with cross-domain iframes in IE. Try to host the iFrame page in servoy's tomcat to see if the issues is due to that.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Servoy6 iframe css gereration bug

Postby socorro » Tue Mar 13, 2012 12:44 pm

Hi ,
with servoy 5 we did not have this problem...
Servoy Developer
STB Automatisering & Advies BV
SAN Partner
socorro
 
Posts: 7
Joined: Fri Dec 14, 2007 6:38 pm

Re: Servoy6 iframe css gereration bug

Postby ngervasi » Tue Mar 13, 2012 12:57 pm

Ok but did you try to host the main page inside servoy's tomcat to see if it's the issue I mentioned?
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Servoy6 iframe css gereration bug

Postby norbert » Wed Mar 14, 2012 8:15 am

Hi,
We have the same problem running our solution in an iframe. Even when loaded in a page on the same Tomcat instance.
User avatar
norbert
 
Posts: 24
Joined: Tue Apr 26, 2011 5:24 pm
Location: Almere

Re: Servoy6 iframe css gereration bug

Postby socorro » Mon Mar 26, 2012 1:29 pm

I found the solution in the wiki.servoy.com (http://wiki.servoy.com/display/public/t ... +an+IFrame)
Many thanks
Socorro

Running Servoy Web Client inside a Frame or IFrame

By default, a Web Client runs in the main browser window, but it is possible to run the Web Client inside a Frame/IFrame embedded in another webpage.

When running a Web Client inside an Frame or IFrame (here onwards just called frame) and the domain of the page into which the frame is embedded (for example: http://www.mycompany.com/pagewithframes.html) does not equal the domain from which the Web Client is hosted (for example http://mycompany.hostingcompany.com), there is a possible issue with the ability of storing HTTP Cookies.

Based on the settings of the browser, these so-called Third Party Cookies are blocked from storage. Internet Explorer does this by default, most other browsers allow it by default, but this can be turned off by the user.

The Web Client uses HTTP Cookies to save the position and location of dialogs and the functions application.setUserProperty(...) and application.getUserProperty(...) also utilize Cookies for string the User Property value. If the cookies cannot be stored, the Web client will continue to operate, but the position and sized of the dialogs and the value of User Properties will not be remembered.

The only remedy to the issue is configuring the browser to accept Third Party Cookies and this needs to be done by the user. As Internet Explorer does not allow Third Party Cookies by default, this browser is usually the one that causes Problems. Luckily, for Internet Explorer there is something that can be done by the developer of the webpage that is being displayed in the frame.

Adding a "Compact Privacy Policy" header to the Web Client pages
A Compact Privicy policy header is a specific header in the HTTP Response of a Web Client page, with a compact description of a Platform for Privacy Preferences (P3P) policy.

P3P is a standard for websites to provide the users of the website with information about the usage and possible storage of privacy related data. See http://www.w3.org/P3P/ for more information. Although the standard never really took off and isn't widely supported, it will come in handy in this scenario as Internet Explorer does implement it.

A P3P policy can be created online using http://p3pedit.com/ or with a downloadable tool provided by IBM here. When generated, it will also produce the Compact Privacy Policy string required for the configuration below.

Having said all of the above, many sites skip the generation of a full P3P policy and just take a appropriate value from the many websites that discuss the use of third party cookies in Internet Explorer and move on. The description of the required configuration below uses such a value, but we encourage developers/admins to set it up properly.

The P3P Compact Privacy Policy header can be added to all Web Client pages served by the Application Server, by adding and configuring a Filter in the webserver used by the Servoy Application Server.

The Filter is a small Java library and can be downloaded here: FilterP3P.jar. Place the downloaded jar file in <serverUrl>/application_server/server/webapps/ROOT/WEB-INF/lib (create the lib directory iif it doesn't yet exist).

Secondly, open <serverUrl>/application_server/server/webapps/ROOT/WEB-INF/web.xml and add the filter configuration shown below between the "</servlet-mapping>" and "</web-app>" tags.

Replace the value of the param-value with the generated Compact Privacy Policy string.


web.xml

...
<filter>
<filter-name>P3PHeaderFilter</filter-name>
<filter-class>com.servoy.extensions.server.filter.P3PHeaderFilter</filter-class>
<init-param>
<param-name>P3P-value</param-name>
<param-value>CP="CAO PSA OUR"</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>P3PHeaderFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
The other option: Altering the Security level in Internet Explorer on every client machine
By default the privacy level setting of Internet Explorer is set to Medium. This setting can be found under Tools > Internet Options > Privacy tab.
When the level is set to Medium, third party cookies without a Compact Privicy Policy will be blocked. By altering the privacy level to the lowest level "Accept All Cookies" the third party cookies will get accepted. Although this works, it means that in order to be able to use the Solution properly the setting needs to be altered in the browser of all individual users. It can be that corporate IT departments restrict the user from altering this setting.

Cookies without Compact Privicy Policy: These are cookies from pages that do not include a so-called P3P header in the HTTP Response
Servoy Developer
STB Automatisering & Advies BV
SAN Partner
socorro
 
Posts: 7
Joined: Fri Dec 14, 2007 6:38 pm

Re: Servoy6 iframe css gereration bug

Postby ngervasi » Mon Mar 26, 2012 1:39 pm

So it really was a cross-domain issue then, glad you found a workaround.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy


Return to Web Development

Who is online

Users browsing this forum: No registered users and 5 guests