Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

why are some fields prevented from appearing on forms?

Post Reply
mrodent
Posts: 15
Joined: Mon Jan 26, 2015 11:42 am

why are some fields prevented from appearing on forms?

Unread post 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.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

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

Unread post 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
mrodent
Posts: 15
Joined: Mon Jan 26, 2015 11:42 am

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

Unread post 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 :-{
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

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

Unread post 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
mrodent
Posts: 15
Joined: Mon Jan 26, 2015 11:42 am

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

Unread post 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
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

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

Unread post by admin »

mrodent,

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

Steven
Post Reply