0

lang-addon event onFocus

asked 2017-02-02 16:55:53 +0000

danielromero gravatar image danielromero
6

Hi, I have this component that was defined in the lang-addon.xml as follows

<component>
    <component-name>mynumberbox</component-name>        
    <property>
        <property-name>format</property-name>
        <property-value>###,###,##0</property-value>
    </property>
    <extends>doublebox</extends>
</component>

and, that working fine. I use this component as follows

<mynumberbox value="@bind(vm.number)" onfocus="self.select()"/>

Note that, in the onFocus attribute, I wrote "self.select()", then, in the focus event, the value is selected. That allows me a behabiour when there are a number (por ejemplo "0"), if somebody write a number "2", the value changue to "2" instead of "20". That allows a better experience for the user.

But, now I want to add the behaviour to the component definition, I thinks that can be like this

<component>
    <component-name>mynumberbox</component-name>        
    <property>
        <property-name>format</property-name>
        <property-value>###,###,##0</property-value>
    </property>
    <property>
        <property-name>onFocus</property-name>
        <property-value>self.select()</property-value>
    </property>
    <extends>doublebox</extends>
</component>

but that not working :(

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-02-02 16:55:53 +0000

Seen: 23 times

Last updated: Feb 02

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More