It is currently 25 May 2020, 8:17 Advanced search

Dynamic Visual Styles

Questions and answers on how to best use Instant Developer

Dynamic Visual Styles

Postby Ted Giles » 18 December 2019, 14:53

InDe01.PNG
InDe01.PNG (25.55 KiB) Viewed 1016 times


Am I on the right track with this?
I have different VS depending on a value in a field.
User avatar
Ted Giles
 
Posts: 491
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK

Re: Dynamic Visual Styles

Postby ljwilson » 18 December 2019, 15:43

Code looks ok. Only issue might be if the front-end doesn't refresh. If that is the case you could try your code in OnDynamic Properties event.

Certain ui changes can only be effective in some events, like Load, OnDynamic Properties, etc.

...jack
ljwilson
 
Posts: 523
Joined: 26 November 2013, 14:15

Re: Dynamic Visual Styles

Postby Ted Giles » 18 December 2019, 16:19

I'll try that, thanks Jack
User avatar
Ted Giles
 
Posts: 491
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK

Re: Dynamic Visual Styles

Postby lucabaldini » 19 December 2019, 11:12

It looks ok... I'm not expecting problems because the visual style change is made on static fields so every cell-event is fine.

Let me explain a little bit what I'm saying.

There are two types of events:
- cell-like events (like onUpdatingRow, onDynamicProperties, onValidateCell, etc...)
- column-like events (every other event, even events that have nothing to do with panels like form's OnLoad).

If you want to change the visual style of a single cell you have to use cell-like events... if you want to change the visual style for the full column (or for a static field), you have to use column-like events OR other events like onLoad, onResize, AfterFind, OnChangeRow, etc.

You are changing groups and static fields' visual style. After Find is a good event :-)
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4306
Joined: 1 October 2010, 17:03
Location: Bologna

Re: Dynamic Visual Styles

Postby Ted Giles » 19 December 2019, 14:05

Thanks Luca.
I have it working as I expected, however I cannot find the onLoad verb to set the initial values of the Static Field.
No big deal as I usually set the launch to Find Data, so it picks up anyway. I had imagined that setting the VS in the Field Settings would have set the initial borders, but it doesn't.

This is the code, if anyone is watching;
InDe01.PNG
InDe01.PNG (22.46 KiB) Viewed 968 times


AND, I have tried out the Copy Function from the Toolbar. It adds the VS with an incremental number and all you need to do is change the colours as you wish.
Really impressed by that!
User avatar
Ted Giles
 
Posts: 491
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK

Re: Dynamic Visual Styles

Postby ljwilson » 19 December 2019, 22:54

I cannot find the onLoad verb to set the initial values of the Static Field.


You want the Form's Load Event.

...jack
ljwilson
 
Posts: 523
Joined: 26 November 2013, 14:15

Re: Dynamic Visual Styles

Postby lucabaldini » 20 December 2019, 7:47

Ops... That's correct... Form's Load event :-|

Thanks @ljwilson :-)))
User avatar
lucabaldini
Pro Gamma
Pro Gamma
 
Posts: 4306
Joined: 1 October 2010, 17:03
Location: Bologna

Re: Dynamic Visual Styles

Postby Ted Giles » 20 December 2019, 10:14

Yep, that did it. It wasn't where I expected it to be.
For anyone watching;
"Add Load" processing is in the Form Root Events and I expected it to be in the long list which is in the icon below the Form Root.
User avatar
Ted Giles
 
Posts: 491
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests