<h:dataTable id="nameMenuTable" value="#{menuMgrBean.nameMenu}" var="das"
width="100%" cellspacing="0" cellpadding="0"
rowClasses="#{menuMgrBean.rowClasses}" border="0" style="text-align:center;"
onmouseover="document.title='#{das.name}';">

</h:dataTable>
1.
我想把#{das.name}传给document.title,可以吗?
2.或者onmouseover方法调用
javascript的一个方法,#{das.name}作为参数传进去,这样可以吗?

解决方案 »

  1.   

    <script type="text/javascript">
    function regEvent(hid,hname,dish_price)
    {
        alert(hid);
        document.form2.hid.value=hid;
        document.form2.hname.value=hname;
        document.form2.dish_price.value=dish_price;
        document.form2.submit();
    }
    </script>//此处省略无关代码若干onclick="regEvent('${mifmv.menu_dish_id}','${mifmv.dish_name}','${mifmv.dish_price}');"可以将EL表达式传给js方法