BUG REPORT
I’m developing a module thet I plan to use in many applications, I defined a default style for my module but I want to override it at will when integrated into some apps.
Following the docs I tried to use overrideStyle() in the startup method of the solution (not in the module since startup methods of modules never run) but it is not working.
Can you fix this?
Servoy 2.2final
MacOS X 10.4.1 (on dear old ppc…)
Java 1.4.2
FEATURE REQUEST
My original plan was to pass the style name to the module from the startup script of the main solution calling a global method on the module itself, like this:
Main solution Startup Module:
mod_xxx_init(style_name)
Module mod_xxx_init() global method:
var new_style = arguments[0]
overrideStyle(module_style,new_style)
Will it ever be possible?
Can you take it as a Feature request?
that is of no use.
You can’t override a style specific for a module.
Override style is for the complete solution so the code that you have in the mod_xxx_init method of youre module could just be in the solution startup method of youre main solution.
jcompagner:
Override style is for the complete solution so the code that you have in the mod_xxx_init method of youre module could just be in the solution startup method of youre main solution.
I tried that (as I stated in the bug report) but it’s not working, the module keeps his own style even after the override from the main solution startup script.
jcompagner:
that is of no use.
I think there is some use instead. I use an init method to pass some arguments to my modules (username, license key, other stuff…) so it would be useful to also pass the style to use in place of the one shipping with the module. This way I could just say to my module’s users: insert a line of code in your solution startup method to register the module and set up his style. Obviuosly I don’t consider this a major request.
jcompagner:
You can’t override a style specific for a module.
I don’t want to override the style xxx_style only inside the xxx_module, I just want to override the xxx_style in the whole solution including the modules.
i just made a quick test and it works perfectly
module has one form that uses a style ‘style1’
in de main solution that imports that module
i have a method that does:
application.overrideStyle(‘style1’, ‘style2’)
i take care that i call that method before i show the form of that module that uses that style
And then i go to a form of that module and the style is not style1 but style2.
So if you have a test case for me then i would like to see that one
jcompagner:
i just made a quick test and it works perfectly
module has one form that uses a style ‘style1’
in de main solution that imports that module
i have a method that does:
application.overrideStyle(‘style1’, ‘style2’)
i take care that i call that method before i show the form of that module that uses that style
And then i go to a form of that module and the style is not style1 but style2.
So if you have a test case for me then i would like to see that one
Still not working for me, I’m sending my solution.