Quantcast
Channel: SCN : Discussion List - SAP BusinessObjects Design Studio
Viewing all articles
Browse latest Browse all 4041

Event onkeyup

$
0
0

Colleagues, I train and try to create your first ingredient for Design Studio. Faced with the problem of malfunction onkeyup event, this event is triggered through time and overwrites the previous character in the input. Here is the code:

 

Component.js

sap.designstudio.sdk.Component.subclass("com.sap.sample.editkey.EditKey", function() {

  

  var that = this;

 

  this.init = function() {

  this.tagInput = $('<input id="aps_edit" type="text">');

  this.$().append($(this.tagInput));

  $("#aps_edit").keypress(function() {

 

  that.firePropertiesChanged(["text"]);

  that.fireEvent("onkeypress");

 

  });

  };

 

  this.text = function(value) {

  if (value === undefined) {

 

  return $("#aps_edit").val();

  }

  else {

 

  $("#aps_edit").val(value);

 

  return this;

  }

  };

 

  });

 

contribution.ztl

 

class com.sap.sample.editkey.EditKey extends Component {

 

  String getValue() {*

  return this.text;

  *}

 

  void setValue(/* New Value */ String newValue) {*

  this.text = newValue;

  *}

}

 

If you remove that.firePropertiesChanged ([ "text"]), the symbol is no longer overwritten, but also variable text no longer be updated.

 

 

Help me to understand.


Viewing all articles
Browse latest Browse all 4041

Trending Articles



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