calculated field problem?

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

calculated field problem?

Postby RobertMeyer » Mon Feb 16, 2004 2:50 am

I see a few other folks are experiencing problems with calculated fields,
as am I.

I have a real simple form set up, where I type a number in a field
("field #1"), and another field ("field #2") is a calculated field that
just multiples the number in field #1 by 2.

when i enter a number in field #1, and tab, the calculation *sometimes* works!

when i enter a number in field #1 and click on the form, the calculation *always* works.

I'm very confused about this, and need to get it working, or find another way
to do what I need to do.

any help would be appreciated.

Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby IT2Be » Sat Feb 21, 2004 12:10 am

I have tried to replicate this but was not able to do so... tabbing in and out a field int1 and int2 gave me a the expected result in a field int3... (BTW have you set all dataproviders to the correct type including the returned type of the calculated field)

Strange you don't get that...

What you can do if this remains is try a controller.saveData() on the onDataChanged event of the field :? Maybe that helps
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
Servoy Expert
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby jcompagner » Sat Feb 21, 2004 11:19 am

please send me an example soltuion where i can see that behaviour
Johan Compagner
User avatar
Posts: 8841
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby maarten » Sat Feb 21, 2004 9:43 pm

Hi Robert,

Attached is a solution that does what you describe.
(without errors that is)
Could you please import this solution and see how it runs on your machine?

Can you also give me the version you're working with?
I'm using:
Servoy Developer
Version R2 2.0 rc6-build 265
Java version 1.4.1_01-b01 (Windows 2000)
(4.04 KiB) Downloaded 457 times
Maarten Berkenbosch
User avatar
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands

Postby RobertMeyer » Sat Feb 28, 2004 4:30 pm

i think i have it narrowed down;

a 'normal' calcualted field with update when the
user changes something on a form, and leaves
the field he's working on by hitting tab or clicking
elsewhere on the form.

calculations based on other calculations however,
will not update until the user clicks on the form.

tabing from field-to-field while entering data will
not work for these types of calculations.

does this help?
Posts: 268
Joined: Sat Dec 27, 2003 9:05 pm

Postby jcompagner » Sat Feb 28, 2004 8:53 pm

i just made an example and that works fine:

made a global: calcInput
made one calc (firstCalc) that returns calcInput+1
made a second calc that returns firstCalc +1

put the global on a form with a textfield
both calcs i displayed in 2 labels with the calcs as the dataprovider.

and it works fine if i change the global.
Isn't this example working for you?
Johan Compagner
User avatar
Posts: 8841
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Riccardino » Sun Feb 29, 2004 1:16 pm

I'm also having a problem with calcs not updating:
form INVOICES, with a portal showing records from PROJECTS table (Project nr, date and difference, where difference is the remaining amount the customer still has to pay)
This calculation is given subtracting the sum of all invoices related to the current project from project's total)
Let's say my project is 150 euros
I move to invoices form and create a new invoice of 50 euros
when I click the button the assigns the project nr to this invoice, I would expect the difference field to be updated (in this case, become 100), but it doesn't. I tried to click in the form, save data, go to a different record: nothing.
The value is updated only if I go to the Projects form and then I come back (I didn't try to move to other forms)
User avatar
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby jcompagner » Sun Feb 29, 2004 2:52 pm

please send an example then i can check it out.
Johan Compagner
User avatar
Posts: 8841
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby patrick » Wed Mar 24, 2004 3:03 pm

I also just came across a calculation problem. I attached a solution that demonstrates my problem and saves me writing time.

In the attached solution there is a popup where you can choose A, B or C. The calculation that doesn't update is right beneath and just "calculates" the chosen value.

(6.8 KiB) Downloaded 449 times
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Jan Blok » Wed Mar 24, 2004 5:55 pm

Display issue will be fixed in Servoy 2.0 rc10, thanks for reporting!
Jan Blok
Jan Blok
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: Bing [Bot] and 7 guests