Wednesday 9 January 2013

APEX 4.2 User Interface Detection

The User Interfaces that have been added to APEX 4.2 have a few properties to help define what URL should be resolved - hence whether you see a page designed for a mobile or desktop.

After testing these to determine behaviours as the values change, I find it would make an easier flow chart to follow.

User Interface Properties
If Auto Detect is off, it will render the default UI
If Auto Detect is on, and hardware matches UI, this will override default.

Should auto detect fail, or no default are specified when auto detect is off for both interfaces, APEX will display the following page.
Page seen when no default and auto detect is off
This page was also displayed when auto detect was on for both UIs on a Samsung tablet, so probably best to define at least on default.

Order of the list is defined by UI Sequence - which is the only display this property seems to affect - nothing within the builder.

This screenshot captures the default appearance, but you can override the stylesheet used by using the User Interface Detection CSS File URLs property, under application properties.

ADMIN 01 - User Interface Selection

Please select a user interface from the list below:
Media queries are also accetable
[media="only screen and (max-device-width: 480px)"]/mycss/smartphone.css
So those with good CSS kung fu could really make that a page professional looking entry point, should your application require it. Of course, you could build your own page using the dictionary view  APEX_APPL_USER_INTERFACES, and make it look however you want declaratively.

And of course, the page that initially opens will be the relevant home page URL for the user interface used, and the relevant login page should authentication be required.

The exact mechanics behind the detection is not known - David Peake wasn't sure off the top if his head when I asked him about it in Melbourne. If anyone knows, I'd be interested.
What he did suggest, however, is that Tablets will be available as a User Interface option in a future APEX release. I predict perhaps SmartTVs will also be a future option.



Anonymous said...

Hi Scott,

the detection code is basically a case expression with regexp functions on the USER_AGENT header. It's similar to what other toolkits do. We have hooks in place to also do some client-side detection in JavaScript, but that's not yet implemented.


Scott Wesley said...

Thanks Chris - I figured it might be something like that.

Damir Vadas said...

Have you tried this for login pages (desktop interface)?

Changing alias of page either in interface part or in login page ... and of in a case if you change both of them (what seems to be logic step), result that login page become a "Dynamic form" (instead of "Login") and THROTTLE mechanism is freez after login failure.
You can look in mine discussion on Apex forum ...

Any advice is more then welcome.
Damir Vadas

Scott Wesley said...

I'm aware of the thread - I directed you here.

I think you'll find changing alias / recreating login != throttle issues

I see the same symptom at my current site - just haven't investigated why yet since it doesn't stop logging in - I wait 5 seconds - message remains because of some form of script failure - but login is ok.