Jquery对话框文本框值绑定不起作用
我无法从jquery对话框中获取文本框值,下面是我的代码Jquery对话框文本框值绑定不起作用,jquery,jsf,Jquery,Jsf,我无法从jquery对话框中获取文本框值,下面是我的代码 $("#printbutton").click(function() { $("#print").dialog("open"); }); $("#print").dialog({ autoOpen : false, modal : true, resizable : false, draggable : false, show : {
$("#printbutton").click(function() {
$("#print").dialog("open");
});
$("#print").dialog({
autoOpen : false,
modal : true,
resizable : false,
draggable : false,
show : {
effect : "fade"
},
hide : {
effect : "fade"
},
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
JSF代码
<h:form>
<h:panelGroup layout="block" id="print">
<h:inputText value="#{bean.text1}" id="text1"/>
<h:inputText value="#{bean.text2}" id="text2"/>
<h:inputText value="#{bean.text3}" id="text3"/>
<h:commandButton action="#{bean.button} id="printbutton">
</h:panelGroup>
</h:form>
我能够从jsf页面调用button方法。
但是我的java代码中的三个文本框都是空值。请帮帮我。删除
$("#printbutton").click(function() {
$("#print").dialog("open");
});
按如下方式更改按钮:
<h:commandButton action="#{bean.button}
id="printbutton"
oncomplete="$('#print').dialog('open');"
/>
为文本框获取null
值是什么意思?托管bean的范围是什么?我们如何重现您当前的问题?您是否查看了stdout(控制台)?您是否看到文本框中的任何文本?我正在使用会话范围获取文本框值。但我得到的是空值。
<h:commandButton action="#{bean.button}
id="printbutton"
oncomplete="$('#print').dialog('open');"
/>