Forum Discussion

blink257's avatar
blink257
Start Member
19 days ago
Solved

How to use text input in IWSDK with UIKitML

I have tried using direct input element queries, but inputElement.properties.value or inputElement.value is always empty.

After a lot of debugging, I found that the input can be captured through direct signal access, like below:

      const doc = this.panelDocument;
      const textInput = doc.getElementById('checklist-text-input');
      if (textInput && textInput.currentSignal) {
        const newText = String(textInput.currentSignal.v ?? '').trim();
        item.text = newText;
      }


However, this seems like a hack, and I did not find any way to set the input value dynamically through any properties. I would like to know if there is a proper way to manipulate the input with UIKitML.

  • Ah found the solution it was to use 
    setProperties({ value: undefined, defaultValue: 'hello'});
    getSignal('value').value

1 Reply

  • Ah found the solution it was to use 
    setProperties({ value: undefined, defaultValue: 'hello'});
    getSignal('value').value

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions