Is there a way that I could bind a slider to a numeric entry field and divide the value by some number. I would like to have decimal places in the numeric entry. The only place to check bidirectional is under Property Binding. It seems like I would have to have a bidirectional expression to pull this off.
Yeah, no, doesn't exist. You could try emulating it with an expression in one direction, and a change script in the other. Check the origin in a change script to conditionally go the opposite direction.
I was able to scripts to get it to work but I have a new problem. If I click into the numeric entry field I can move the slide and it won't update as long as the numeric field is active. How can I commit the numeric field if I click on the slider.
It's not clear what you are trying to achieve.
If what you want is to be able to control one variable with two components - a Numeric Entry Field and a Slider in your case - then:
- Create a custom property on the view.
- Create a bidirection binding between the slider and the custom property.
- Create a bidirection binding between the numeric entry field and the custom property.
Unlike the Text Field component, the Numeric Entry Field does not have the option to disable deferUpdates so you must press enter before the custom property and the slider will update.
Adjustments to the slider will immediately cause an update to the Numeric Entry Field.
This still has the problem of not releasing focus on the Numeric Entry Field. I'll have another look in the morning.
Thank you
Playing around some more, it appears that clicking on the slider's control knob does not automatically seize the focus (and take it away from the numeric entry field). Try adding an onClick event to the slider to do the job.
It does have a slightly odd affect that when the numeric entry has been changed significantly the slider will jump from under the cursor when clicked.