Change Pagefield StyleExpr through EventSubscriber

wanmatwanmat Member Posts: 2
Hey there,
i would like to change the StyleExpr Value of a Field on a Page dynamically. One Way to do it would be to change the Style (for example to Strong) and use a Variable(Type Boolean) for the StyleExpr Property. Then Change the Value on the AfterGetRecord Trigger.
Now on 2017 i could create OnAfterGetRecordEvent Subscriber with the Page as Subscriber Object. Is there a way to access a Variable defined on a page, via Event Subscriber or another way to change the Style from outside?
i would like to reduce the code on the Default Objects as much as possible.

thank you and greetings.


Comments

  • HannesHolstHannesHolst Member Posts: 119
    No, not with the build-in events.
    You have to create a Publisher-function on the Page at least.

    Create a Publisher-function and include into a corresponding trigger on the page.
    It is possible to set a var-parameter for the function.
    Then create a Subscriber-function which listens to the Publisher-function and modify the StyleExpr.

    Didn't test, but should work.
Sign In or Register to comment.