Expand my Community achievements bar.

How to clear word what i input in SimpleChat.

Avatar

Former Community Member

When i input the words,and click submit button.Words had be sended to server,but the word keep in the textInput field.May i clear the textfield,when i send the words to server.

5 Replies

Avatar

Level 6

After all the process are done call xfa.host.resetData(); to re-set the whole form.

Avatar

Former Community Member

Hi,

Are you using SimpleChat component of LCCS ? If you are using SimpleChat , it does clear the textfield when you click send or press enter. However, if you are building the chat UI yourself and using just the SimpleChatModel component, then you need to clear the textfield yourself in your code.

Hope this helps

Thanks

Hironmay Basu

Avatar

Former Community Member

Thanks.I had build a component like simplechat.It's a bug for simplechat or ....

Avatar

Former Community Member

This isn't the case for me. When I hit send (or enter) the textinput doesn't clear. I've looked at the code and it's obviously supposed to clear.

Any ideas what's going on?

Avatar

Level 3

Are you using the latest version of the api? In previous versions it was sometimes the case where the enter key wouldn't clear the text feel.  The only way to fix it was to do a validate on the text box after it is sent by editing the source code, if you do a search on the forums I had brought this up on one of my previous posts... The solution is also included there as well.  I am guessing it would be just easier to download the latest version of the API.