【发布时间】:2017-02-14 20:55:36
【问题描述】:
我想知道在这种情况下是否有办法打开新标签:
我在包含客户的页面中有一个表格 (searchCustomer.jsf)
在每一行我都有一个命令链接来编辑这个特定的客户。
命令链接的代码是这个:
<p:column styleClass="buttonColumn" exportable="false" >
<p:commandLink title="#{msg.set}"
action="#{searchCustomerManageBean.setCustomer(customer)}"
disabled="#{ not searchCustomerManageBean.canEdit(customer)}"
value="#{msg.edit}"/>
</p:column>
在托管 bean 中我有 setCustomer 函数:
public String setCustomer(Customer customer) {
setcustomerSelected(customer);
final DataTable d1 = (DataTable) FacesContext.getCurrentInstance().getViewRoot().findComponent("form:basicDT");
int first1 = d1.getFirst();
actualPage = first1;
WebUtils.putObjectOnFlashContext("customerId", customer.getCustomerId());
WebUtils.putObjectOnFlashContext("Back page", "GO_TO_CUSTOMER_SEARCH");
WebUtils.putObjectOnFlashContext("read only", Boolean.FALSE);
return "GO_TO_CUSTOMER";
}
我已经在 faces-config.xml 中设置了页面
faces-config.xml
<navigation-case>
<from-outcome>GO_TO_CUSTOMER_SEARCH</from-outcome>
<to-view-id>/pages/searchCustomer.jsf</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>GO_TO_CUSTOMER</from-outcome>
<to-view-id>/pages/manageCustomer.jsf</to-view-id>
<redirect/>
</navigation-case>
如果我只是单击链接,该功能会执行我想要的操作。 (页面转到manageCustomer.jsf);
但如果我尝试在新选项卡中打开链接(右击 -> 在新选项卡中打开)(页面返回到我的 searchCustomer.jsf)
有没有办法让最后一个选项(在新选项卡中打开)与第一个选项(点击链接)一样工作?
如果您需要更多信息,请告诉我
【问题讨论】: