File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes dataTable & commandLink problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable & commandLink problem" Watch "dataTable & commandLink problem" New topic

dataTable & commandLink problem

Alex Ostrikov

Joined: Jul 27, 2006
Posts: 2

I've got a jsf page (page1) and backing bean (bean1).
page1 looks something like this:


<h:inputText value="#{}"/>

<%--button just reloads the page--%>
<h:commandButton value="Show them" action=""/>


<h:dataTable value="#{bean1.someList}" var="obj">
<h:commandLink value="Show object" action="bean1.go"/>



bean1 looks something like this:
class Bean1 {
private String name;

public getName() {...}
public setName(String name) {...}

public List getSomeList() {
// get list of objects from DB with the name =

public void setSomeList(List list) {


I enter some value into inputText and hit commandButton.
The page1 reloads with new dataTable generated.

The problem is when I click commandLink from the dataTable method
bean1.go never gets invoked !!!
Instead page1 just reloads with the same view.

Does anybody have any thoughts where is the problem?

A would really appreciate any help.
Alex Ostrikov

Joined: Jul 27, 2006
Posts: 2
One more important thing:
it works when bean1 is in session scope,
but does not work when it is in request scope where I need it to be in.
It is sorta covered in the JavaRanch Style Guide.
subject: dataTable & commandLink problem
It's not a secret anymore!