Table control and buttons

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Table control and buttons

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:56 pm

by Torrie >> Mon, 18 Sep 2006 22:41:53 GMT

I was wondering if anyone has come up with a nice way of having a button in a table. While you can set the cell control of the table to be a button, the button is only visible when the cell has the focus. Does anyone know a way of having a button in a table cell that is always visible?

Thanks

Torrie

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Table control and buttons

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:56 pm

by Michael J >> Tue, 19 Sep 2006 5:29:08 GMT

I dont think its possible at least not in the conventional way.

The closest I have got to it is to assign the cellcontrol to a button control and the cell picture to a picture of the same button. It does look approximately right but the first click does not cause the button to change state. Subsequent clicks will correctly 'animate' the button. The other main negative is you effectively have to implement the click behaviour twice (once in the table for the first click, and again on the button control)

I guess you could get round the first click state change by altering the picture in the table events but I didnt go that far (and didnt think I should either).

Jade should certainly offer a simple mechanism for achieving this however..

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Table control and buttons

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:56 pm

by allistar >> Wed, 20 Sep 2006 10:13:21 GMT

You can create a button control and add it to the form, with the table as it's parent. Position it in the right place (there are methods to get the top position of a row and left position of a column). You'll need to catch the appropriate scroll event to move the button when the table is scrolled (and also hide the button if it is scrolled out of view).

This may seem cludgy, but it works surprisingly well and can be rolled into a table framework. The same logic can be used with any control type, not just buttons.

Allistar.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Table control and buttons

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:56 pm

by Torrie >> Thu, 21 Sep 2006 20:37:32 GMT

Thanks for the ideas. I've decided to go with a hyperlink look, easier to acheive with less code. I have raised a NFS about having controls that are always shown in a table cell, a new inputType of Button as well as the ability to set the mouse pointer for individual columns and cells.

Torrie

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Table control and buttons

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:56 pm

by BeeJay >> Fri, 22 Sep 2006 0:13:10 GMT

How well does it work across a slow connection though, with all that Thin Client -> AppServer traffice every time the user clicks to scroll the table I would have thought that the scrolling would be very jerky for the user?

Cheers,
BeeJay.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Table control and buttons

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:56 pm

by allistar >> Fri, 22 Sep 2006 2:16:24 GMT

I've never noticed a performance degradation - then again I've never tried it on a link with a high latency.

Allistar.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 9 guests