[SOLVED] ResponsiveProfileChanged Event (WiseJ 2.0.47.0)

Answered Closed
0
0

Hi,

I’m using ResponsiveProfileChanged event in Wisej 2.0.47.0

there is same problems…

boolean e.CurrentProfile.Landscape return often null value and do not alway respond to rotation

regards

Cristian

  • You must to post comments
Best Answer
0
0

The CurrentProfile object refers to the current profile that matched the device out of the ClientProfiles.json – it’s to the description of the device. To read the properties of the device use Application.Browser.

If the matched profile doesn’t specify the landscape property it’s left undefined (null, it’s a int?). When set to true (or false) it adds a matching condition to the profile meaning that that the height > width or viceversa, otherwise it’s ignored.

Client profiles are matched from to bottom and the first that matches is used (it’s not a best match selection). You can define a custom set of rules, add a new ClientProfiles.json to your app (Add -> New Items -> templates) to override the built-in one:

 

{
 "profiles": [
 {
 "name": "Phone",
 "maxWidth": 450
 },
 {
 "name": "Phone (Landscape)",
 "landscape": true,
 "maxWidth": 600
 },
 {
 "name": "Tablet",
 "maxWidth": 800
 },
 {
 "name": "Tablet (Landscape)",
 "landscape": true,
 "maxWidth": 1024
 }
 ]
}

HTH

  • You must to post comments
0
0

Hi Luca,

I think there is a little bug

if I have the smarthone (Samsung Note 9) potrait,

1) I open the page, then e.CurrentProfile.MaxWidth is right

2) I rotate to landscape and the e.CurrentProfile.MaxWidth return 0

3) if I refresh the page return the right width

 

this problem in the pc browser do not happen, only on Firefox android browser (I have not test IPhone)

Android Chrome do no have this problem

  • Luca (ITG)
    What is e.CurrentProfile.Name when MaxWidth is 0? The values in CurrentProfile are not coming from the browser, they are from ClientProfiles.json.
  • You must to post comments
Showing 2 results