Questions Tagged With jsfhttps://answers.axonivy.com/tags/jsf/?type=rss&user=ahatiusquestions tagged <span class="tag">jsf</span>enThu, 13 Mar 2014 10:29:21 -0400selectOneMenu: Value will not be sethttps://answers.axonivy.com/questions/576/selectonemenu-value-will-not-be-set<p>I've got a dropdown menu, which gets the persons from our LDAP server. What I basically did was copying the SelectOneMenuDemo from the Demo files.</p> <p>However, it's displaying all persons correctly in the dropdown, but it won't set the selected person to my <em>data.manager</em>.</p> <p>This is the code from the demo:</p> <blockquote> <p>&lt;p:selectonemenu value="#{data.selectedPerson}" converter="ivy.ListItem"&gt;<br> &lt;f:selectitem itemlabel="Select One" itemvalue=""/&gt;<br> &lt;f:selectitems value="#{data.persons}" var="it" itemvalue="#{it}" itemlabel="#{it.name}"&gt;&lt;/f:selectitems&gt; &lt;f:selectitems value="#{data.morePersons}" var="it" itemvalue="#{it}" itemlabel="#{it.name}"&gt;&lt;/f:selectitems&gt; &lt;f:selectitem itemvalue="#{data.onePerson}" itemlabel="#{data.onePerson.name}"&gt;&lt;/f:selectitem&gt; &lt;/p:selectonemenu&gt; </p> </blockquote> <p>And this is what I wrote:</p> <blockquote> <p>&lt;p:selectonemenu id="manager" value="{data.manager}" converter="ivy.ListItem" style="width: 200px;"&gt; &lt;f:selectitems value="#{data.managers}" var="it" itemvalue="#{it}" itemlabel="#{it.cn}"&gt;&lt;/f:selectitems&gt; &lt;/p:selectonemenu&gt;</p> </blockquote> <p>Is there something I've forgotten? This looks exactly the same to me. Do I have to do something when I submit? I've got a multiview HTML dialog.</p>ahatiusThu, 13 Mar 2014 10:29:21 -0400https://answers.axonivy.com/questions/576/selectonemenu-value-will-not-be-setjsfDynamic amount of fileuploads: file not uploadinghttps://answers.axonivy.com/questions/273/dynamic-amount-of-fileuploads-file-not-uploading<p>I'd like to give the user the ability to choose the amount of attachments he'd like to provide. To do this I created a datatable with buttons to add and remove attachment-lines:</p> <pre><code>&lt;p:dataTable id="attachments" var="attachment" value="#{data.attachments}"&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/vendor')}"&gt;&lt;p:inputText value="#{attachment.vendor}" /&gt;&lt;/p:column&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/description')}"&gt;&lt;p:inputText value="#{attachment.description}" /&gt;&lt;/p:column&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/amount')}"&gt;&lt;p:inputText value="#{attachment.amount}" /&gt;&lt;/p:column&gt; &lt;p:column headerText="#{ivy.cms.co('/labels/attachment')}"&gt;&lt;p:fileUpload value="#{attachment.file}" mode="simple" /&gt;&lt;/p:column&gt; &lt;p:column headerText=""&gt;&lt;p:commandButton value="delete-row" update="attachments" action="#{logic.deleteAttachment(attachment)}" /&gt;&lt;p:commandButton value="add-row" update="attachments" action="#{logic.addAttachment()}" /&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; </code></pre> <p>The only problem is, that it seems to not upload the specified file. The submitted form is beeing processed by this script, the output of <strong>in.test</strong> beeing <strong>false</strong>:</p> <pre><code>for(Integer i = 0; i &lt; in.attachments.size(); i++) { in.test = in.attachments.get(i).file.exists().toString(); } </code></pre> <p>The Simple-Fileupload-Demo works, so I guess it can't be a problem with my installation / computer. I just cleared all of the attachments and uploaded only one. So while this is a foor loop, it just iterates through 1 time. Data is stored in my own Data Class <strong>Attachment</strong>, containing 4 attributes (Vendor, Description, Amount and File).</p>ahatiusTue, 21 Jan 2014 20:34:00 -0500https://answers.axonivy.com/questions/273/dynamic-amount-of-fileuploads-file-not-uploadingjsffileupload