PDA

View Full Version : Request for RefControl Example



Nickademus
December 3rd, 2016, 01:10
The documentation for the windowreferencecontrol lists the following for providing the information to make and fill the new window.


<class > The name of the window class used for an opened window instance
<recordname > ... </recordname> A relative (to the window data source) database identifier pointing to the data source to assign to the opened window
</class> Can I get an example of this with the recordname defined? The only instances I can find of it in rulesets only has a class defined.

Moon Wizard
December 3rd, 2016, 07:30
The thing is that the recordname field of windowreferencecontrol is most useful when it is left blank. When it is blank, it uses the data source of the window containing the control as the target record.

What are you trying to do?

Regards,
JPG

Nickademus
December 3rd, 2016, 09:00
I'm trying to have a windowreferencecontrol create a reference window and feed it a data source from a module. The window the control is in has no data source, or rather it will have a source for completely different data.

Nickademus
December 4th, 2016, 02:34
I can put the class name and recordname into a link in a story entry and it works fine. But I can't seem to get a windowreferencecontrol to grab the data. It just opens an empty reference window. I've tried a few different syntax, to no avail.

damned
December 4th, 2016, 03:13
Possibly complete that new record and then look in the DB to see where it has saved itself. It might give you a cue as to the correct syntax to use?

Nickademus
December 4th, 2016, 03:58
It's in a module. It won't be saved in the database. And I have the location information. I just need to know how to format the xml tag to use it.

The format for referencing the location in a story link is:

<link class="reference_manual" recordname="lists.xxManualContents@xxModuleName" />
This doesn't seem to work in the windowreferencecontrol's xml.

Moon Wizard
December 4th, 2016, 07:14
You could just make a buttoncontrol with an onButtonPressed event that uses the Interface.toggleWindow API to open toggle any window class/source that you want. Since it would be in a Lua function, you could do any scripting you needed to calculate the desired data source and class.

Regards,
JPG

Nickademus
December 4th, 2016, 10:37
I'll try that when I get home from work. Thanks.

Nickademus
December 5th, 2016, 01:18
Yep, that worked. Thanks for the heads up.
Now to get these damned buttons visible...