• Post Reply Bookmark Topic Watch Topic
  • New Topic

CreateValueBinding question  RSS feed

sridhar panini
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, I use x atatable and I select a row for the list and I get the exact value. But, my question is it tries to instantiate the same object again and again.
I have my JDBC call in the constructor and when ever I select a row it calls the JDBC statement.
Can anyone tell me how can I stop this repeated call to the DB.

here is what I do.
I do a binding in my datatable to a method having the following code and whenever I select a row It tries to call the JDBc statement inside the constructor.

Customer customer = (Customer )this.getDataTable().getRowData();
FacesContext ctx = FacesContext.getCurrentInstance();
ValueBinding binding = ctx.getApplication().createValueBinding("#{editCustomer }");
binding.setValue(ctx,customer );
ValueBinding binding = ctx.getApplication().createValueBinding("#{editEmployee }");
binding.setValue(ctx, new Employee());

Any help would be appreicated.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!