rowEditor problem when datatable rendered attribute is set

UI Components for JSF
Post Reply
syphinx
Posts: 24
Joined: 09 Nov 2010, 16:50

18 Feb 2011, 12:17

Hi,

I have a datatable with rowEditor. It was working without problems until I set its rendered attribute.

I changed the rendered attribute to false by default. When user selects a booleancheckbox, it is set to true and rendered with ajax. But In this case, rowEditor is not working correctly. when pencil icon is clicked, row is switched to in-cell editing mode, but it is not switched to display mode even you clicked ok icon or cancel icon.

Is there a way to solve this problem?

Thanks,

Code: Select all

       <h:form prependId="false">
		
		<h:selectBooleanCheckbox id="remember" value="#{tableBean.render}">
			<p:ajax update="carList" />
		</h:selectBooleanCheckbox>
		
		<p:outputPanel id="carList" >
		    <p:dataTable var="car" value="#{tableBean.carsSmall}" rendered="#{tableBean.render}">
		
		        <f:facet name="header">
		            In-Cell Editing
		        </f:facet>
		
		        <p:column headerText="Model" style="width:150px">
		            <p:cellEditor>
		                <f:facet name="output">
		                    <h:outputText value="#{car.model}" />
		                </f:facet>
		                <f:facet name="input">
		                    <p:inputText value="#{car.model}" style="width:100%"/>
		                </f:facet>
		            </p:cellEditor>
		        </p:column>
		
		        <p:column headerText="Year" style="width:150px">
		            <p:cellEditor>
		                <f:facet name="output">
		                    <h:outputText value="#{car.year}" />
		                </f:facet>
		                <f:facet name="input">
		                    <p:inputText value="#{car.year}" style="width:100%"/>
		                </f:facet>
		            </p:cellEditor>
		        </p:column>
		
		        <p:column headerText="Manufacturer" style="width:150px">
		            <p:cellEditor>
		                <f:facet name="output">
		                    <h:outputText value="#{car.manufacturer}" />
		                </f:facet>
		                <f:facet name="input">
		                    <h:selectOneMenu value="#{car.manufacturer}" >
		                        <f:selectItems value="#{tableBean.manufacturers}"
		                            var="man" 
		                            itemLabel="#{man}"
		                            itemValue="#{man}" />
		                    </h:selectOneMenu>
		                </f:facet>
		            </p:cellEditor>
		        </p:column>
		
		        <p:column headerText="Color" style="width:150px">
		            <p:cellEditor>
		                <f:facet name="output">
		                    <h:outputText value="#{car.color}" />
		                </f:facet>
		                <f:facet name="input">
		                    <h:selectOneMenu value="#{car.color}" >
		                        <f:selectItems value="#{tableBean.colors}"
		                            var="color" 
		                            itemLabel="#{color}"
		                            itemValue="#{color}" />
		                    </h:selectOneMenu>
		                </f:facet>
		            </p:cellEditor>
		        </p:column>
		
		        <p:column headerText="Options">
		            <p:rowEditor />
		        </p:column>
		
		    </p:dataTable>
              </p:outputPanel>
			
      	</h:form>
Primefaces 2.2.1
Mojarra 2.0.4-b09

sasisuman
Posts: 8
Joined: 21 Jun 2011, 10:17

21 Jun 2011, 10:19

Hi i have the same problem, did you get a solution???

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 55 guests