aspose file tools*
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
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable & commandLink problem" Watch "dataTable & commandLink problem" New topic
Author

dataTable & commandLink problem

Alex Ostrikov
Greenhorn

Joined: Jul 27, 2006
Posts: 2
Hi,

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

------------------------------
...
<f:view>
<h:form>

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

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

...

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

</h:form>
</f:view>

------------------------

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 = bean1.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
Greenhorn

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dataTable & commandLink problem