The aim is to provide the user with 2 options to enter data (number):
(1) Simply enter (type) the number (50) into the input field . No problems with this. It works.
(2) Click on an associated icon (image) which has a numerical value (50) and by doing so input that value into the field. I am not sure how to do this. Not sure if it must be a group or what but not able to get this working.
Hi there, @megaphonepalā¦ one way you can do what you described is by using a custom state. You could create a custom state, say, at the page level, and you could set the input elementās Initial content field to be the custom state. Then, when an icon/image is clicked, you would run a workflow to set the custom state to a numerical value, and that value would then automatically appear in the input. Make sense?
Thanks Mike. Working on this slowly to understand what is going on and doing the tutorial. Will update you shortly on the outcome. Hopefully a success story
I have not been able to get it to work. This is what I have done so far:
(1) Created a custom state (āicon_valueā) for the element (ā50H Groupā) with a default value of 50 - See image A
(2) Set stateās icon_value of 50H Group. Then set the value of 50Hās Groupās icon_value - See image B
ā¦ I suspect there is something wrong with the last part for āSet state valueā. If nothing else, I have not found a way to instruct the workflow to enter the value (50) into the input field (āInput Headās Numberā)
This link on Evernote might make more sense of things:
In image A, remove the default value for the custom state. In image B, set the value to 50 (literally the number 50). Then, open the edit dialog for the input element that is supposed to show a value of 50 when the group is clicked, and set the Initial content field for that element to 50H Group's icon_value. At that point, you should be good to go.
Issue:
By clicking on the 50 H token, the value (50) is input into the āInput Heads Numberā field (as it should be), but the value is not processed by hitting return or clicking on the āStart Tossingā button (expected behavior).
The problem at this point is you are putting the custom stateās value in the Placeholder field instead of the Initial content field. So, uncheck the box for auto-binding and the Initial content field will appear. Then, remove the value from the Placeholder field and put that value in the Initial content field, and you should be good to go.
I have incorrectly set the input field (āInput Heads Numberā) for the Initial content to ā50 H Groupās Icon value.ā But doing it this way, it only works if there is just one icon being clicked, namely the 50 H one. But as there are other icons (51 H, 52 H etc), it will not work for those ones the way I have set it up.
Just have one custom state that is a number, and set the Initial content of the input to that custom state. When any of the icons are clicked, use a workflow to set the custom stateās value to the number associated with the icon. It should be that simple.
If you want to give me edit access to your editor (privately), I will set it up for you. It would probably be easier than continuing to go back and forth here.
One issue you might have is that āInitial Contentā literally means, āinitialā. If the user enters a value manually into the input box , the value entered overrides the dynamic custom state expression so it will no longer have a binding to the custom state and wonāt reflect any other changes. The way to overcome this is to put the input box in a group, set the Content Type of the group to ānumberā and the Data Source of the Group to the custom state. On the actual input box set the Initial Content to āParent Groupās numberā. This creates a 2-way binding between the inputās container group and the custom state. Hope this helps.