seam 框架 出现浏览器后退按钮问题

来源:互联网 发布:海岛22研究所升级数据 编辑:程序博客网 时间:2024/05/22 03:24

页面

<td>    
       
     <h:selectOneRadiovalue="#{gmRecoverGPGoods.isGood}">
            <f:selectItemitemLabel="#{messages['page.select.pet.pet']}" itemValue="0"/>
            <f:selectItemitemLabel="#{messages['page.table.tableheader.mail.goodsString']}"     itemValue="1" />
            <a:supportevent="onclick" action="#{gmRecoverGPGoods.choose}"
            reRender="recover"></a:support>
            
      </h:selectOneRadio>  
       
    </td> 

 

  <table>
     <tr>      
     <td>
     <h:inputTextid = "searchName" value="#{gmRecoverGPGoods.inputName}"></h:inputText>     
      </td>
     <td><a:commandButtonid="searchGoods"value="#{messages['page.button.searchGoodOrPet']}"
          reRender="recover"
      action="#{gmRecoverGPGoods.goodSearch()}"></a:commandButton> </td>
      

      </tr>      
     </table> 

action代码


 public void goodSearch() {
  if (isGood == 1) {
   list = newArrayList<SelectItem>();
   for(SelectItem goods : allGoodsName) {
    if(goods.getLabel().contains(inputName)) {
     list.add(goods);
    }
   }
  } else {
   list = newArrayList<SelectItem>();
   for(SelectItem pets : allPetsName) {
    if(pets.getLabel().contains(inputName)) {
     list.add(pets);
    }
   }
  }
 }
而不能用

public String goodSearch() {
  if (isGood == 1) {
   list = newArrayList<SelectItem>();
   for(SelectItem goods : allGoodsName) {
    if(goods.getLabel().contains(inputName)) {
     list.add(goods);
    }
   }
  } else {
   list = newArrayList<SelectItem>();
   for(SelectItem pets : allPetsName) {
    if(pets.getLabel().contains(inputName)) {
     list.add(pets);
    }
   }
  }

return “/test.xhtml”;
 }

因为ajax异步标签 后退时只认识 return 如果没有return就返回最开始那个页面 就很好 !!

 

原创粉丝点击