So this time the requirement was to generate a primefaces tree on UI which demonstrates hierarchical relationship between some business objects. Easy enough, the only problem was to show the header of children once per parent something like:
Parent Header 1 Parent Header 2 Parent Header 3
Parent 1
|_____ Child 1A
Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Aa
|_____ Child 1Ab
|_____ Child 1B
|_____ Child 1C
Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Ca
The possible options are put a panelGroup and render it based upon whether children are present or not...
or the easy way where you can fix the model by adding one dummy child for headers only so the tree looks like:
Parent 1
|_____ Child 1A
|_____ (H) Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Aa
|_____ Child 1Ab
|_____ Child 1B
|_____ Child 1C
Child Header 1 Child Header 2 Child Header 3
|_____ (H) Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Ca
where this can be managed easily with model.
Parent Header 1 Parent Header 2 Parent Header 3
Parent 1
|_____ Child 1A
Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Aa
|_____ Child 1Ab
|_____ Child 1B
|_____ Child 1C
Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Ca
The possible options are put a panelGroup and render it based upon whether children are present or not...
or the easy way where you can fix the model by adding one dummy child for headers only so the tree looks like:
Parent 1
|_____ Child 1A
|_____ (H) Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Aa
|_____ Child 1Ab
|_____ Child 1B
|_____ Child 1C
Child Header 1 Child Header 2 Child Header 3
|_____ (H) Child Header 1 Child Header 2 Child Header 3
|_____ Child 1Ca
where this can be managed easily with model.
No comments:
Post a Comment