Globals and empty foundset

Questions, tips and tricks and techniques for scripting in Servoy

Globals and empty foundset

Postby pbakker » Mon Feb 02, 2004 7:15 pm

I think this was noticed before, but I never heared anything from it anymore: Global Variables seem to go empty if the form they are on is showing an empty foundset. Can something be done about this?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby IT2Be » Mon Feb 02, 2004 8:44 pm

Huh, I just opened a form with two globals (preset) on them, deleted all records, created one and deleted that one again.

All the time both globals showed nicely.

Then I went into layout mode and back again with that empty database, both globals were 'alive and kicking'...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Mon Feb 02, 2004 9:43 pm

Mmm, I have a navigator form (controller) on which I have 2 global field, of which one is type Combo box. The rest of the form is in Listview. When clicking on one of the record in the listview, another mainform is opened and the records in listview on the Controller are requeried, becaus enow they have to show the records that match the main form. Now, if there areno records that belong to the main form in the listview (empty foundset), values in the combobox global on the controller form disappears....

I rechecked it and see that the value in the normal field remains there.

Sorry, had to be more precize...

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby IT2Be » Mon Feb 02, 2004 10:07 pm

So, do I understand correct:

You have a global combobox with a valuelist attached.

The valuelist holds values of the main form (list view)?

Now: if there is nothing to show on the main form, there is no valuelist?

Then, I think it is only logical there is no value either. The value the field holds can't be found in the valuelist so it is not shown unless... The field/combo is editable...

Or is there something I miss?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Mon Feb 02, 2004 10:14 pm

The main form data has no database relation to the controller form/value list.

The value list comes from table A, the listview in the controller is based on table B and the Main Form can be based on any table.

All three groups are non related.

The Combo box is user to select the type of search needed (on invoiceid, customerid, emailadress etc). The value searched for typed in the other global field in the Controller.

The listview in the copntroller is used to navigate between the different main forms.

And the main form is just the main form... 8)

Now, when the listview on the controller has an empty foundset, then the valuelist in the combobox becomes empty. After I make sure there is a non empty list view again, the previously set value in the combo global is gone.... but a new one can be selected from the dropdown value list again.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby IT2Be » Mon Feb 02, 2004 10:24 pm

In that case I must pass... I am overclassed by this issue!
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Mon Feb 02, 2004 10:34 pm

:) No problem, thx for trying!

I know this is a bug that popped up long time ago and Servoy was looking into it...

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Jan Blok » Wed Feb 11, 2004 4:21 pm

globals variables are never influenced by the ammout of data in the foundset, what version of Servoy are you using?
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby pbakker » Wed Feb 11, 2004 4:37 pm

Latest RC, on windows, standard LAF
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby pbakker » Wed Feb 11, 2004 8:58 pm

Found a possible reason for this: allthought the value list is based on a relation between a global and a lookup table, when defining a relation,on the left hand side you have to specify a table on which the relation is based, eventhough the primary key (left hand side) is a global field.

In my situation, the table I chose for the primary kety side of the relation, is the table that delivers the records for the controller. So, could it be that because controller is showing no records (the foundset on the underlying table is empty), the relation with the global doesn't work anymore?


Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby ahmad » Wed Feb 25, 2004 4:22 pm

Hi there,

I'm having this problem with RC7

+ I have an "admin" table with a single record which is used to store some settings of the solution

+ I have a table called "gallery" where I store all the gallery images

+ The "root_path" for my images folder is stored in a text field in "admin"

I have created a global text field called "g_Relation" = 1

I have created a text field in "admin" called "Relation" = 1

By creating a relation (gallery_to_admin_relation) I'm getting the value of
"root_path"

I can get the value only if there are some records in the foundset

If no records in the current foundset I can't get the "root_path" value

Strange..

Kindly check
Thanks
Ahmad
ahmad
 
Posts: 139
Joined: Wed Dec 24, 2003 12:01 pm
Location: Hong Kong

Postby jcompagner » Wed Feb 25, 2004 4:30 pm

Yes this is a limitation (currently)

Relations can only be taken through a record.

we will see if we can fix this for global relations.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Jan Blok » Wed Feb 25, 2004 10:52 pm

This issue will be fixed in Servoy 2.0 rc8
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam


Return to Methods

Who is online

Users browsing this forum: No registered users and 33 guests

cron