WebSegmentedControl.Action event changes ListIndex only after event execution

Hi all,

I came across an unexpected behaviour of WebSegmentedControl. If you implement the Action event and do some stuff there (like calling methods etc.), its ListIndex gets changed only after all the event’s code has been executed.

That leads to weird behaviour like if a method called needs to know the new ListIndex but it get’s the old one since the event hasn’t finished executing yet. Is that by design or shouldn’t it change the ListIndex at the very beginning of the event?

Example: https://dl.dropboxusercontent.com/u/106712747/SegmentedControl.xojo_binary_project

Best,
Alex

That sounds like a bug. Please file a report in feedback with a sample project and the browsers you have tested.

Greg,

Done: feedback://showreport?report_id=37989

apparently this bug is still alive.
How do I get the selected index of this control?

Catch the segment index in the action event and set a property to this value?

Yep, that’s the ticket.