PDA

View Full Version : Coding Help Please - WindowReferenceControl Nodes In The DB



dulux-oz
May 8th, 2014, 10:09
Hi Guys,

I've been beating my head against the proverbial brick wall for a couple of hours now, and I still can't get this to work.

I've got a WindowReferenceControl Node in the DB. I want to get either: (a) the actual string value in the <recordname> tag, or (b) the node that the <recordname> tag references.

I've tried all of the following to no effect (usually an error message along the lines of "attempt to call field '[whatever]' (a nil value)".

oNode.getChild("mylink").getType() gives "windowreference"
oNode.getChild("mylink").getValue() gives the <class> but not the <recordname> info
oNode.getChild("mylink").getTargetDatabaseNode() gives an error
oNode.getChild("mylink").getChild("recordname") gives NIL
oNode.getChild("mylink").isEmpty() gives an error

Help!

Please!

:p

Cheers

Bidmaron
May 9th, 2014, 00:48
Dulux, you need to put some code in here. How are you producing the result of your calls? Have you tried s1,s2=oNode.getChild("my link").getvalue() in case it is returning two values? If I remember right, you cannot get individual children of a window reference node, as it is not atomic.

Trenloe
May 9th, 2014, 00:52
I think you're encountering the FG API not allowing access to DB node data that is controlled by the control they are anchored to. You can't access the whole of the FG database using DB or databasenode functions. This is necessary to stop people making changes to the database that could break the system.

Moon Wizard
May 9th, 2014, 07:16
getValue() returns 2 strings for "windowreference" node types.

Cheers,
JPG

dulux-oz
May 9th, 2014, 09:21
Yeah, found it - damn typos!

Thanks guys - I really do appreciate all the help - even if I forget to say so sometimes. :o

Cheers