{"id":44,"date":"2009-02-25T23:46:43","date_gmt":"2009-02-26T02:46:43","guid":{"rendered":"https:\/\/gonzalo.aro.cl\/blog\/?p=44"},"modified":"2009-11-26T11:50:22","modified_gmt":"2009-11-26T18:50:22","slug":"htmlselect","status":"publish","type":"post","link":"https:\/\/gonzalo.aro.cl\/blog\/2009\/02\/25\/htmlselect\/","title":{"rendered":"&#60;html:select&#62;"},"content":{"rendered":"<div class=\"entry\">\n<p>La etiqueta &lt;html:select&gt; se utiliza para crear listas de seleccion. En el caso de que estes utilizando un ActionForm esta etiqueta utilizara el valor de la propiedad del form para establecer el \u201cselected\u201d en el codigo renderizado como html. Por lo tanto el siguiente codigo<\/p>\n<pre class=\"brush: html\">\r\n&lt;html:select styleClass=\u201dfield select\u201d property=\u201dfuncional\u201d size=\u201d1\u2033&gt;\r\n&lt;html:option value=\u201dS\u201d&gt;Si&lt;\/html:option&gt;\r\n&lt;html:option value=\u201dN\u201d&gt;No&lt;\/html:option&gt;\r\n&lt;\/html:select&gt;\r\n<\/pre>\n<p>produce el siguiente codigo, asumiendo que la propiedad llamada \u201cfuncional\u201d dentro del formulario esta establecida en \u201cS\u201d<\/p>\n<pre>\r\n&lt;select name=\u201dfuncional\u201d size=\u201d1\u2033 class=\u201dfield select\u201d&gt;\r\n&lt;option value=\u201dS\u201d selected=\u201dselected\u201d&gt;Si&lt;\/option&gt;\r\n&lt;option value=\u201dN\u201d&gt;No&lt;\/option&gt;\r\n&lt;\/select&gt;\r\n<\/pre>\n<p>(Actualizaci\u00f3n)<\/p>\n<p>Existe ademas la posibilidad de establecer colec ciones denro de la etiqueta, esta etiqueta asume que los opbjetos de la colecci\u00f3n se LaberlBean, pero en el caso que tu tengas un objeto con sus respectivos getter y setter puedes configurar la etiqueta de la siguiente forma<\/p>\n<pre>\r\n&lt;html:select styleClass=\u201dfield select\u201d property=\u201dtablaCnecAsociada\u201d size=\u201d1\u2033&gt;\r\n&lt;html:options collection=\u201dlistaTablaCnec\u201d property=\u201dcodigo\u201d\r\n labelName=\u201dTablaCapitalNecVO\u201d labelProperty=\u201dnombre\u201d \/&gt;\r\n&lt;\/html:select&gt;\r\n<\/pre>\n<p>en este caso se esta usando como valor el codigo, que es un atributo de un objeto llamado TablaCapitalNecVO, desplegandose su atributo nombre dentro de la lista.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>La etiqueta &lt;html:select&gt; se utiliza para crear listas de seleccion. En el caso de que estes utilizando un ActionForm esta etiqueta utilizara el valor de la propiedad del form para establecer el \u201cselected\u201d en el codigo renderizado como html. Por lo tanto el siguiente codigo &lt;html:select styleClass=\u201dfield select\u201d property=\u201dfuncional\u201d size=\u201d1\u2033&gt; &lt;html:option value=\u201dS\u201d&gt;Si&lt;\/html:option&gt; &lt;html:option value=\u201dN\u201d&gt;No&lt;\/html:option&gt; &lt;\/html:select&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,7,10],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-desarrollo","category-java","category-jee","category-struts"],"_links":{"self":[{"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/posts\/44"}],"collection":[{"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":2,"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/posts\/44\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gonzalo.aro.cl\/blog\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}