Note that there are some explanatory texts on larger screens.

plurals
  1. POstoring separate session variables for different SelectOneMenu(s) in a dataTable JSF
    text
    copied!<p>I have a dataTable which has a value of a bean class which looks like this:</p> <pre><code>public class myBean { private List&lt;SelectItem&gt; depList; </code></pre> <p>With getters and setters.</p> <p>My getter calls a method <code>buildDepList()</code> which gets department names from the database and fills the depList.</p> <p>Here's how my JSP file looks like:</p> <pre><code>&lt;ice:dataTable id="specializationTable" style="height: 216px; left: 134px; top: 62px; position: absolute" value="#{AdmissionApplication$Application.specBean}" var="specRow" width="480"&gt; &lt;ice:column id="column2"&gt; &lt;ice:outputText id="outputText9" value="#{specRow.choiceNum}" visible="true"/&gt; &lt;f:facet name="header"&gt; &lt;ice:outputText id="outputText3" value="#{msg.Choice_Number}"/&gt; &lt;/f:facet&gt; &lt;/ice:column&gt; &lt;ice:column id="column4"&gt; &lt;f:facet name="header"&gt; &lt;ice:outputText id="outputText8" value="#{msg.Department}"/&gt; &lt;/f:facet&gt; &lt;ice:selectOneMenu id="selectOneMenu2" partialSubmit="true" value="#{specRow.departmentName}"&gt; &lt;f:selectItems id="selectOneMenu2selectItems" value="#{specRow.departmentItems}"/&gt; &lt;/ice:selectOneMenu&gt; &lt;/ice:column&gt; &lt;ice:column id="column5"&gt; &lt;f:facet name="header"&gt; &lt;ice:outputText id="outputText10" value="#{msg.Specialization}"/&gt; &lt;/f:facet&gt; &lt;ice:selectOneMenu id="collegesSelectOneMenu" partialSubmit="true" style="width: 118px" value="#{specRow.specializationName}"&gt; &lt;f:selectItems id="selectOneMenu3selectItems22" value="#{specRow.specializationItems}"/&gt; &lt;/ice:selectOneMenu&gt; &lt;/ice:column&gt; &lt;/ice:dataTable&gt; --&gt; </code></pre> <p>The value of the <code>selectOneMenu</code> (the <code>String</code>) should be in a session Bean, right?</p> <p><code>myBean</code> class is in fact application scoped. I have a list of this object <code>List&lt;myBean&gt;</code> called <code>specBean</code> as you can see in my JSP code where the <code>dataTable</code> value is set to that.</p> <p>What do you suggest, should I have <code>n</code> different variables for the names of the <code>selectOneMenu</code> to save in the session? How do you suggest to do that?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload