SelectOneMenu in incell edition

UI Components for JSF
Post Reply
jgaslain
Posts: 5
Joined: 16 Dec 2016, 19:17

03 Jan 2017, 13:28

Hello,

Using Primefaces 6.0 Jsf 2.1 on a tomcat 7,

I am trying to use cell edition mode in primefaces datable with many input components in the same cell in input facet mode. Maybe this is not the right way to use cell edition mode, please tell me then.

Anyway, it seems to work well, except for the selectOneMenu : when I select one item, i am getting out of cell edition, whereas i would like to follow filling other inputs... The problem does not occur with inputText and calendar.

I wonder if 6.1 would correct the problem. If it does, i will not wait for 6.1 and will certainly take an Elite access.

Thanks in advance,

Code: Select all

<p:cellEditor>
   <f:facet name="output">
      <h:outputText value="#{smartFeeding.getTotal(tank, day).amount}"/>
   </f:facet>
   <f:facet name="input" >
      <h:form>
         <table class="no-border-table">
            <tr class="no-border-header">
               <td>Qté (kg)</td>
               <td>Heure</td>
               <td>Silo</td>
               <td>Aliment</td>
               <td>Trts Int.</td>
               <td>Trts Ext.</td>
               <td></td>
            </tr>
            <ui:repeat value="#{smartFeeding.getFeeding(tank, day)}" var="feeding">
               <tr>
                  <td>
                     <p:inputNumber value="#{feeding.amount}" size="5" />
                  </td>
                  <td>
                     <p:calendar pattern="HH:mm" timeOnly="true" value="#{feeding.day}" size="5" label="Heure" />
                  </td>
                  <td>
                     <p:selectOneMenu style="width: 30px;">
                        <f:selectItem itemLabel="Silo" itemValue="" />
                     </p:selectOneMenu>
                  </td>
                  <td>
                     <p:selectOneMenu style="width: 30px;">
                        <f:selectItem itemLabel="Aliment" itemValue="" />
                     </p:selectOneMenu>
                  </td>
                  <td>
                     <p:selectOneMenu style="width: 30px;" value="#{smartFeeding.tmp}" converter="intTrtConverter">
                        <f:selectItem itemLabel="Trts Int." itemValue="" />
                        <f:selectItems value="#{smartFeeding.internalTreatments}" var="trt" itemLabel="#{trt.text}" />
                        <p:ajax partialSubmit="true" process="@this" async="true" />
                     </p:selectOneMenu>
                  </td>
                  <td>
                     <p:selectOneMenu style="width: 30px;">
                        <f:selectItem itemLabel="Trts Ext." itemValue="" />
                        <f:selectItems value="#{smartFeeding.externalTreatments}" var="trt" itemLabel="#{trt.text}" />
                     </p:selectOneMenu>
                  </td>
                  <td>
                     <p:commandButton type="button" icon="ui-icon-delete" />
                  </td>
               </tr>
            </ui:repeat>
            <tr><td>
               <p:commandButton type="button" icon="ui-icon-add" />
            </td></tr>
         </table>
      </h:form>
   </f:facet>
</p:cellEditor>
Primefaces 6.0
JSF 2.1
Tomcat 7.0
Java 8

jgaslain
Posts: 5
Joined: 16 Dec 2016, 19:17

06 Jan 2017, 12:08

I just modified my problem description in first post as no one answers.
Primefaces 6.0
JSF 2.1
Tomcat 7.0
Java 8

jgaslain
Posts: 5
Joined: 16 Dec 2016, 19:17

23 Jan 2017, 10:13

Solved using JSF selectOneMenu (h:selectOneMenu).
But I do not understand why...
Primefaces 6.0
JSF 2.1
Tomcat 7.0
Java 8

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests