Using a Map in a Form popover is not acting correctly RDMLX

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
dhnaigles
Posts: 28
Joined: Tue May 08, 2012 12:13 am

Using a Map in a Form popover is not acting correctly RDMLX

Post by dhnaigles »

I want to display a map in a popover. I want the popover to have a height of 60% and I want the map to take the entire space of the popover. I have code that looks like this:

#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Row_N(1) Grid_Row_Height(60%) Show_Popover(True)
#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Col_N(1) Grid_Col_Width(100%)
#COM_OWNER.Set_Map Name('/Form.Popover.fields.map') Layout_Col(1) Layout_Row(1)

The popover does take up 60% of the height of the form, but the Map only takes up 60% of the height of the popover

I believe this is a bug, but I may be wrong. Please prove me wrong.
Regards,

David
Paul

Re: Using a Map in a Form popover is not acting correctly RD

Post by Paul »

There are a couple of things to this.

Firstly, the first line in the supplied code is setting grid row 1 of the popover form to a height of 60%. The map occupies grid row 1 of the popover form and so only takes up 60% of the popover.

This line of code is not necessary if the map is to take up 100% of the popover height.

Secondly, the popover is determining its own size based on content. You don't seem to be having a problem with the Popover size but if you wanted to control this you would have to set the popover form's layout height and width properties.

With popover size and position, it's important to remember that the OS will have the last say and will fit the popover where it can if it is pushed for space.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: Using a Map in a Form popover is not acting correctly RD

Post by stevec »

The goal is to make the popover 60% of the screen size. This accomplished that but the map only takes up 60% of the popover and I want it to be 100% of the popover (60%). I've tried many combinations and cannot find a solution.

Any Ideas?
Paul

Re: Using a Map in a Form popover is not acting correctly RD

Post by Paul »

The example code David provided is not setting the size of the popover. It's setting the height of the grid row of the popover that the map is on.

That's why the map is only taking up 60% of the popover. The popover is determining it's own size based on content.

Try setting the Grid_Row_Height in the first line of the code to 'Fit'.
dhnaigles
Posts: 28
Joined: Tue May 08, 2012 12:13 am

Re: Using a Map in a Form popover is not acting correctly RD

Post by dhnaigles »

Paul, as I am stuggling to understand the exact code to perform what I want to do, could you please just provide a sample that will solve this situation. Thanks.
Regards,

David
Paul

Re: Using a Map in a Form popover is not acting correctly RD

Post by Paul »

Yes, I will try this out when I get a chance and post a sample.
Paul

Re: Using a Map in a Form popover is not acting correctly RD

Post by Paul »

Set the main form to show a popover

Code: Select all

#COM_OWNER.Set_Form Show_Popover(True)
Set up a form popover

Code: Select all

#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Col_N(1) Grid_Col_Width(100%)
Add a map to the popover

Code: Select all

#COM_OWNER.Set_Map Name('/Form.Popover.fields.map') Layout_Col(1) Layout_Row(1) Layout_Height(400)
This produces a popover roughly 60% of my iPad screen by controlling the size of the map and letting the popover determine its own size. The Layout_Height and Layout_Width parameters of the set_Map method can be adjusted as desired. Note that percentage values are not valid for Layout_Height and Layout_Width parameters.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: Using a Map in a Form popover is not acting correctly RD

Post by stevec »

Thanks Paul that worked good on my phone, will test ipad and galaxy tomorrow at work.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: Using a Map in a Form popover is not acting correctly RD

Post by stevec »

Well it is no where near the 60% size I want on my Ipad, more like 40%. That is what I expected with your hard coded pixel size. But it looked right on iphone.

How can I set the pop over map to 60% of my screen, help!
dhnaigles
Posts: 28
Joined: Tue May 08, 2012 12:13 am

Re: Using a Map in a Form popover is not acting correctly RD

Post by dhnaigles »

Use this:

Code: Select all

If Cond(#COM_OWNER.ScreenOrientation = 'PORTRAIT')
#std_num := #com_owner.DevicePixelHeight * .60
Else
#std_num := #com_owner.DevicePixelWidth * .60
Endif
#COM_OWNER.Set_Form Show_Popover(True)
#COM_OWNER.Set_Form Name('/Form.Popover') Grid_Col_N(1) Grid_Col_Width(100%)
#COM_OWNER.Set_Map Name('/Form.Popover.fields.map') Layout_Col(1) Layout_Row(1) Layout_Height(#std_num)
Regards,

David
Post Reply