2

how to dynamic binding with java code? [closed]

asked 2012-12-04 07:48:15 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I am using

@bind

in My ZUl page for Listcell value but now i am using Java code to rendered the Listbox by getItemRendered Method now anyone know if user edit any textbox inside listcell how can we bind this thing if we are using java code.

delete flag offensive retag edit

The question has been closed for the following reason "too localized" by sjoshi
close date 2013-02-08 07:24:18

39 Replies

Sort by ยป oldest newest

answered 2012-12-12 10:53:26 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Actually i am giving facility of Reordering and Sorting(With Millions of record). And i made a New Component for that where user can slect which header he want to see and in which columns he wants to sorts.Please let me know if you are able to do Binding with getItemrendered().

Thanks

link publish delete flag offensive edit

answered 2012-12-26 03:53:40 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2012-12-26 03:56:59 +0800

Hi, sjoshi:
I think if you make a list for your requirement, it will be more clear for others.
As I read now, I think your requirements are:

1. specify data binding in dynamically created components. e.g. textbox in listcell
2. user can
- select which header to see
- which columns to sort
- can change header position
3. To know bound object is changed by data binding.

For requirement 1,2, please reference Dennis's reply. It can fulfill these requirements. He implements a Template object that adds data binding annotation programmatically on components. For now, you cannot do it in a ItemRenderer.

Fro requirement 3, there is no elegant solution for now. The one I can think is to add a dirty flag in a bean. And set the dirty flag when one of setter method is called.

public class Item{
     boolean modified = false;
    public void setName(String name){
        this.name = name;
        modified = true;
    }

}

link publish delete flag offensive edit

answered 2012-12-26 05:47:40 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Sorry i did not get from last few week to see the solution but i will check and you are right these all are my requirements.And your last point 3 you are tling i have to create these type of variables for each properties in bean?

link publish delete flag offensive edit

answered 2012-12-26 06:39:35 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2012-12-26 06:39:54 +0800

For requirement 3.

You only need "one dirty flag for one class". Only those classes that you want to know their modification status need this flag.

Usually, you don't need to tell which property of a bean is changed, because any property change cause you to save whole bean into a database.

link publish delete flag offensive edit

answered 2012-12-26 08:12:58 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

That is not exactly the dirty checking ,If you will check the Hibernate it will save the changed value not all values I need something like that if any value changed that value only saved in DB.

link publish delete flag offensive edit

answered 2012-12-27 00:21:31 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

If you save your beans with Hibernate dynamic-update enabled, you don't need to tell Hibernate which property is modified. Hibernate will check it for you.

link publish delete flag offensive edit

answered 2012-12-27 04:46:47 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Yes you are right Hawk But i am not using hibernate thats why need some solution

link publish delete flag offensive edit

answered 2012-12-28 08:48:46 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

Maybe you can inspect Hibernate's source code to figure out how it performs dirty check.

link publish delete flag offensive edit

answered 2013-01-19 15:02:05 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

From Here you can see and download war file . Now you can do column reordering in listbox with Binding in ZUL pages no need to write lots of java code for binding

link publish delete flag offensive edit

Question tools

Follow

RSS

Stats

Asked: 2012-12-04 07:48:15 +0800

Seen: 761 times

Last updated: Jan 19 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More