javascript提交到jsf

點擊一個區域,提交到jsf bean。


<div class="grida">   
    <div class="category" οnclick="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"));
}



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章