Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Computed column refresh

491 views
Skip to first unread message

Mark Pare

unread,
Apr 21, 2004, 11:01:38 PM4/21/04
to
Hello, can someone help with the following:

I have a datawindow that has a computed column. That computed column calls a
global function with the column value and formats the value accordingly. The
format is based on a registry entry I create. If this registry entry gets
modified (say by a user entering a Preference for a different format), is
there a way to "refresh" the datawindow so that the new format is displayed
based on the same column values?

Thanks in advance


Vladimir Uzlaner

unread,
Apr 22, 2004, 10:55:13 AM4/22/04
to
Mark,

I am personally try not to use global functions inside of DataWindow expression.
It is very nice feature that may resolve many problems, but... it is very
unstable.

If you still didn't have problem with that, try evaluate you expression with
global function somewhere in the code ( a kind of Refresh button, or activate
timer event, where check changes in Registry and then re-evaluate expression)

To evaluate expression, use <your computed column name>.Format = <defaultvalue
[tab] DataWindowexpression>

I can't to check it out, but it may work.

Thanks.

On 21 Apr 2004 20:01:38 -0700,
in sybase.public.powerbuilder.datawindow

philip_salgannik

unread,
Apr 22, 2004, 12:10:46 PM4/22/04
to
If your global function is working properly, the Computed
column will refresh on next redraw of the datawindow
control.
About the only thing you can do about this is poll the
registry in a timer event and force the redraw if the
registry entry changed since the last timer run...

shawn

unread,
Apr 22, 2004, 10:53:45 PM4/22/04
to
You still have to poll as others have said since there is no windows
event mapping to registry updates. However, a quick and neat shortcut
is to use the dw_1.GroupCalc() function instead of re-retrieving.

shawn

"Mark Pare" <mark...@videotron.ca> wrote in message news:<40873592$1@forums-1-dub>...

M Searer

unread,
Apr 23, 2004, 6:07:19 AM4/23/04
to
dw_name.groupcalc()

"Mark Pare" <mark...@videotron.ca> wrote in message
news:40873592$1@forums-1-dub...

Mark Pare

unread,
Apr 26, 2004, 7:10:40 PM4/26/04
to
That didn't seem to work. I issued a dw_1.SetRedraw(FALSE/TRUE) and nothing.

Maybe if I give more details:

I have a datawindow with 1 column called length. This datawindow is
populated using ImportFile. The length column is not visible and I have a
computed column which has an expression on it:
f_get_size_format(length)

Now, in f_get_size_format function, it looks at a registry entry to see how
the user would like the size to be displayed in KB or MB. Once the user goes
into Preferences and modifies this registry entry, and I do the
SetRedraw(FALSE/TRUE), it doesn't get refreshed.

As for GroupCalc(), there are no groups in this datawindow so that won't
work.

Any further ideas?

<Philip Salgannik> wrote in message
news:4087ee86.4d9...@sybase.com...

Philip Salgannik

unread,
Apr 27, 2004, 1:08:32 AM4/27/04
to


"Mark Pare" <mark...@videotron.ca> wrote in message

news:408d96f0$1@forums-1-dub...


> That didn't seem to work. I issued a dw_1.SetRedraw(FALSE/TRUE) and
nothing.
>
> Maybe if I give more details:
>
> I have a datawindow with 1 column called length. This datawindow is
> populated using ImportFile. The length column is not visible and I have a
> computed column which has an expression on it:
> f_get_size_format(length)
>
> Now, in f_get_size_format function, it looks at a registry entry to see
how
> the user would like the size to be displayed in KB or MB. Once the user
goes
> into Preferences and modifies this registry entry, and I do the
> SetRedraw(FALSE/TRUE), it doesn't get refreshed.
>
> As for GroupCalc(), there are no groups in this datawindow so that won't
> work.

GroupCalc WILL work regardless of the absense of groups...
--
This is a FAQ, read Help, then search
www.groups.google.com/advanced_group_search

pbm_thisusuallydoesnothelp:-))
Philip Salgannik

0 new messages