Adding string selection item to Habpanel

As others have said, your question is a bit vague. If you want to know how to send a predefined text string to an item, you can do it with a button, dropdown list,etc. Here is an example of creating a dropdown menu, which can send specific commands:

<ul class="dropdown-menu" id="my-dropdown" uib-dropdown-menu role="menu" aria-labelledby="single-button">
  <li role="menuitem"><a id="select-option" ng-click="sendCmd(config.controller, 'reboot')"><b>Reboot</b></a></li>
  <li role="menuitem"><a id="select-option" ng-click="sendCmd(config.controller, 'suspend')"><b>Suspend</b></a></li>
</ul>

This example is for a custom widget, where you would define an item called ‘controller’, and then select your string item for that. When you click the selection in the dropdown, it would use the ng-click directive to send the text string to the item. For example, the first one would send ‘reboot’ (without the quotes) to the item.

If you just want a button (no dropdown), you can do that as well:

<button class="btn btn-lg" style="background: green; color: black"
  ng-click="sendCmd('config.controller', 'reboot')">

You can find all this and more in the template widget tutorial here, as well as the custom widget tutorial linked by @Oli.

However, if you are asking for a text entry field, where you can type in some text, hit enter, and have that value sent to an item, I don’t have an answer for you. I tried messing around with that a little for a widget I was working on, and I didn’t make much progress. I don’t think there is a text entry type widget available. You really shouldn’t need it though; I am not familiar with Kodi, but it looks like there are a limited set of strings you can send to the item, so you can just define buttons for each command you want to send.