cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

RadioButton SelectedValue not set to default value at Mashup load

nmutter
16-Pearl

RadioButton SelectedValue not set to default value at Mashup load

Hey, did you get a response for this? I'm experiencing the same on twx 8.2.6.

Thanks

Nico

 

ACCEPTED SOLUTION

Accepted Solutions
posipova
20-Turquoise
(To:posipova)

To reconfirm: this is working per design. Using state definitions for the default state "off" is not the same as pre-selecting "selectedvalue" that's why it's passing as 'undefined'. 

Thank you for your time and patience!

View solution in original post

10 REPLIES 10
posipova
20-Turquoise
(To:nmutter)

The issue described in the thread you linked is quite old and has been fixed almost two years ago. 

https://www.ptc.com/en/support/article?n=CS248962

We would have to gather all of the details including you sample set up to demonstrate the problem and evaluate.

Hey

thanks for your reply. The issue you linked is different from the problem here.

 

If we have a RadioButton in the mashup and use its value for a service call, the value send to the service will be "undefined" and not the expected default value of the button.

 If you like I can create a small sample.

 

Best

Nico

Here is an example. See the screenshots and also the two .xml files if you want to import it into your twx instance.

 

I have a radio button with a state, which has a default value off. The output is wired to a text label. If we look at the mashup in runtime, the label shows empty. If you change the state of the button the value is displayed correctly.

Screenshot from the mashup builderScreenshot from the mashup builderScreenshot mashup in runtimeScreenshot mashup in runtime

The same behaviour is when you wire the value to a service. When the service is called, no value is passed (like no string appears in the label). So when a user enters the mashup and does not touch the radiobutton, no value is set - but the defaul value is selected in the widget.

posipova
20-Turquoise
(To:nmutter)

I apologize for the delayed response, for some reason I did not see a notification on the update on this.

Thank you for attaching detailed description and entities! However, I cannot reproduce the issue with your supplied entities.

Per the state definitions,  I see the default is sset to Off. When I run the mashup, the label is empty/not set and the default button selected is off. When I toggle, I see proper label change on both states. What am I missing? Uness it is fixed now (I tried on latest 8.3 and unreleased 8.4)

 

No worries about the delay! I wish you a happy new year ;)

 

Thank your for looking into it. "When I run the mashup, the label is empty/not set " Exactly this is the problem. The button tells you the state is "Off", but this state is not communicated initialy to subscribed services/widgets. I expect the label to show "Off" as well, as this is the state of the radioButton.

 

If we use the radioButton state in a service, the button tells us "Off" but the service will get "undefined". Exactly as the label in the example is not set to the correct value, which should be "Off". Only if the user interacts with the radio button, the state will be communicated correctly.

 

I hope you understand what I mean? Let me know ;)

 

Thanks

Nico

posipova
20-Turquoise
(To:nmutter)

Thank you and happy new year to you as well!

 

Ok, I see what you are talking about. This works per design -- the binding on the label is for "selectedvalue".  But there is nothing selected at the start -- it's just the default "state" is "off". Once you make the selection then the trigger works. Does this make sense?

 

 

For me this does not make sense. As the state "Off" is selected in the widget, this should also be the "SelectedValue" in the output.

This is a lot of trouble when wiring the "SelectedValue" into services which get "undefined" as parameter when the user did not interact yet. So every service has to know what the default "value" should be for this call, which could change if the defaultValue of the referenced "State"-Entity in the Radio Widget is changed.

 

Do you by chance know what the result of the ticket https://www.ptc.com/appserver/cs/view/case.jsp?n=13606380 was? This is the case created from the original post.

 

If this works as designed ok, but for us this just seems off ;)

posipova
20-Turquoise
(To:nmutter)

I see what you are saying and definitely do see a point from your perspective.  It was closed as works per design. 

However, let me reach out to the dev team just to ensure and get some finite closure on this. I will update you once I hear back.

posipova
20-Turquoise
(To:posipova)

To reconfirm: this is working per design. Using state definitions for the default state "off" is not the same as pre-selecting "selectedvalue" that's why it's passing as 'undefined'. 

Thank you for your time and patience!

Thanks for looking into it :)

 

This is making the widget harder to use, but if this works as designed.. ;) Not sure if this "undefined" behavior is useful in any case.

Announcements


Top Tags