Re: PoC: Little improvements to EditGrid - Enum ComboBox

From: Dave Page <dpage(at)pgadmin(dot)org>
To: "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: PoC: Little improvements to EditGrid - Enum ComboBox
Date: 2012-06-06 08:33:29
Message-ID: CA+OCxowm4k2_4ns+G7W69qXU1e8HYHeMRD1eSCmgzDNfPngj7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Wed, Jun 6, 2012 at 7:33 AM, Dickson S. Guedes <listas(at)guedesoft(dot)net> wrote:
> Hello all,
>
> I'm starting some proof-of-concept working on frmEditGrid trying make
> some "improvements" like:
>
> 1) show a combo box in columns of type enum;

Nice.

> 2) show a datetime picker in columns of type date/time/timestamp;

Hmm, nice idea in principle, but I'm not sure if there's a suitable
control that will allow the flexibility required (fractional seconds,
timezones etc). Obviously that's not needed in all cases, but we
should be consistent, otherwise we'd get people asking why they can
use a picker for timestamp but not timestamptz for example.

> 3) show a combo box in columns that has referential to another table;

Also nice, but I think this one needs some careful handling. Perhaps
limit the combo items to the first 500 or something, and still allow
the user to manually type a value? We don't want to try to load 10
million values into the combo!

> For the first item I have a very WIP patch (attached based on commit
> 896dce8f744816385aa89013d7808960f15a5109) and a working example
> (attached screenshots and sql) .. I'd like to see your opinions about
> them, if it is a good idea, and if the initial implementation is
> following the expectations of such feature. I'd like to know if anyone
> is/was working in a feature like this, I wouldn't like to reinvent the
> wheel.

Looks like a great start to me.

> For the second one I'm researching some interaction between
> wxDatePicker, wxTimePicker and wxCalendarCtrl to create a new type of
> CellEditor, so we could use some sqlGridDateTimeEditor that
> encapsulates the logic. Is that a good approach? What is your opinions
> about that?

Right - see above. Maybe the answer is to develop a popup control that
can handle date/time/timezone, and yet still allow the user to edit
manually for things like fractional seconds.

> Finally, for the last one, I see some challenges like:
>
> - Which field should be displayed in the combo?
>   Generally the value of a FK doesn't has enough information about
> what it means, them you need another field (e.g  a description or
> person_name field) to make sense.

Well, you could use a grid instead of a combo box to allow the user to
choose, and display the FK value in the first column, and the PK value
from the referenced table in the second and subsequent rows. I think
anything more than that is probably too domain specific.

> - How to play with composite referential keys? Should they be
> supported, and if so how should be the behavior?
>  It seems pretty dark to me how to bring values from two fields from
> a FK in distinct combo boxes.

Yeah, I don't really like the idea of trying to support that case. I
can't see any sensible way to make it work nicely.

> - Caching the data for performance.

Yes! :-)

> Well, this is just a start point and your opinions is very important.
>
> What do you think guys?

I think it'll be a nice addition to the tool - thanks for working on it.

One additional suggestion you may want to include: bytea handling. For
input, allow the user to select a local file as the contents of a
bytea field. For output, it would be great if we could detect some
common filetypes and offer viewers for them - e.g. detect that a bytea
contains an image and allow the user to view it.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2012-06-06 08:49:39 Re: PoC: Little improvements to EditGrid - Enum ComboBox
Previous Message Dickson S. Guedes 2012-06-06 06:33:07 PoC: Little improvements to EditGrid - Enum ComboBox