Unstored calcs not rendering until I click on them

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

Unstored calcs not rendering until I click on them

Postby amcgilly » Wed Jul 30, 2014 1:05 am

I'm having a strange problem with unstored calcs in Table Views not rendering in Smart Clients. Here is the environment:

Server:
Mac OSX 10.8.5
Java 7 update 65
Servoy 7.4.1

Clients:
Smart Client on any Mac or Windows machine running Java 7 update 60 or greater

Database:
Sybase SQL Anywhere v 16

Problem:
Calcs in table views are not showing up all the time. Some are, but most aren't. But when I click on a field that is based on a calc, then the correct value shows up but only for that field (i.e. only for that row & column of the table view).

[EDIT]There is nothing fancy about these calcs. Here's an example of one that's not rendering:

Code: Select all
function clc_clock_offset()
{
   return Math.round((creation_date - clock_time)/1000);
}
[end of EDIT]

I think this may have started when we upgraded the server to Java 7 update 65. These calcs were working fine before that. I'm not aware of any major changes in my code that could have caused this. Does anyone know what might be causing this? Thanks!
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Unstored calcs not rendering until I click on them

Postby jcompagner » Wed Jul 30, 2014 5:30 pm

the question is is it more a paint issue or not.

So is the calc really calculated yes or no?
If you print an application.output for that cal with the record/row info, then if you render the table view do you see it being hit for all rows or not.
And if you click in it (when you suddenly see it) do you see the calc then really executed? Or does it then already show an already calculated value.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Unstored calcs not rendering until I click on them

Postby amcgilly » Thu Jul 31, 2014 9:57 am

I put an application.output in several of the calcs that appear on the form.

When the table view is first shown, only the calcs that rendered print their output. Then each time I click on a calc that failed to render, that calc renders and prints its output. If I click on some non-calc field, the row becomes selected but the missing calcs do not render.

I downgraded the server to Java 7 update 60 but that didn't change anything.

I'm now running some validations in Sybase Central to see if it finds any problems with the db itself. I'll keep you posted on the results. Please let me know if you have any ideas. Thanks.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Unstored calcs not rendering until I click on them

Postby jcompagner » Thu Jul 31, 2014 3:50 pm

wat do you mean "calcs that render" do print there output
do you mean that you see rows that also should show the calc but those don't render and don't calculate?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Unstored calcs not rendering until I click on them

Postby amcgilly » Thu Jul 31, 2014 8:09 pm

That's correct.

See the screenshot below. The columns I've marked as Calc should have values in all rows but as you they don't always.

calc_problem.JPG
calc_problem.JPG (66.69 KiB) Viewed 5708 times


As you suggested, I put application.output() in each calc. When the form first appears, I get application.output from only the calcs that rendered. Then if I click on a blank cell, it renders (just that cell, no others) and I get application.output from only that calc.

I have eliminated database corruption as a cause of this. I've also monitored memory usage in the Smart Client using the 'About Servoy' dialog and it looks fine. Also know that this problem is NOT happening in the web client.

I've used the Profiler to see if anything crazy is happening with my code and I don't see anything unusual.

The driver I am using to connect to Sybase is: com.sybase.jdbc3.jdbc.SybDriver. Is that the best one to be using?

Thanks for your help.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Unstored calcs not rendering until I click on them

Postby Harjo » Thu Jul 31, 2014 8:47 pm

Do you have some form onRender or columns onRender, just for test disable them, make the form as simple as possible, maybe that will give a clue what is conflicting or find the real bug
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Unstored calcs not rendering until I click on them

Postby amcgilly » Sat Aug 23, 2014 3:59 am

After much trial and error I found the source of this calc rendering problem and I think it might point to a bug in Servoy.

The problem seems to be with UI Converters when applied to fields that contain aggregations.

I use a UI converter to make zeros show up as blanks on the form (as described in this thread in this thread: https://www.servoy.com/forum/viewtopic.php?f=2&t=12642&p=108813&hilit=zeros#p108813. In certain cases the toObjectMethodName method is being called way too often, and I think this is messing things up.

Here is some detail:

I have a top level form with no datasource. In a tabpanel I display a form showing the current record from table A plus some aggregations like A_to_B.total_weight, A_to_B.average_weight, etc.
In a separate tabpanel on the top level form I display the A_to_B foundset in a table view.
Every time I change the record A, the toObjectMethodName method gets called anywhere from 50 to 123 times per aggregation field. After doing this 5 or 6 times, my calcs stop rendering correctly.
If I remove the UI Converter from my aggs and restart the app, the problem goes away.

I am able to reproduce this in Developer 7.4.1, Java 7.

Servoy, please let me know if I'm doing something wrong or if you need more info. Thanks.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Re: Unstored calcs not rendering until I click on them

Postby jcompagner » Mon Aug 25, 2014 9:54 am

make a case with a sample solution, then we can look at it.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Unstored calcs not rendering until I click on them

Postby amcgilly » Tue Sep 09, 2014 1:00 am

Created case SVY-7166
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 5 guests