RE: I need to customize the dataScroller
Hi I think your description sounds like a nice component... Templates ... or ... extending? I don't know of any template... I usually look at existing components and how they are done. Extending... Check out the code for the datascroller... something tells me it could work... shameless_plugand when the code is done: check out jsf-comp.sf.net /shameless_plug regards Alexander From: robinhoo [mailto:[EMAIL PROTECTED] Sent: Sunday, April 09, 2006 10:56 PMTo: MyFaces DiscussionSubject: I need to customize the dataScroller Hello All,I need to customize the data Scroller that are t:dataScroller -- tomahawk's componentso that it displays alphabetic instead of numbers and make other modifications like formatting spaces between alphabetic and displaying all alphabet and disabling the ones that are not returned in the results.for example suppose that the returned data contains only names so I need to display all characters and disabling the ones the are not returned in the result. Also I'm wondering if I can develop my Owen components and how to do this is there any standards or templates I should use like implementing or extending interface/class ?best regards,-- Ali Abd El Aziz Ali
Re: I need to customize the dataScroller
Hi Andreas,I would like to thank you for your help in Hibernate and in Java but really I want to do what I was asked for simply because this is the Design that I was asked to follow.anyway if you find that characters dataScroller looks ugly you can rename it as elementFilterwhich will be a new component that you will pass to it the alphabetic range and it will render the result categorized into it and will alow the filtering based on the character you will choose. anyway my main question was can I customize the data Scroller or can I develop my Owen components and how to do this is there any standards or templates I should use like implementingor extending interface/class and by exploring the web I find that linkhttp://today.java.net/pub/a/today/2004/07/16/jsfcustom.htmlI think it is useful thank you Andreas for your reply,Best regardsOn 4/9/06, Andreas Zeller - zit-systems [EMAIL PROTECTED] wrote:Hi Ali,The best thing to do would be implementing your own data model, as you should anyway. The datascroller is based on element count, not onspecific start/end characters. So, something completely different.What you want to do is use simple java methods that are bound to yourdata model. For example, if you are using hibernate, you would initially collect allthe elemtents and filter them into result sets, starting with thedesired letter. You could achieve that by making speficic statements... Fill a selectOneMenu with all the start-letters you have and onchangeperform a select on your database that fits your needs.Using a dataScroller-like element for that would look ugly. Do youreally want to have 26 letters visible to the user at all time? Better take a pulldown menu like the selectOneListBox, and only fill it withthose letters that are actually available, which you collected on init.Anyway... If you are not using hibernate or any database, just plain lists the come from whereever, you could just use the methodstartsWith(String s) on the type String.Building your own component for that would be a real bloat from my pointof view.Andreas robinhoo wrote: Hello All, I need to customize the data Scroller that are t:dataScroller -- tomahawk's component so that it displays alphabetic instead of numbers and make other modifications like formatting spaces between alphabetic and displaying all alphabet and disabling the ones that are not returned in the results.for example suppose that the returned data contains only names so I need to display all characters and disabling the ones the are not returned in the result. Also I'm wondering if I can develop my Owen components and how to do this is there any standards or templates I should use like implementingor extending interface/class ? best regards, -- Ali Abd El Aziz Ali-- Ali Abd El Aziz Ali Software Developer OpenCrafthttp://aabdelaziz.blogspot.com/
Re: I need to customize the dataScroller
Hi Ali, The best thing to do would be implementing your own data model, as you should anyway. The datascroller is based on element count, not on specific start/end characters. So, something completely different. What you want to do is use simple java methods that are bound to your data model. For example, if you are using hibernate, you would initially collect all the elemtents and filter them into result sets, starting with the desired letter. You could achieve that by making speficic statements... Fill a selectOneMenu with all the start-letters you have and onchange perform a select on your database that fits your needs. Using a dataScroller-like element for that would look ugly. Do you really want to have 26 letters visible to the user at all time? Better take a pulldown menu like the selectOneListBox, and only fill it with those letters that are actually available, which you collected on init. Anyway... If you are not using hibernate or any database, just plain lists the come from whereever, you could just use the method startsWith(String s) on the type String. Building your own component for that would be a real bloat from my point of view. Andreas robinhoo wrote: Hello All, I need to customize the data Scroller that are t:dataScroller -- tomahawk's component so that it displays alphabetic instead of numbers and make other modifications like formatting spaces between alphabetic and displaying all alphabet and disabling the ones that are not returned in the results. for example suppose that the returned data contains only names so I need to display all characters and disabling the ones the are not returned in the result. Also I'm wondering if I can develop my Owen components and how to do this is there any standards or templates I should use like implementing or extending interface/class ? best regards, -- Ali Abd El Aziz Ali