ClientDisplayInformation is not working

This forum is intended for cases when a problem can not be solved due to restrictions of the platform: a bug or lack of functionality.

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 1, 2014
Company: Smart ID Dynamics

ClientDisplayInformation object is not working.
Timofey please give me a solution to fix this problem.

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Marius Gidu.

Please provide more details: what you are trying to do and which error message do you receive?

 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 1, 2014
Company: Smart ID Dynamics

I`m trying to get DPI, Width and Height of the mobile device.

Variable is not defined (ClientDisplayInformation) this is the error.

 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

This feature was added in 1C:Enterprise platform 8.3.6. Are you sure you are using this version?

 
#5
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 1, 2014
Company: Smart ID Dynamics

I`m using 1C:Enterprise 8.3 (8.3.6.2100).

 
#6
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

I suppose you are trying to use it in the incorrect way. This is the type, returned by the GetClientDisplaysInformation() function.

Please see the following example:

Code
   ClientDisplaysInformation = GetClientDisplaysInformation();
   For Each CurClientDisplaysInformation In ClientDisplaysInformation Do
      Message(CurClientDisplaysInformation.DPI)
   EndDo;

 
#7
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 1, 2014
Company: Smart ID Dynamics

Thanks. But the documentation offered by this site and syntax assistant of the platform are both wrong. Just read and you will see.

On site: What's new in mobile platform
Window management. The option to handle the change of mobile device display parameters is now available.
The OnChangeDisplaySettings event handler is implemented. The event occurs when the client application display parameters are changed.
The Width and Height properties of the ClientDisplayInformation object store the actual values (which depend on the screen orientation).
This feature was not provided.
The platform could not detect the changes of display parameters.
The Width and Height properties of the ClientDisplayInformation object stored constant (canonical) values.
You can handle the display size changes caused by mobile device orientation changes or by connecting the mobile device to external displays. You can create applications with better usability.


In syntax assistant:

ClientDisplayInformation
Properties:

DPI
Height
Width

Description:

Used to describe the display of the client device.

Availability:

Thin client, web-client
, server, thick client, external connection, Mobile application (client), Mobile application (server).


ClientDisplayInformation
DPI
Usage:

Read only.
Description:

Contains the display resolution (DPI).

Availability:

Thin client, web-client, server, thick client, external connection, Mobile application (client), Mobile application (server).


etc

 
#8
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

And what do you think is wrong here?

In the description of the GetClientDisplaysInformation() function it is said that it returns an array where elements have ClientDisplayInformation type. This is what I have demonstrated in the example: traversing the array and printing the property of its items.

You don't need to create ClientDisplayInformation object, you have it returned by the function.

 
#9
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 1, 2014
Company: Smart ID Dynamics

Sorry i didn`t see in syntax assistant GetClientDisplaysInformation() function, but now i found it and i tried the method you provided and it works.

Thanks a lot.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.