Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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
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.
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.
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.
So if i have 20 buttons then i need to use 20 expression widgets..?
I'm afraid that's the case..
If there are 20 buttons, it would be better to have a dropdown list to select.
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
Another way is a service which return simply the String input. In this case, the contextId can be bound to that input. The Clicked event invoke the service which returns the contextId to EventRouter. Of course, you need to add the same service as many as buttons.
yes there also i cannot map multiple context id's of the buttons to a single service, so i need to create multiple services as many as buttons.