Re: Power Objects - modifying translation method at runtime
Date: 1996/02/22
Message-ID: <Dn790H.358_at_watdragon.uwaterloo.ca>#1/1
In article <4gbt2d$b11_at_hades.datashopper.dk> you write:
>A couple of days ago I read, and used, an advise about using the
>postchange method for one field to modify the translation method for another.
>
>I have got a repeater panel. I contains a project# and a subproject#, both
>popUpLists. I want the list of values (translation) of the subproject#'s
>to be limited by project#.
>
>This is the he code that I have in the PostChange method of popProjekt
>
1> inherited.PostChange 2> IF nvl(self.value, "NULL") = "NULL" THEN 3> popSubProject.Translation = "" 4> ELSE 5> popSubProject.Translation = "=select txt, subproject# 6> from projects 7> where project# = " & self.value 8> END IF
>
>
>The IF-NULL is to control scrolling to a new row.
>This construction only works if there is one row in the repeater.
>If I use the popUpList in the second row, the selected item is not transferred
>to the repeater.
>Also the row is locked (lock icon is showed), and I get a lot of errors like
>"could not delete existing row", "error initializing system method" ...
>
>
>Has anybody encountered similar problems ??
The errors sound like they are generated by syntax/semantic errors that OPO doesn't tell you about...
I don't mean to sound picky, but is that the exact code?
Suggestions:
1> Inherited.PostChange()
2> IF IsNull( Self.Value ) THEN
5> popSubProject.Translation = "=select txt, subproject#" & & 6> " from projects" & & 7> " where project# = " & cstr( Self.Value )
Assuming that project# is actually a "number" and not a string (otherwise consider changing the name!-). If it is a string then forget the cstr conversion.
Also, I'm not sure off hand if having absolutely no defined datasource for a popup is valid. You might have to set it to a valid translation returning NULL such as "select 'n/a',NULL from dual"
Peter
-- Peter Yamamoto CS Phone: +1 519-888-4567 x3299 University of Waterloo MFCF Phone: +1 519-888-4567 x6488 Waterloo, Ontario, Canada N2L 3G1 Home Phone: +1 519-747-5318 Email: PJYamamoto_at_UWaterloo.CA URL: http://daisy.uwaterloo.ca/~pjyamamo/Received on Thu Feb 22 1996 - 00:00:00 CET