您的位置:首页 > 其它

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

2013-02-21 18:30 381 查看
页面

<td>

<h:selectOneRadio
value="#{gmRecoverGPGoods.isGood}">

<f:selectItem
itemLabel="#{messages['page.select.pet.pet']}" itemValue="0"
/>

<f:selectItem
itemLabel="#{messages['page.table.tableheader.mail.goodsString']}"
itemValue="1" />

<a:support
event="onclick" action="#{gmRecoverGPGoods.choose}"

reRender="recover"></a:support>

</h:selectOneRadio>

</td>

<table>

<tr>

<td>

<h:inputText
id = "searchName" value="#{gmRecoverGPGoods.inputName}"
></h:inputText>

</td>

<td><a:commandButton
id="searchGoods"
value="#{messages['page.button.searchGoodOrPet']}"

reRender="recover"

action="#{gmRecoverGPGoods.goodSearch()}"></a:commandButton> </td>

</tr>

</table>

action代码

public void goodSearch() {

if (isGood == 1) {

list = new
ArrayList<SelectItem>();

for
(SelectItem goods : allGoodsName) {

if
(goods.getLabel().contains(inputName)) {

list.add(goods);

}

}

} else {

list = new
ArrayList<SelectItem>();

for
(SelectItem pets : allPetsName) {

if
(pets.getLabel().contains(inputName)) {

list.add(pets);

}

}

}

}

而不能用

public String goodSearch() {

if (isGood == 1) {

list = new
ArrayList<SelectItem>();

for
(SelectItem goods : allGoodsName) {

if
(goods.getLabel().contains(inputName)) {

list.add(goods);

}

}

} else {

list = new
ArrayList<SelectItem>();

for
(SelectItem pets : allPetsName) {

if
(pets.getLabel().contains(inputName)) {

list.add(pets);

}

}

}

return “/test.xhtml”;

}

因为ajax异步标签 后退时只认识 return 如果没有return就返回最开始那个页面 就很好 !!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: