Thread: Specify subwindow datasource
-
April 29th, 2019, 17:49 #1
Specify subwindow datasource
Hi all
For a subwindow, the FG Manual indicates:
The created window will always have the same data source as the parent window.
Is it possible to specify a specific datanode ?
Thank's.
-
April 29th, 2019, 19:09 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
The subwindow control now supports a setValue(class, recordpath) API that you can use to load alternate data paths in Lua script.
Regards,
JPG
-
April 29th, 2019, 19:35 #3
Thank's for your response.
Whats is thé exact syntax ?
Is there an entry in the wiki ?
-
April 29th, 2019, 20:31 #4
Sorry but have you an example ?
Thank's
-
April 30th, 2019, 17:10 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
From the CoreRPG ruleset, it's used to set values into the background image panel.
[CORE]
wPanel.sub.setValue("imagepanelwindow", sRecord);
[/CORE]
The values accepted are just like any link within FG. It requires a valid window class name, and a data path.
Regards,
JPG
-
May 1st, 2019, 08:16 #6
Thank's, I will try this today.
Nicolas
-
July 7th, 2022, 06:14 #7
- Join Date
- Jul 2010
- Location
- Germany, Frankfurt
- Posts
- 156
I tried to set a subwindow source path with the "Ruleset Wizard" tool (see post in the Armor/Paid Creation/Ruleset Wizard thread) . The wizard create a subwindow tag with as "source" attribute where it stores the path i set in the tool. But this seams to be not working.
Is the definition of a source as attribute in the subwindow tag currently not supported ?
So i tried the set source path of the subwindow as you described (in "onInit" of the subwindow control). This work , but has the effect that for the numberfields i have defined in my window class, which i use for the subwindow, nodes were created on root level of the main window and on the source i have defined with setValue.
I think the reason for that is, that the field control in the sub window class were inititialized before the "onInit" of the subwindow control. The "onInit" of the subwindow control then seams to trigger again a "onInit" of the numberfield control of its window class, is that right ?
If yes, how i could prevent that?
-
July 7th, 2022, 22:12 #8
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
You can not set a "source" attribute on a subwindow. It doesn't do anything. That's only valid for value type fields (string, number, link, formattedtext, etc.)
Subwindows use the same data source path as the containing record; unless specifically set otherwise using the setValue API.
Regards,
JPG
-
July 9th, 2022, 06:17 #9
- Join Date
- Jul 2010
- Location
- Germany, Frankfurt
- Posts
- 156
Thanks for clarify that.
Have you an idea how i could change the data source path of a subwindow with setValue before the value type fields which are contained in that subwindow will be initialized ? Otherwise the value nodes of that fields will be created in the containing record of the subwindow and not at then "new" path of the subwindow.
I have set fastinit for my subwindow, is this maybe my fault ? Or do i have to change somehow the onInit of the value field control or the window class containing to the subwindow ?
-
July 9th, 2022, 14:18 #10
Arent you just trying to store attribute info in the character sheet?
This will be done without you adding a source on the subwindow as someone pointed out in the other thread.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks