• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

getting problem while using �x:dataTable� and �x:updateActionListener�

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new to jsf and I m using my faces. I m getting problem regarding �x ataTable� and �x:updateActionListener�. I am actually I have seen some posts regarding �x ataTable� and �x:updateActionListener� but I donot able to solve my problem. Plz chk this problem and tell me where I m doing wrong.
The problem is that when I click on the link instead of send that particular row (or taskId) it sends the whole List and then it iterate the whole list and display the list row values on the next page. Here is the code:

inbox.jsp

<x ataTable id="data"
styleClass="scrollerTable"
headerClass="standardTable_Header"
footerClass="standardTable_Header"
rowClasses="standardTable_Row1,standardTable_Row2"
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
var="task"
value="#{inboxTaskBean.taskList}"
preserveDataModel="true"
rows="10"
>

<h:column>
<f:facet name="header">
<h utputText value="#{messages['label_taskId']}" />
</f:facet>
<h utputText value="#{task.taskId}" />
</h:column>

<h:column>
<f:facet name="header">
<h utputText value="#{messages['label_weburi']}" />
</f:facet>

<x:commandLink action="task" immediate="true" >
<h utputText value="#{task.webFormURI}" />

<x:updateActionListener property="#{taskForm.taskId}" value="#{task.taskId}" />
</x:commandLink>

</h:column>

</x ataTable>


TaskForm.java

import javax.faces.context.FacesContext;

public class TaskForm {

private String taskId = null;
private String webFormURI = null;

public TaskForm(){
System.out.println("Task Form: " + taskId);
}

public String getTaskId() {
return taskId;
}

public void setTaskId(String taskId) {

System.out.println("I m in setTaskId : " + taskId);
if(taskId != null){
InboxTask inboxTask = getList().getTask(taskId);
System.out.println("Complete Task : " + inboxTask.toString());
if(inboxTask != null){
insId = inboxTask.getInsId();
webFormURI = inboxTask.getWebFormURI();
}
}
}

public String getWebFormURI() {
return webFormURI;
}

public void setWebFormURI(String webFormURI) {
this.webFormURI = webFormURI;
}

private SelectTaskBean getList()
{
Object obj = FacesContext.getCurrentInstance().getApplication().getVariableResolver()
.resolveVariable(FacesContext.getCurrentInstance(), "inboxTaskBean");
return (SelectTaskBean) obj;
}
}

taskForm.jsp


<f:facet name="body">
<h anelGroup>
<x:saveState value="#{taskForm.taskId}" />

<h anelGrid columns="1" styleClass="countryFormTable"
columnClasses="countryFormLabels" >
<h anelGroup>
<h utputText value="#{taskForm.taskId}" />
<h utputText value="#{taskForm.webFormURI}" />

</h anelGroup>

</h anelGrid>
</h anelGroup>
</f:facet>

Regards,
Farooq Mahmood
[email protected]
reply
    Bookmark Topic Watch Topic
  • New Topic