zoukankan      html  css  js  c++  java
  • h:commandButton

    h:commandButton提交表单,传递参数并跳转到另一个页面

    关键字: jsf问题

    xml代码:

    <h:commandButton id="editbutton" action="edit" image="/images/EDIT.jpg" actionListener="#  {search.edit}">
        <f:attribute name="ehrid" value="#{result.ehr_id}"/>
    </h:commandButton>

     

    页面跳转通过faces-config.xml文件来实现:

    <navigation-rule>
         <from-view-id>/pages/personalinfoselect.xhtml</from-view-id>
           <navigation-case>
             <from-outcome>edit</from-outcome>
             <to-view-id>/pages/personalinfoedit.xhtml</to-view-id>
           </navigation-case>
    </navigation-rule>

     

    参数传递actionListener事件来实现,后台代码:

     public void edit(ActionEvent event){
            String ehruser = (String) event.getComponent().getAttributes().get("ehrid");
            System.out.println("ehrusermap="+ehruser);
    }

    参数正常获得。

  • 相关阅读:
    sobel
    构造函数
    #pragma once & ifnde
    #pragma comment
    SET容器
    重载[] int& operator[ ]( )
    仿函数 operator()()
    remove_if erase
    vector
    map
  • 原文地址:https://www.cnblogs.com/lucky_dai/p/2007965.html
Copyright © 2011-2022 走看看