-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.
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
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; } }
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?
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.
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.
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.
Yes you are right Hawk But i am not using hibernate thats why need some solution
Maybe you can inspect Hibernate's source code to figure out how it performs dirty check.
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
Asked: 2012-12-04 07:48:15 +0800
Seen: 761 times
Last updated: Jan 19 '13