Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2794

Re: DS1.6 - M Mode - Dropdown Box - On Select Event Fired Twice

$
0
0

Hi Mustafa,

 

Thanks for accepting the work around, your idea is sounds good to capture events and call only once here we also need to consider its mobile library where Select / FocusOut / Touch / Enter is not available like PC, so behave differently and also in different mobile OS behaviour may change. Please find some points below.

 

>So the change should be triggered in combination with one of the three cases listed above but only once.


"Its like when Enter Key is pressed or Focus leaves, i think its calling only once and only for the the item selected its calling twice (one time for De-Select and second time foe Select)."

 

> If a Change event has been triggered by the combination of a value change with item press, then a subsequent Enter or Leave Focus should not re-trigger the Change event because technically the selected value has not changed.


"This can be another thread whether capturing the De-Select / Select / Enter / Un-Focus in the same method is good or is reliable or not. Or it can be delivered in Three different method may called OnDeSelect(), OnSelect(), OnEnterKey(), and OnFocusOut() respectively like in other Event Oriented programming language."



Please note also this is sap.m control specially designed for small hand hold devices like Mobile phones etc, Here we have to think where above mentioned events (different method for different events) are possible and doable and on the box in all mobile OS and architectures as well. In UI5 sap.m also there is mProperties object, i think there we can check whether its first call or second with if-else condition and can code accordingly.


Above code length can be reduced to:

 

if(prevValue=="" || prevValue != DROPDOWN_1.getSelectedText())

{

  //Get the selected value

  newValue = DROPDOWN_1.getSelectedText();

  //Continue with your script

  GLOBAL_SCRIPTS_1.DoWork();

  //Reset the Privious value for next time select

  prevValue = newValue;

}


Thanks


Viewing all articles
Browse latest Browse all 2794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>