0
   <h:commandLink  action="http://192.168.2.66:8084/TekirMobile2/customerListDetailed.xhtml" value="#{item.code}" >
                                <h:inputHidden value="#{item.address}" />
                                 <h:inputHidden value="#{item.name}" />

                            </h:commandLink>

I have above code. This code in customerList.xhtml and after user click to the commandLink button i want to send input hidden value to customerListDetailed.xhtml. How can i do that?

4

1 回答 1

-1

为此,您可以在 commandLink 标记之后编写隐藏标记。请注意,您应该将上述代码添加到 h:form 标记中

例子:

      <h:form>
             <h:commandLink 
    action="http://192.168.2.66:8084/TekirMobile2/customerListDetailed.xhtml" 
            value="#{item.code}" >     
            </h:commandLink>
            <h:inputHidden value="#{item.name}" name="name" id="name" />
  <h:inputHidden value="#{item.address}" name="address" id="address" />
        </h:form>

支持豆

@ManagedBean(name="item")
public class Item implements Serializable{
    private String code;
    private String address;
    private String name;
    public Item(){
        String name= FacesContext.getCurrentInstance().
    getExternalContext().getRequestParameterMap().get("name");
        String address= FacesContext.getCurrentInstance().
    getExternalContext().getRequestParameterMap().get("address");
    }
   //getters and setters


}
于 2013-04-20T10:32:24.820 回答