p:commandButton not working in p:dataGrid

UI Components for JSF
Post Reply
gigi
Posts: 4
Joined: 07 Oct 2010, 10:29

07 Oct 2010, 16:44

Hi all,

I have a very strange problem with tag commandButton; I use it in a dataGrid to call an action which is correctly written in my bean and this is the code:

Code: Select all

<p:commandButton value="value" action="#{myBean.myAction}" oncomplete="mydialog.show(); update=":myform:formData:myUpdated">
             <f:setPropertyActionListener value="#{resultSetObject.objectKEY}" target="#{resultSetCtrl.selectedObjectKEY}" />
</p:commandButton>
The dialog comes up correctly but the action is never execute. If I replace the p:commandButton with an h:commandButton it works fine, but this is NOT a solution..
Here is the code working correctly:

Code: Select all

<h:commandButton value="value" action="#{myBean.myAction}" onclick="qdvDialog.show();">
	<f:setPropertyActionListener value="#{resultSetObject.objectKEY}" target="#{resultSetCtrl.selectedObjectKEY}" />
	<f:ajax render=":myform:formData:myUpdated" />
</h:commandButton>
using: Mojarra 2.0.3 (FCS b03) and WebSphere 7.0

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Oct 2010, 17:44

Welcome to PrimeFaces.

Can you post your dataGrid code as well?

gigi
Posts: 4
Joined: 07 Oct 2010, 10:29

07 Oct 2010, 18:20

Here it is:

Code: Select all

<h:form id="formData">
		<p:dataGrid var="object"
			value="#{mybean.listObjects}"
			columns="3" rows="9">

			<p:column>
				<p:panel header="#{object.title}" layout="block"
					style="width:300px;height:300px; text-align:center">
					<h:panelGrid columns="1" style="width:100%">

						<p:graphicImage value="${object.thumbnailURL}" />
						<h:panelGroup>
							<p:commandButton value="value" action="#{myBean.myAction}" oncomplete="mydialog.show() update=":myform:formData:myUpdated">
                                                               <f:setPropertyActionListener value="#{resultSetObject.objectKEY}" target="#{resultSetCtrl.selectedObjectKEY}" />
                                                        </p:commandButton>
						</h:panelGroup>
					</h:panelGrid>
				</p:panel>
			</p:column>
		</p:dataGrid>
Don't care about copy and paste error..
Thank you

gigi
Posts: 4
Joined: 07 Oct 2010, 10:29

08 Oct 2010, 00:50

I'm sorry for this second message, but I want to complete that page as soon as possible..
Any ideas? :roll:

Tanks!

pvanleeu
Posts: 17
Joined: 15 Dec 2010, 18:31

07 Feb 2011, 17:01

I have the same issue but with a p:dataTable..

Except there is one thing. I have two datatables on one page. If I put this

Code: Select all

<div>

					<h:outputLabel for="savedQueries" value="Saved Searches: "/>
					<h:selectOneMenu id="savedQueries" converter="basicMetricsQueryConverter">
						<f:selectItems value="#{basicMetricsQueryServiceBean.basicMetricQueries}"/>
					</h:selectOneMenu>
					<p:commandButton value="Search"
									 actionListener="#{basicMetricsQueryServiceBean.refreshQueryAfterSelect}"/>
				</div>
in between. All the buttons stop working. Yet h:commandButton seems to be working (though I need the update tag in the p:commandButton).
Mojarra 2.0.2; GlassFish 3.0.1; PrimeFaces 2.2.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests