-
FEATURED COMPONENTS
First time here? Check out the FAQ!
First of all I am new on ZK and I am working on a web application after someone else.
I would like to remove the detection of Mobile/Tablet because when the site is accessed from a Tablet device a new css is added (tablet.css.dsp) and elements are changed like from "z-button-os" to "z-button" or from "z-window-embedded-noborder" to "z-window-embedded".
By those changes the layout is displayed wrong.
Can anyone help please?
Hello bakkar,
Please refer to the following url and specifically under the section mobile browser detection, where you can find how to configure, or for your case remove the configuration for a mobile/table.
http://books.zkoss.org/wiki/SmallTalks/2012/November/HowtoApplyResponsive_Design
Best Regards,
Darksu
Thank you for your reply.
The page tells you that it detects the device is a tablet and make changes for you but it didn't tell me how to remove the detection.
From page "If ZK detects the client device (by user-agent) is a tablet, it sets viewport size to device's width and does not allow scaling its screen by meta tags."
Any Ideas?
Hello bakkar,
I was referring to the following code:
// Detect if client is mobile device (such as Android or iOS devices)
public boolean isMobile(){
return Executions.getCurrent().getBrowser("mobile") !=null;
}
If you wish, please also upload you code so we can check it out.
Best Regards,
Darksu
Hi Darksu,
I am Bakkar, I had to use the company account now.
First of all thank you for your patience, ZK is new for me and I am still trying to figure out how it works.
I thought it is something related to configuration, because I have made a full search in the system, searching for the word "mobile". In all places that it found a match I've changed accordingly like in the Index.java there was the following code:
isMobile = Executions.getCurrent().getBrowser("mobile") !=null;
I changed it to
isMobile = false; //Executions.getCurrent().getBrowser("mobile") !=null;
From the above code change i believe i told the system that its always not a mobile device but still giving the same result.
The system is doing the following when it detects it's being accessed from a tablet:
Thanks Again
Moreno,
If you are referring to the custom styles zk adds on mobile devices, you can modify your WEB-INF/zk.xml file to remove these by adding the following:
<!-- Use the same styles regardless of device -->
<library-property>
<name>org.zkoss.zkmax.tablet.ui.disabled</name>
<value>true</value>
</library-property>
Hope this helps.
I think that would work perfectly but according to the documentation its available for version 7.0 up and the version that the system is built on is 6.5.7. I still tried it but no result.
If maybe you know another way i would appreciate it.
Thanks very much
Asked: 2015-02-27 22:53:00 +0800
Seen: 46 times
Last updated: Mar 02 '15