PRIM_TILE content alignment

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
lansalata
Posts: 2
Joined: Wed Oct 12, 2016 7:12 pm

PRIM_TILE content alignment

Post by lansalata »

Hi,

in my web page I have a panel containing a PRIM_TILE control (from 1 to 5 tiles, so I can't set a fixed width).

I would like to center horizontally this block so I set "Center" alignment and "Content Width" size but it doesn't work because it is resized to the width of the single tile (with a vertical scroll bar) and not to the total width.

This is what I want (I used fixed width):

Image

This is what I get:

Image

How can I fix it?

Thanks
Fabio
LANSAGuru
Posts: 69
Joined: Thu Mar 24, 2016 5:31 am

Re: PRIM_TILE content alignment

Post by LANSAGuru »

Content width makes no sense in this context. Tiles are meant to grow and shrink in a given area to fit in as many tiles as possible so there is no predefined content to fit a width to. You want to use fit to width instead.

In an nutshell you want to size the tile to content height and fit to width. You may want to add some padding. You will also want to add some space for header and footer. The layout row should be sized to content so it keeps growing and forces the entire page to have a scroll bar on the side (no scroll bar for the tile control itself.

There are several ways to accomplish the same thing. Header and footer could also use the attachment layout instead of table layout.

I have attached an example. This is a quick export zip. Unzip and then in the IDE use the import tool to import this example. This was created using version V14SP1.
Attachments
QuickExport20161020172439.zip
(11.87 KiB) Downloaded 1059 times
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: PRIM_TILE content alignment

Post by Stewart Marshall »

Hi Fabio

You're trying to make Prim_Tile do something that it wasn't designed to do. It's really aimed at large volume scenarios where there are many items that need to flow and wrap as the page resizes.

Where there is only a small number, you can either statically define the items and show or hide as required, or you can make reusable part instances dynamically at runtime. This requires a few lines of code, but is a very powerful technique.

See the attached example.
Untitled.png
Untitled.png (15.41 KiB) Viewed 6380 times
When the button is clicked, a panel instance is created. A layout item is then created to manage the sizing and position of the part. The row, column, and flow are set just as they would be if you were using the ribbon to layout some panels in the designer.

Regards
Attachments
Tiles.zip
(10.55 KiB) Downloaded 927 times
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply