0

Include tree page (List, View, Edit) in index and used same command tow page (List and View) .When I List.xhtml page ‘s View or Edit button click and open it; but View.xhtml page’s Edit button click then show in flowing massage:

Unable to find matching navigation case with from-view-id '/index.xhtml' for action '#{instituteController.viewEdit}' with outcome 'null'

.

I want View page’s Edit button click to edit page open into index page. List.xhtml code:

<h:commandButton action="#{instituteController.prepareView}" value="#{bundle.ListInstituteViewLink}">
   <f:ajax execute="@form" render="@form"/>
</h:commandButton>

<h:commandButton action="#{instituteController.prepareEdit}" value="#{bundle.ListInstituteEditLink}">
    <f:ajax execute="@form" render="@form"/>
</h:commandButton>

View.xhtml code

 <h:commandButton action="#{instituteController.viewEdit}" value="#{bundle.ListInstituteEditLink}">
 <f:ajax execute="@form" render="@form"/>
</h:commandButton>

instituteController.java code:

   public String prepareEdit() {
    current = (Institute) getItems().getRowData();
    selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
    return "index";
}
 public String viewEdit() {

          return "null";
}

If I return "index" ; this command don't work. Again show this code:

          public String viewEdit() {

          return "index";
          }
4

2 に答える 2

0

Because you are returning "null", is written in your exception. Return empty string if you want to stay on the same page or name of the page where do you want to go.

于 2012-07-24T06:52:52.547 に答える
0

Your mistake is here:

public String viewEdit() {
    // ...
    return "null";
}

You're returning a String instance with value of "null". This is not the same as the literal null.

Fix it accordingly:

public String viewEdit() {
    // ...
    return null;
}

or just return nothing:

public void viewEdit() {
    // ...
}
于 2012-07-24T12:57:41.300 に答える