How to pass dashboard parameters at runtime

Hi,
I have created a dashboard that is displayed in a screen by using the dashboard component. What I want is to pass some parameters in the dashboard using code. I’ve checked the documentation and it explains how to pass parameters using xml:

<dashboard:dashboard id=“mainDashboard”
code=“main-dashboard”
timerDelay=“60”>
<dashboard:parameter name=“font-size” value=“huge” type=“string”/>
</dashboard:dashboard>

So, I would like to ask you how I can do the same operation using code instead of xml.

Thank you,
George

Hi,
The following solution worked for me:


    @Autowired
    private Dashboard myDashboard;

    @Subscribe
    public void onAfterInit(AfterInitEvent event) {
        Map<String, Object> params = new HashMap<>();
        params.put("myparam1", "My Value 2");
        myDashboard.refresh(params);
    }

This worked if there no parameter with the given name is defined in XML.

Hi,
Thank you for your reply. It seems to be working properly.

Regards,
George