Displaying a form with fields stored within a ArrayList<Object> using JSF and Primefaces -


i've struggling issue few days now.

i need display form. fields of form generated dynamically, stored within arraylist (by object mean instance of class attribute, simple class 2 string fields: label , value). in other words, have no direct , set methods access them.

this not problem when involved fields "flat" fields, such text fields, textareas, etc. whole thing gets painful when comes diplaying data selectboxes, or other dynamic fields (since value of fields not updated).

i didn't find on www this, each example found uses backingbean fields value of components, , works charm.

i've been coding while now, using jsf , primefaces, i've tried add jstl, can't seem on problem. not think posting code necessary @ time (i'm avaiable give further information though), know if had same problem, or if looking @ problem wrong point of view. there accepted approach kind of scenario?

update (code):

here (simplified) xhtml page (please notice object"card" in backingbean (newbacking) container of attributes:

<h:form id="cosmo-form-newcard">          <p:datatable var="curattribute"                  value="#{newbacking.card.attributes}"                  rowindexvar="curattributeindex">          <f:facet name="header">new card: #{newbacking.card.classname}</f:facet>          <p:column width="25%">              <f:facet name="header">attribute name</f:facet>              <h:outputtext value="#{curattribute.label}" />                             </p:column>         <p:column>            <f:facet name="header">attribute value</f:facet>                 <p:selectonemenu id="#{curattributeindex}" value="#{curattribute.value}">                     <f:selectitems value="#{newbacking.lookupactivated()}" var="curitem" itemlabel="#{curitem.label}" itemvalue="#{curitem.value}"/>                 </p:selectonemenu>         </p:column>     </p:datatable>      <br />     <p:commandbutton value="create" action="#{newbacking.commitaction()}"/> </h:form>  

and here cosmoattribute class:

public class cosmoattribute {      private string label;     private string value;     // other fields + getters , setters } 

can 1 explain why getting "empty id attribute not allowed" when try render form? p:selectonemenu can't see curattribute variable.

i cannot bind dyncamic field backing uicomponent, since should create collection of uicomponents, , cannot perform binding element of colletcion.

i'd keep advantages of jsf, since i've been struggling many days, i'm ready pursue different approaches.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -