Re: Palette component
I had the same problem. I am not sure what of the 5 things I did was the one that help, but what I did was: Implements Serializable Implements Comparable Override equals Override hashcode Override toString I am not sure how is implemented the Pallete, but most of the time is a good practice to implement this methods or override them if you are going to use your beans with other components. Serializable: so the components can serialize them, logic :D Comparable: It is used to reorder your beans on a list, or other things equals: well, how would other classes or components would know if one of your beans is equals to other if you do not override this ?. Hashcode: Used on some kinds Maps, lists, etc, to get faster searches, or something like this. toString: well, u know -- View this message in context: http://www.nabble.com/Palette-component-tp21678790p22090942.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
On Tue, Jan 27, 2009 at 1:30 AM, Davor Miku davorm...@gmail.com wrote: This method returns list of OptionModel objects. If you meant on this, this list is not empty. I'm not sure I'm following you. I said that some OptionModel seemed to be *null*. I didn't say that the list of OptionModels was *empty*. By the way, the code you posted seems to be right. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: Palette component
Hello, I just ran into the same problem. You are probably creating the available and select lists in 2 different methods, you need to do it in the same method with the SAME object(or at least with a list that doesn't reload when you pull your select) otherwise you get that null error(or at least that was my problem) because you are basically handing your palette objects in your select that do not exist in your available. I was using the GenericSelectModel from the JumpStart object select that you use as both your encoder and model. Not sure if it's the same problem that I was having but it sounds alot like it. Posting your java may help. --James -Original Message- From: Geoff Callender [mailto:geoff.callender.jumpst...@gmail.com] Sent: January-27-09 12:56 AM To: Tapestry users Subject: Re: Palette component Does this one that works help you? http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/component/cor einputcomponents On 27/01/2009, at 3:32 PM, Davor Miku wrote: Anyone, plaese? On Mon, Jan 26, 2009 at 10:30 PM, Davor Miku davorm...@gmail.com wrote: public ListOptionModel getOptions() { ListOptionModel list = new ArrayListOptionModel(); for (Category c : categories) { list.add(new CategoryOptionModel(c)); } return list; } This method returns list of OptionModel objects. If you meant on this, this list is not empty. I'm not sure I'm following you. On Mon, Jan 26, 2009 at 11:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku davorm...@gmail.com escreveu: Hi Thiago, Hi! Thanks for reply. Can you be more specific, please? It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind if the answer is as clear as you need. :) One of the parameters of Select is model. You should pass a SelectModel to it. Basically, a SelectModel is a list of OptionModel instances (SelectModel.getOptionModels()), one for each option to appear in your select tag (and component). Select does not support null OptionModel's returned by SelectModel.getOptionModels(), so the exception you seen happens. Summary: make sure the SelectModel returned by getCategoryModel() does not return nulls in its getOptionModels(). ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
I'm using AbstractSelectModel, and ValueEncoder interface. Palette is internally using two lists: one for available options and one for selected. Problem was I needed to change available options (for presentation purpose) So, selectedSet.contains(value); (from Pallete.java) retuned false even if 'value' is contained in selectedSet (available options). I don't know if I'm beaning clear. All lists contain objects of bean Category. Two categoies are equal if they have same id property. Besause I chaned name propery of available categories, selectedSet.contains returns false even if categories have same id. So, If you have similair problem just override equeas and hasSet methods of bean (bean in my case) in maner that suit your needs, and everything will work ok. Hope this helps. On Tue, Jan 27, 2009 at 7:07 AM, James Sherwood jsherw...@rgisolutions.comwrote: Hello, I just ran into the same problem. You are probably creating the available and select lists in 2 different methods, you need to do it in the same method with the SAME object(or at least with a list that doesn't reload when you pull your select) otherwise you get that null error(or at least that was my problem) because you are basically handing your palette objects in your select that do not exist in your available. I was using the GenericSelectModel from the JumpStart object select that you use as both your encoder and model. Not sure if it's the same problem that I was having but it sounds alot like it. Posting your java may help. --James -Original Message- From: Geoff Callender [mailto:geoff.callender.jumpst...@gmail.com] Sent: January-27-09 12:56 AM To: Tapestry users Subject: Re: Palette component Does this one that works help you? http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/component/cor einputcomponents On 27/01/2009, at 3:32 PM, Davor Miku wrote: Anyone, plaese? On Mon, Jan 26, 2009 at 10:30 PM, Davor Miku davorm...@gmail.com wrote: public ListOptionModel getOptions() { ListOptionModel list = new ArrayListOptionModel(); for (Category c : categories) { list.add(new CategoryOptionModel(c)); } return list; } This method returns list of OptionModel objects. If you meant on this, this list is not empty. I'm not sure I'm following you. On Mon, Jan 26, 2009 at 11:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku davorm...@gmail.com escreveu: Hi Thiago, Hi! Thanks for reply. Can you be more specific, please? It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind if the answer is as clear as you need. :) One of the parameters of Select is model. You should pass a SelectModel to it. Basically, a SelectModel is a list of OptionModel instances (SelectModel.getOptionModels()), one for each option to appear in your select tag (and component). Select does not support null OptionModel's returned by SelectModel.getOptionModels(), so the exception you seen happens. Summary: make sure the SelectModel returned by getCategoryModel() does not return nulls in its getOptionModels(). ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
Em Mon, 26 Jan 2009 23:56:26 -0300, Davor Miku davorm...@gmail.com escreveu: Hi! Hi! when currentCategories are initially null, it works fine, otherwise it's throwing exception: - java.lang.NullPointerExceptionStack trace org.apache.tapestry5.internal.util.SelectModelRenderer.option(SelectModelRenderer.java:49) It seems that your SelectModel had at least one null OptionModel added to it. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
Hi Thiago, Thanks for reply. Can you be more specific, please? On Mon, Jan 26, 2009 at 11:01 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 26 Jan 2009 23:56:26 -0300, Davor Miku davorm...@gmail.com escreveu: Hi! Hi! when currentCategories are initially null, it works fine, otherwise it's throwing exception: - java.lang.NullPointerExceptionStack trace org.apache.tapestry5.internal.util.SelectModelRenderer.option(SelectModelRenderer.java:49) It seems that your SelectModel had at least one null OptionModel added to it. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku davorm...@gmail.com escreveu: Hi Thiago, Hi! Thanks for reply. Can you be more specific, please? It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind if the answer is as clear as you need. :) One of the parameters of Select is model. You should pass a SelectModel to it. Basically, a SelectModel is a list of OptionModel instances (SelectModel.getOptionModels()), one for each option to appear in your select tag (and component). Select does not support null OptionModel's returned by SelectModel.getOptionModels(), so the exception you seen happens. Summary: make sure the SelectModel returned by getCategoryModel() does not return nulls in its getOptionModels(). ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
public ListOptionModel getOptions() { ListOptionModel list = new ArrayListOptionModel(); for (Category c : categories) { list.add(new CategoryOptionModel(c)); } return list; } This method returns list of OptionModel objects. If you meant on this, this list is not empty. I'm not sure I'm following you. On Mon, Jan 26, 2009 at 11:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku davorm...@gmail.com escreveu: Hi Thiago, Hi! Thanks for reply. Can you be more specific, please? It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind if the answer is as clear as you need. :) One of the parameters of Select is model. You should pass a SelectModel to it. Basically, a SelectModel is a list of OptionModel instances (SelectModel.getOptionModels()), one for each option to appear in your select tag (and component). Select does not support null OptionModel's returned by SelectModel.getOptionModels(), so the exception you seen happens. Summary: make sure the SelectModel returned by getCategoryModel() does not return nulls in its getOptionModels(). ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
Anyone, plaese? On Mon, Jan 26, 2009 at 10:30 PM, Davor Miku davorm...@gmail.com wrote: public ListOptionModel getOptions() { ListOptionModel list = new ArrayListOptionModel(); for (Category c : categories) { list.add(new CategoryOptionModel(c)); } return list; } This method returns list of OptionModel objects. If you meant on this, this list is not empty. I'm not sure I'm following you. On Mon, Jan 26, 2009 at 11:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku davorm...@gmail.com escreveu: Hi Thiago, Hi! Thanks for reply. Can you be more specific, please? It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind if the answer is as clear as you need. :) One of the parameters of Select is model. You should pass a SelectModel to it. Basically, a SelectModel is a list of OptionModel instances (SelectModel.getOptionModels()), one for each option to appear in your select tag (and component). Select does not support null OptionModel's returned by SelectModel.getOptionModels(), so the exception you seen happens. Summary: make sure the SelectModel returned by getCategoryModel() does not return nulls in its getOptionModels(). ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette component
Does this one that works help you? http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/component/coreinputcomponents On 27/01/2009, at 3:32 PM, Davor Miku wrote: Anyone, plaese? On Mon, Jan 26, 2009 at 10:30 PM, Davor Miku davorm...@gmail.com wrote: public ListOptionModel getOptions() { ListOptionModel list = new ArrayListOptionModel(); for (Category c : categories) { list.add(new CategoryOptionModel(c)); } return list; } This method returns list of OptionModel objects. If you meant on this, this list is not empty. I'm not sure I'm following you. On Mon, Jan 26, 2009 at 11:17 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Tue, 27 Jan 2009 00:10:36 -0300, Davor Miku davorm...@gmail.com escreveu: Hi Thiago, Hi! Thanks for reply. Can you be more specific, please? It's 1:12 AM here in Belo Horizonte (Brazil), so please don't mind if the answer is as clear as you need. :) One of the parameters of Select is model. You should pass a SelectModel to it. Basically, a SelectModel is a list of OptionModel instances (SelectModel.getOptionModels()), one for each option to appear in your select tag (and component). Select does not support null OptionModel's returned by SelectModel.getOptionModels(), so the exception you seen happens. Summary: make sure the SelectModel returned by getCategoryModel() does not return nulls in its getOptionModels(). ;) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Palette Component doesn't work in Safari browser
rocksolid wrote: The Palette component doesnt work in Safari browser. Has anyone come across this before and is there a possible solution to this. Thanks can't connect to JIRA right now, but i believe this to have been fixed in 4.1 -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]