Some input components don't get rendered with the value set to them when using setValue?

edited September 2013 in Newbie Questions
In the following demo you can create input components either by clicking the button or by pressing return/enter inside an input, everything works as expected except if you press return inside the lowest input at any given time, if I do that a new input will be created as expected but the one you were in isn't rendered with a value (try hitting return a few times if no problem occurs on the first try), how come?

Also, is it really necessary to re-set values using .setValue() every time I do .render()?




  • 1) it's generally not a kosher idea to be directly manipulating controls through the children array.

    2) you hook up createNode as an event handler, but it lacks the standard (onSender, onEvent) parameters so it gets an invalid value when you click on the button to activate it.

    3) addChild is a protected function, so should not be called.

    4) You should use the setValue method instead of directly accessing the value property.

    Here's an updated version of your fiddle.

    It uses a custom onAddNode event to let the rwListItem tell its owner to add a node without that component needing to know the structure of the node.

    I didn't see a good way to implement your feature of adding the node after the one where you hit enter without directly using the children array, something you shouldn't do. I made an alternate here where you use a repeater and a data model at

  • Thanks, everything is working as expected now, but I think I found a bug in Enyo nightly.

    If I use Enyo 2.2 to get the value of an input component through .getValue() called through the oninput event (when I start writing stuff into the input) I get the correct value, but if I use Enyo nightly the latest character is missing from the string returned by .getValue().

    (Try writing in the input and observe console.log output):
    Enyo 2.2:
    Enyo Nightly:
  • That looks to be an issue with when we refresh the value property of the RichText. The newer code in nightly is doing it as part of the onkeyup event, reading the current value out of the DOM. This event is dispatched after the oninput event which is what you're catching. This was part of work ( around April to make bindings from RichText fields work.

    Can you try a local version of nightly and set oninput in the handlers block for enyo,RichText to be "updateValue" instead of null?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!