Command Link not invoking Backend Bean

Components, Ajax Framework, Utilities and More.
Post Reply
abdulrahmanar
Posts: 7
Joined: 31 Oct 2016, 05:22

10 Jul 2017, 09:47

Hi,

Based on this topic i have searched a lot, after trying all the suggestions i couldn't find solution to my problem. So only i am posting this.

I have a datatable -> column -> commandlink.

When i click the commandlink, the backend bean has to invoke and update the values of the bean and same to be update in the datatable.

Whenever i am clicking the commandlink on the first page(pagination), the call is invoking. If i click on other pages(other than 1st page), it doesn't invoke the backend bean rather it redirects to the 1st page of the datatable.

I have tried many solutions like ajax=false or true, process="@this", action or actionListener, kept bean in ViewScope or SessionScope.

Environment:
IBM WebSphere Portal 8.5

Following is the code, please help to suggest the solution.

Code: Select all

<!-- jsf:pagecode language="java" location="/src/pagecode/CommandLinkTestView.java" --><!--/jsf:pagecode -->
<div xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:portlet="http://java.sun.com/portlet_2_0"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>

<h:body>
<h:form>
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-g-12 ui-lg-12 ui-md-12".
<h4>Data Table</h4>
<p:dataTable id="consultanttable" var="consultant" value="#{commandLinkTestBean.consultants}" widgetVar="filteredConsultant" paginator="true" rows="5" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" reflow="true" styleClass="porDataTable">

	<f:facet name="header">
		List of Consultants
	</f:facet>
	
	<p:column headerText="Id" style="text-align: center;">
		<h:outputText value="#{consultant.id}"></h:outputText>
	</p:column>
	
	<p:column headerText="Type" style="text-align: center;">
		<h:outputText value="#{consultant.assessmentType}"></h:outputText>
	</p:column>
	
	<p:column headerText="Stage" style="text-align: center;">
		<h:outputText value="#{consultant.stage}"></h:outputText>
	</p:column>
	
	<p:column headerText="Temp Title" style="text-align: center;">
		<h:outputText value="#{consultant.tempTitle}"></h:outputText>
	</p:column>
	
	<p:column headerText="Updated By" style="text-align: center;">
		<h:outputText value="#{consultant.updatedBy}"></h:outputText>
	</p:column>
	
	<p:column headerText="Updated On" style="text-align: center;">
		<h:outputText value="#{consultant.dateUpdated}">
			<f:convertDateTime pattern="dd/MM/yyyy"></f:convertDateTime>
		</h:outputText>
	</p:column>
	
	<p:column headerText="Status" style="text-align: center;">
		<p:commandLink action="#{commandLinkTestBean.commandLinkCheck}" value="Status">
		</p:commandLink>
	</p:column>
	
<p:dataTable>
</div>
</div>
</div>
</h:form>
</h:body>
</div>

abdulrahmanar
Posts: 7
Joined: 31 Oct 2016, 05:22

17 Jul 2017, 09:10

Can anyone please let me know suggestions on this issue.

kukeltje
Expert Member
Posts: 8499
Joined: 17 Jun 2010, 13:34
Location: Netherlands

17 Jul 2017, 11:00

http://stackoverflow.com/questions/2118 ... nput-value

And an h:body and h:head inside a div???
Ronald van Kuijk
______________________________
PrimeFaces 5.2, PrimeFaces plus 0.0.2 | JbossWildfly 8.1| Mojarra 2.2.8
Fedora 21, Firefox 'most recent'
Read the forum posting rules
Beginners: https://jsf.zeef.com/bauke.scholtz

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Rafaelfr1 and 9 guests