Skip to main content
15-Moonstone
October 16, 2017
Question

Event router widget for calculator application to create expression.

  • October 16, 2017
  • 2 replies
  • 3622 views

Hello,

I tried using event router for building calculator based application, but i see that the output is not getting changed on every click.

below image for reference when i tried.

In the above image for button 1 & 2 click the context id mapped with same 1 & 2 are not getting displayed in the output text box, but if i write anything on the other two text boxes and on leave from the text box, i am able to see the same in the output text box.

what am i missing in the button that i am not able to see the respective context ID in the out put text control on click ..???

Thanks

Sunay

2 replies

20-Turquoise
October 16, 2017

What is your ContextID bound to (what contents are you passing into the event router)?

ALso, the output of the events router is the last input provided.

sbt15-MoonstoneAuthor
15-Moonstone
October 17, 2017

I have hard coded the value which needs to be passed to button context ID. and i have mapped the ContextID to inputs of the event router as you can see in my first image.

1-Visitor
October 17, 2017

Hi,

the problem is event Clicked of button doesn't send the ContextId again to EventRouter. It's bound only once on load.

You can use an Expression widget to send ContextId from button to EventRouter. The button Clicked event can be bound to service Evaluate of Expression widget.

1-Visitor
October 17, 2017

I'm afraid that's the case..

If there are 20 buttons, it would be better to have a dropdown list to select.

sbt15-MoonstoneAuthor
15-Moonstone
October 17, 2017

Quang,

I need to implement a calculator setup and i think if i need to implement those many expression widgets as many as buttons, then it would not be a ideal solution i guess