papageor
(George Papageorghiou)
December 12, 2022, 4:27pm
1
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
gorbunkov
(Maxim Gorbunkov)
December 20, 2022, 10:15am
3
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.
papageor
(George Papageorghiou)
December 21, 2022, 10:48am
4
Hi,
Thank you for your reply. It seems to be working properly.
Regards,
George