'on Change' events not triggered when fields changed by other event actions

meza shared this problem 5 years ago
Solved

I have a dropdown menu with a number of states.


I have an 'on Change' event on the dropdown menu, with a number of conditions that will do different actions for each state.


This works fine when the user changes the dropdown manually.


The problem I have is when I change the status of the dropdown from another action by using the 'select value' interaction - the 'on Change' events never fire.


I have tested this with other form fields to, and it seems they are all the same - the on Change event only fires when a user clicks on them, not when the data is changed from another event action.


Any way of fixing this?


A bit more info about what I'm trying to achieve...


I'm trying to replicate a technique you can use in Axure to streamline state based actions.


For example, I have some modal dialogues that I want to trigger from a number of different buttons. When the modal shows I want to do a number of different actions, say show the modal background, clear a form field and bring a panel to front.


Bad way:


If I want to trigger the modal from a number of different buttons, I have to copy those actions on to each button manually. It's a pain to update - if I want to change what happens when the modal appears I have to change the actions in multiple places.


Good way:


Create an object that will manage the state of the modal, such as a dropdown menu, or a dynamic panel (acts like a state machine). Set onChange or onPanelChange (Axure) events on this item. Put the actions on this item, and then you don't have to duplicate them across all your trigger buttons, they are managed in one place.


Can anyone work out how to achieve a similar effect in Justinmind? I am ending up with duplicated actions scattered all over the place on different widgets.

Comments (3)

photo
1

Hi,


could you send the prototype, or part of it, where it happens? I would like to run some test and try to find a solution. Please, send it to jim.support@justinmind.com


Thanks,

photo
1

Sure I'll send a prototype now.


I have worked out a hack that gets it kind of working:


When you change a field in an event action, add another action immediately after to set the focus on the field.


On the field, set an 'on Focus In' event, and put your actions on there. It seems the focus appears to cause the actions to be triggered, where 'on Change' does not.


The down side to this is putting the focus on the field causes the page to scroll the field into view.


I tried making the fields invisible/hidden, but that stops the hack from working.


Thanks

photo
1

Hi,


I have run some test with the simulator and also a real iPad. I found that the "on change" event doesn't work for radio buttons. So, you need to work with "focus in" event if you prototype for iPad.


Sorry for the inconvenience.