Welcome to the nuBuilder Forums!

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

Lookup Object Works But In The Edit Screen!

Post Reply
cypherinfo
Posts: 125
Joined: Thu Feb 18, 2010 5:42 pm
Contact:

Lookup Object Works But In The Edit Screen!

Unread post by cypherinfo »

Hello, walking the path to master nuBuilder I met an issue I cannot fix by myself.

At first sight, it may seems one of those questions asked by a newbye or like peoples.

I'm realizing a data base interface for a legacy data base (In doing it I have noticed nuBuilder has been designed not to be an interface builder for already existing tables; if you only think to the way it manages the autoincrement primary key field type); I have placed one lookup object on an edit screen in order to look up quickly for the value to fill the field when inserting a new record. When I access the edit screen I expect to see in lookup object the related value as correctly happens for all of the others objects but nothing is displayed! All right when I insert a new record; the object works correctly.

The table which contains the lookup object is: 'conservazione' the lookup table is 'scaffali'.

I tried to follow again your tutorial about the lookup object; to remake what has been done in it successfully; to place the tables of the tutorial in my data base and seen the lookup working right.
When I try to do the same with my tables nothing works!
The table I'm making up the interface on is a table created with a primary key not populated by nuBuilder. See the attached images for all of the settings I made.


Thank you.



Cypherinfo.
You do not have the required permissions to view the files attached to this post.
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Lookup Object Works But In The Edit Screen!

Unread post by steven »

Cypherinfo,

Are you saying the lookup doesn't populate (fill in) the code and description fields

Or

Are are you saying the values dont stay filled in when you save the record?

Steven
A short post is a good post.
cypherinfo
Posts: 125
Joined: Thu Feb 18, 2010 5:42 pm
Contact:

Re: Lookup Object Works But In The Edit Screen!

Unread post by cypherinfo »

Hello,


I have two tables: Conservazione; with the following fields of interest for the lookup issue: field - primary key; cons_scaffale - will be the field to fill with the lookup object; mg and idg two other fields.

The other table: scaffali is the one where the scaffale field value will be look up from.
See the attached snap for the two table structures.

Then I have the main form: there are: two text objects and the lookup one.

I click on the button to open the main form (Data base IGV) and it opens the search screen tab with the records already there.
I click one of them and it opens a new tab (edit screen) with all of the fields filled with their related values but the lookup object! I want - as in the normal behavior - to see the value in the lookup object; see the attached video: "nubuilderlookup".

In order to test the lookup object I moved in the same data base the sales and customer tables; then I followed again your tutorial about the lookup and all was right; see the attached video: "lookup". I was wondering if my issue may be about the naming convention: http://wiki.nubuilder.com/tiki-index.ph ... uilderDocs I did not follow in the conservazione table.

When I add a new record the lookup object works well. It stores the value in the field as expected.

I'm able to replicate with customer and sales tables the lookup behavior with no issue.


Thank you.




Cypherinfo.
You do not have the required permissions to view the files attached to this post.
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Lookup Object Works But In The Edit Screen!

Unread post by steven »

In the lookup object, the Field Name needs to be the name of the field where the value from the lookup will be saved.

It seems there is no fieldname scaffale in the table called conservazione.

And if there is it needs to be the same size and type as the primary key from the lookup.

The first thing you should always do if a lookup does not display anything, is go back to the database and see if anything is being saved at all in the field you think it should be.

If you have a problem in any type of programming, break that problem down into bits.

For example if you have a lookup that doesn't work, duplicate EXACTLY, one that does, and change it bit by bit until you find it stops working, then you'll know exactly where the problem lies.


Steven
A short post is a good post.
cypherinfo
Posts: 125
Joined: Thu Feb 18, 2010 5:42 pm
Contact:

Re: Lookup Object Works But In The Edit Screen!

Unread post by cypherinfo »

Hello, thank you for your assistance.

I have fixed now. I did not realize that the field where the value of the lookup has to be saved is a foreign key identical to the primary key of the lookup table in terms of type and size, not a generic a field where a varchar had to be saved.

All right now.


Thank you.



Cypherinfo.
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Lookup Object Works But In The Edit Screen!

Unread post by steven »

Groovy!

Steven
A short post is a good post.
cypherinfo
Posts: 125
Joined: Thu Feb 18, 2010 5:42 pm
Contact:

Re: Lookup Object Works But In The Edit Screen!

Unread post by cypherinfo »

Hello, the point as statetd here: http://wiki.nubuilder.com/tiki-index.ph ... uilderDocs is that the primary key is mandatory and not: "... should be..." to be: "...varchar(15), as it will automatically be populated using PHP's uniqid() function. ..."; same thing for the lookup object.

After reading your wiki it seemed that any kind of field might be used instaed of the varchar().


Bye.




Cypherinfo.
You do not have the required permissions to view the files attached to this post.
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Lookup Object Works But In The Edit Screen!

Unread post by steven »

The primary key must be a string.


Steven
A short post is a good post.
Post Reply