Page 1 of 1

why are some fields prevented from appearing on forms?

Posted: Tue Feb 03, 2015 12:05 am
by mrodent
Just a bit puzzled: I've mentioned this in previous posts but the question hasn't been answered.

From my empirical testing it appears that any field with a UNIQUE index (including PRIMARY of course) is excluded from the fields which can appear on forms and subforms. This appears to include multi-field PRIMARY keys... so if you have 3 fields constituting your PK for a table none of them can be included in a form or subform.

I really can't see the reasoning behind this: it is not the case that a PK is always an AUTOINCREMENT field, for example.

But maybe there's a way to configure things so they do appear? If not I'll just have to resort to attempting some guerilla code-tweaking... but I'd like to hear the reasoning behind it.

Re: why are some fields prevented from appearing on forms?

Posted: Tue Feb 03, 2015 5:19 am
by admin
mrodent,

Do you mean when you are using the Form wizard?

You can always add a field with a UNIQUE index by manually adding an Object to a Form.

Don't add a Primary Key though because any attempt to save a record will have the Primary Key trying to be updated twice.

nuBuilderPro takes care of populating new Primary Keys automatically but it won't do multi-field PRIMARY keys.

Steven

Re: why are some fields prevented from appearing on forms?

Posted: Thu Feb 05, 2015 1:18 pm
by mrodent
Thanks...

This is still puzzling to me: sometimes you may want to change the value(s) of the PK field(s)...

And even if you can't/shouldn't change it/them you might still want to display it/them.

Also, with a grid subform, for example, when you add a new row, what happens if the PK field involved is not AUTOINCREMENT? The same question applies when you add a new record with a form subform (or simple form).

In short I think I shall have to do some forensic analysis of the Nubuilder code with a view to understanding more of how Nubuilder works... the fruit of my labour may appear in the forthcoming "Nubuilder for dummies", of which I, speaking as a dummy, obviously stand in great need :-{

Re: why are some fields prevented from appearing on forms?

Posted: Fri Feb 06, 2015 2:27 am
by admin
mrodent,

You have a fair question so I have added the follow to the wiki. Hopefully this helps.

http://wiki.nubuilder.net/index.php/Rec ... _Structure

Also here is something I once wrote on my blog..

http://nubuilder.blogspot.com.au/2010_0 ... chive.html

Steven

Re: why are some fields prevented from appearing on forms?

Posted: Sat Feb 07, 2015 7:06 pm
by mrodent
thanks again...

I've started examining the code in Aptana (starting with index.php, what else?)

I don't suppose you have any design or development notes which could help me understand the architecture of nuBuilder? Rather than just reverse engineering with my head? If you don't it's OK...

mrodent

Re: why are some fields prevented from appearing on forms?

Posted: Fri Feb 13, 2015 2:20 am
by admin
mrodent,

Sorry but there isn't anything like you're asking.

Steven