You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by michael pe <mi...@gmail.com> on 2011/05/27 05:51:07 UTC
NullPointerException when using Palette
Palette NPE
I try to use Palette, but always get a NPE when set the its selected
property.
I have already tried to override equals, hashCode, toString, but still have
this exception.
Anyone have any clue what I might be doing wrong? Thanks!
Caused by: java.lang.NullPointerException
at
org.apache.tapestry5.internal.util.SelectModelRenderer.option(SelectModelRenderer.java:49)
at
org.apache.tapestry5.corelib.components.Palette$SelectedRenderer.render(Palette.java:158)
at
org.apache.tapestry5.internal.structure.RenderPhaseEventHandler$1.render(RenderPhaseEventHandler.java:89)
at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
... 128 more
-----tml file:
<t:Palette model="types" encoder="types" selected="selectedTypes" />
-----java file:
@Property
@Persist
private GenericSelectModel<Type> types; //GenericSelectModel
@Property
@Persist
private List<Type> selectedTypes;
--
View this message in context: http://tapestry.1045711.n5.nabble.com/NullPointerException-when-using-Palette-tp4430840p4430840.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: NullPointerException when using Palette
Posted by michael pe <mi...@gmail.com>.
problem resolved
I implement equals in a wrong way....
--
View this message in context: http://tapestry.1045711.n5.nabble.com/NullPointerException-when-using-Palette-tp4430840p4430966.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: NullPointerException when using Palette
Posted by michael pe <mi...@gmail.com>.
GenericSelectModel is initialised like this
if (types == null) {
types = new GenericSelectModel<Type>(typeManager.findAll(), //findAll()
returns List<Type>
Type.class,
EntityDisplay.getColumn(Type.class),
EntityDisplay.CONTEXT, propertyAccess);
}
--
View this message in context: http://tapestry.1045711.n5.nabble.com/NullPointerException-when-using-Palette-tp4430840p4430843.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org