Question on application.overrideStyle()

Hi,

Does application.overrideStyle() work with Web Client?

I just created a test solution where I am trying to override the style onOpen of the solution. It works in developer, but not in web client.

Please let me know if there is an alternate way of getting it to work in web client.

Regards
jdcunha

It should work.

If you experience otherwise, please create a case in the Support system and attach sample solution that reproduces the problem.

No in 3.5 this will not work and is not supported.
it cant be fixed for 3.5 because that would require large code changes or backports from 4.1

Override style is currently fully supported from 4.1.1 on.

Thanks Johan.

Regards
James

I want to use the overrideStyle in 4.1.1

Just the problem is that my style sheet is not predefined.
I want to generate a style sheet depending on settings in my application.

This generated stylesheet must be stored in the database as a TEXT-field or stored as a style using application.getNewUUID() + ‘.css’ as a style but this must be done within script.
The stylesheet will be regenerated several times, so styles must be updated as well by script.

Is there a away to do this?

there is no solutionmodel support for styles yet so what you want will not work.

Do remember if we would add support for altering or setting a style then that will only be reflected when forms are recreated and with a style
you alter a lot of forms at once so all those if they are already shown will not be updated.

Johan,

I would like to make some template stylesheet (template.css)
On my forms I would like to link elements to this stylesheet

On runtime I would like to generate a stylesheet that will have the same contents as my template.
And I thought after application.overrideStyle(‘template.css’, ‘xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx.css’) then the wanted stylesheet would be used.

I need this because I have a standard webshop, which is used for different companies and these companies can change their styles and colors themselves without the need of a developer.
So the above sitiuation would be great to handle this

Would it be possible in the near future to add this functionality?

Shall I make a request or is there no chance that this will be implemented?

Martin

yes make a case

we could make an extra method on solutionModel.createStyle(name,content)
and after that you do overrideStyle

Ok case 199743 was created

Perhaps a third parameter boolean OverwriteAllowed
Because I need possibility to overwrite a previous generated stylesheet, but others will not like that
If OverwriteAllowed = false, then createStyleSheet should return false if there is already a stylesheet with that name

I guess there will also be a method to delete a stylesheet?

why delete a style?

What is the used for that?
Then all forms using that style are unresolved on the style properties?

also i was talking about newStyle(name,content)
so if you do one with an existing name it will throw an exception.
we could add a method setStyleContent(name,content) which updates an existing one. (and if you want to delete just use an empty content )

jcompagner:
why delete a style?

What is the used for that?
Then all forms using that style are unresolved on the style properties?

also i was talking about newStyle(name,content)
so if you do one with an existing name it will throw an exception.
we could add a method setStyleContent(name,content) which updates an existing one. (and if you want to delete just use an empty content )

These styles are for webshops. If a webshop is deleted then the corresponding style can be deleted also.
And remember that my forms will link to the template stylesheet and not to the new generated style sheet.
I hope the properties are not overwritten on the forms when I do application.overrideStyle()

Of couse my template style sheet will not be deleted. In that case you get unresolved of course.

setStyleContent(name,content) is good for updating.

And if I can test if a style exists, then I got all I need. I don’t like exceptions :-)