{"id":161,"date":"2010-09-08T17:38:03","date_gmt":"2010-09-08T16:38:03","guid":{"rendered":"http:\/\/nanaki.affenfelsen.de\/wordpress\/?p=161"},"modified":"2011-12-09T04:51:02","modified_gmt":"2011-12-09T03:51:02","slug":"issues-with-creating-editboxes-in-option-panels","status":"publish","type":"post","link":"https:\/\/www.cosmocanyon.de\/wordpress\/2010\/09\/issues-with-creating-editboxes-in-option-panels\/","title":{"rendered":"Creating EditBoxes in option panels"},"content":{"rendered":"<p>I stumbled across a few issues while creating a new option panel, so  this might be an interesting sidenote for other addon authors:<br \/>\nIf you want to implement an EditBox-Widget in an option panel, you must  disable the autoFocus for this EditBox. Otherwise, it would catch all  inputs from the keyboard after login and you won&#8217;t be able to do  anything. There are two ways to do that:<\/p>\n<ul>\n<li>XML: When creating the EditBox, set the attribute to false\n<pre>&lt;EditBox (...) autoFocus=\"false\"&gt;<\/pre>\n<\/li>\n<li>LUA:\n<pre>EditBox:SetAutoFocus(false)<\/pre>\n<\/li>\n<\/ul>\n<p>If you fill in text via &#8216;EditBox:SetText(&lt;string&gt;)&#8217; you will  also need to set the cursor position to zero in order to actually see  the text you filled in. To do this, use: &#8216;EditBox:SetCursorPosition(0)&#8217;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I stumbled across a few issues while creating a new option panel, so this might be an interesting sidenote for other addon authors: If you want to implement an EditBox-Widget in an option panel, you must disable the autoFocus for this EditBox. Otherwise, it would catch all inputs from the keyboard after login and you &hellip; <a href=\"https:\/\/www.cosmocanyon.de\/wordpress\/2010\/09\/issues-with-creating-editboxes-in-option-panels\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Creating EditBoxes in option panels<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-coding","category-wow"],"_links":{"self":[{"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":5,"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":246,"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/posts\/161\/revisions\/246"}],"wp:attachment":[{"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cosmocanyon.de\/wordpress\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}