p:commandButton in p:columnGroup not firing any action

UI Components for JSF
stigjin
Posts: 8
Joined: 16 Sep 2010, 12:21

06 Jan 2011, 15:49

I'm currently working on a p:dataTable containing several rows of data. I really would like a row for adding data to the dataTable.
You can see my code for the dataTable below. When I press the button nothing happens. When I move the button outside the table
it gets fired but the values in my "add-row" are all null.

Any clues?

Code: Select all

<p:dataTable id="table" var="code" value="#{CodeController.codes}">

				<p:column style="width:50px">

					<f:facet name="header">
						<h:outputText value="CodeId" />
					</f:facet>

					<h:outputText value="#{code.codeId}" />

				</p:column>

				<p:column style="width:150px">

					<f:facet name="header">
						<h:outputText value="Beskrivelse" />

					</f:facet>

					<h:outputText id="desc_out" value="#{code.description}" />


				</p:column>

				<p:column>

					<f:facet name="header">
						<h:outputText value="Options" />
					</f:facet>

				</p:column>
					
				<p:columnGroup type="footer">
					<p:row>
						<p:column style="background:white;">
							<f:facet name="footer">
								<h:inputText label="NewCodeId" id="newCodeId"
									value="#{CodeController.newCodeId}"
									style="width:30px;float: left;">
								</h:inputText>
							</f:facet>
						</p:column>

						<p:column style="background:white;">
							<f:facet name="footer">
								<h:inputText label="NewCodeDescription" id="newCodeDescription"
									value="#{CodeController.newCodeDescription}"
									style="width:225px;float: left" title="Ny kode beskrivelse">
									<f:ajax update=":form1:realDeal" />
								</h:inputText>
							</f:facet>
						</p:column>

						<p:column style="background:white;">
							<f:facet name="footer">
								<p:commandButton value="+" id="addButton"
									action="#{CodeController.createNewCode}"
									style="width:30px;float:left;" />
							</f:facet>
						</p:column>
						
					</p:row>
					
				</p:columnGroup>


			</p:dataTable>

PrimeFaces 2.2.final (JSF 2.0) on Websphere Application Server 8.0 beta.

c.beikov
Posts: 4
Joined: 27 Jul 2011, 13:34

22 Aug 2011, 16:19

Have you already found a solution for that problem?
I am using Primefaces 3.0M3 and the issue is still present!

Using MyFaces 2.1.1 on Websphere 8.

ruddy_robot
Posts: 32
Joined: 07 Sep 2010, 12:37

02 Apr 2012, 11:39

Im trying this too, has anyone come to a solution?

You can workarround firing action problem by using remotecomand...

but inputtext data is not submitted :-(

ruddy_robot
Posts: 32
Joined: 07 Sep 2010, 12:37

02 Apr 2012, 15:58

OK, I have really tried everything...

this is definitely a bug.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

02 Apr 2012, 16:25

Search Google for following:

forum.primefaces.org subtable action smithh032772 panelgroup mojarra
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

ruddy_robot
Posts: 32
Joined: 07 Sep 2010, 12:37

02 Apr 2012, 16:55

Hi smithh032772, thank you but your link doesnt help me :-(

Im trying to make a table like this:

http://imageshack.us/photo/my-images/40 ... ntzvc.png/
Image

Uploaded with ImageShack.us
Ive allready made it with two tables glued together but now I have problems to keep col sizes in sync...

If I try to put <p:commandButton> and <h:inputText> components into <p:column><h:facet name="header"></></> directly it works...

But if I put the same into <p:columnGroup>, commandButton doesnt fire and inputText value is not getting into DOM...

I hope someone can help with a workarround.

Sorry for my bad english :-)

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 Apr 2012, 00:45

If dataTable p:columnGroup does not support that, then add a separate p:dataTable that contains one row that has your commandButton and editable columns, and make sure p:dataTable with p:columnGroup is updated in the bean and updated via AJAX update="..." of the commandButton (or ajax="false").

If PrimeFaces does not support something, I just do my best to find a valid workaround and go with it. PrimeFaces does a lot, but it does not handle/cover every idea/solution/implementation. You can still use PrimeFaces to develop a workable and usable solution/implementation.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

ruddy_robot
Posts: 32
Joined: 07 Sep 2010, 12:37

03 Apr 2012, 09:54

Hi smithh032772,

I really appreciate your help :-) Yes I did it with 2 datatables glued together. On for adding data and one for showing data. I think it would be nice if primefaces support commandbuttons and form data in columnGroup in the future but for now I have a good workarround.

Thank you again.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

03 Apr 2012, 15:39

Create an issue in issue tracker, refer to this forum topic URL in the new issue, provide simple test case (xhtml/bean) in the new issue (not your entire app, just one that can duplicate defect/issue), and reply here with new issue # and URL of new issue. If many people vote for the issue to be fixed (or NEW FEATURE to be added), then it will be considered for review (accepted), and fixed in FUTURE or (ASAP).
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

LStrike
Posts: 27
Joined: 24 Jul 2013, 14:33

18 Dec 2013, 13:59

I know, this topic is (very) old, but I would like to post my solution. I used the "onClick-Method" to trigger a remote command, which calls my Bean.

Code: Select all


<h:form>

<p:dataTable id="testTable"
					value="#{myListBean.demoList}"
					var="_demo" rows="5" paginator="true"
					paginatorAlwaysVisible="false" paginatorPosition="bottom">

                    <p:columnGroup type="header">  
                        <p:row>  
                            <p:column headerText="Demo" />
                            
                             <p:column style="background:white;">
                                <f:facet name="header">

                                <p:commandButton styleClass="ui-panel-titlebar-icon ui-corner-all ui-state-default" 
                                                    onclick="headerRemote();"
                                                    update="@form" 
                                                    icon="ui-icon-plus" 
                                                    title="Testbutton"/>
                                                        
                                </f:facet>
                            </p:column> 
                        </p:row>
                    </p:columnGroup>

					<p:column>
						<p:outputLabel value="#{_demo.name}" />
					</p:column>
				</p:dataTable>

<p:remoteCommand name="headerRemote" actionListener="#{myBean.testHeaderClick}"
                         out="testTable" update="@form"/>

</h:form>


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests