javascript提交到jsf

来源:互联网 发布:windows syswow64 编辑:程序博客网 时间:2024/06/05 21:11

点击一个区域,提交到jsf bean。


<div class="grida">       <div class="category" onclick="document.getElementById('categoty_filter_form:aa:#{status.index}:abutton').click()">        <p>#{category.name}</p>        <h:commandLink id="abutton" action="#{categoryController.print()}" >            <f:param name="category" value="#{category.name}" />        </h:commandLink>        <canvas id="grida_#{status.index}" class="category_type_#{category.type}" width="40" height="20" style="border:0px solid #000000;">        </canvas>    </div></div>

后台是

public void print(){    System.out.println(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("category"));}