Gowthamraj Somanathan Gowthamraj Somanathan - 1 year ago 89
Java Question

Jquery dialog textboxes value binding is not working

i am not able to get textbox value from jquery dialog, below is my code

$("#printbutton").click(function() {

autoOpen : false,
modal : true,
resizable : false,
draggable : false,
show : {
effect : "fade"
hide : {
effect : "fade"
open: function (type, data) {

JSF Code

<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">

Java Code

String text1;
String text2;
String text3;

public String getText1() {
return text1;

public void setText1(String text1) {
this.text1 = text1;

public String getText2() {
return text2;

public void setText2(String text2) {
this.text2 = text2;

public String getText3() {
return text3;

public void setText3(String text3) {
this.text3 = text3;

public void button(){

I am able to call the button method from jsf page.
But I am getting null values for all the three textboxes in my java code. please help me.

Answer Source


$("#printbutton").click(function() {

Change your button like this:

<h:commandButton action="#{bean.button} 

(I suppose jquery is able to find all related ids)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download