global calculation?

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

global calculation?

Postby Cain » Sat Nov 27, 2004 7:40 pm

Is there any way to create a global calculation?

Scenario: I want to use the rowBGColorCalculation. For tables and lists, it will alternate colors, and highlight selected. For record views, I'd like to show a different color background of a global find flag is set (to let the user know s/he's in Find mode).

I can defind this calc for each and every table, but it's going to be the same calc.

This isn't a big problem, really, but from my experience thus far with Servoy, I thought I'd check to see if there's an easier way that I'm missing. Time and again, when I find myself doing the same thing over and over again in my programming, I find that it's because I'm not doing it the Servoy way! :)
Cain
 

Postby jcompagner » Mon Nov 29, 2004 7:05 pm

for rowBGColorer you need to make a calculation for every table.
But the implementation could be in a global method but this is NOT Supported!!

the calc can be something like this:

return globals.rowBGColorer();

and then you have a global method rowBGColorer that has the implementation.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Cain » Mon Nov 29, 2004 7:30 pm

OK, this is actually what I'm doing now. It seems to work okay, and does save a lot of redundant code.

Glad to find out I'm not doing it the 'long way'. 8)
Cain
 


Return to How To

Who is online

Users browsing this forum: No registered users and 8 guests