<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Exception when using ch.ivyteam.ivy.scripting.objects.List on Primefaces</title><link>https://answers.axonivy.com/questions/1350/exception-when-using-ch-ivyteam-ivy-scripting-objects-list-on-primefaces</link><description>&lt;p&gt;Hi all&lt;/p&gt;
&lt;p&gt;I'm using primefaces 5 with HtmlUserDialog, in my page i'm using &amp;lt;p:selectmanycheckbox&amp;gt; that binding with a instance of ch.ivyteam.ivy.scripting.objects.List, for example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p:selectManyCheckbox value="#{data.selectedWeeklyDayList}" layout="pageDirection"&amp;gt;                                                   f:selectItems value="#{data.listWeekDay}" var="weekDay" 
    itemValue="#{weekDay}"
    itemLabel="#{weekDay.value}"/&amp;gt;  
/p:selectManyCheckbox&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And &lt;code&gt;selectedWeeklyDayList&lt;/code&gt; and &lt;code&gt;listWeekDay&lt;/code&gt; are instances of &lt;code&gt;ch.ivyteam.ivy.scripting.objects.List&lt;/code&gt;. 
When i submit this page, after several times, i got this exception:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IllegalAccessException: Class javax.faces.component.UIComponentBase can not access a member of class ch.ivyteam.ivy.scripting.objects.List with modifiers "private"
 RuntimeException: java.lang.IllegalAccessException: Class javax.faces.component.UIComponentBase can not access a member of class ch.ivyteam.ivy.scripting.objects.List with modifiers "private"
 IllegalStateException: Error restoring component: addNewEditForm_5649:selectedWeeklyDayList
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now i just have temporary solution to avoid this exception is i change from &lt;code&gt;ch.ivyteam.ivy.scripting.objects.List&lt;/code&gt; to &lt;code&gt;java.util.List&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Why do i face this issue? and is there any solutions to avoid it but i still can use &lt;code&gt;ch.ivyteam.ivy.scripting.objects.List&lt;/code&gt;? because i need to use some features of this class (for ex: clone() method)&lt;/p&gt;
&lt;p&gt;Thanks all.&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1350/exception-when-using-ch-ivyteam-ivy-scripting-objects-list-on-primefaces" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 03 Feb 2016 02:21:52 -0500</lastBuildDate><item><title>Answer by trungdv</title><link>https://answers.axonivy.com/questions/1350/exception-when-using-ch-ivyteam-ivy-scripting-objects-list-on-primefaces/1648</link><description>&lt;p&gt;Thanks for your support
it's problem because ivy list make it's constructor to be private then other caller can not create new instance. 
It's also a issue in JIRA of IvyTeam (&lt;a href="https://jira.axonivy.com/jira/browse/XIVY-427)"&gt;https://jira.axonivy.com/jira/browse/XIVY-427)&lt;/a&gt;
And it has been fixed in version 6.0.2 revision 50953&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Wed, 03 Feb 2016 02:21:52 -0500</pubDate><guid>https://answers.axonivy.com/questions/1350/exception-when-using-ch-ivyteam-ivy-scripting-objects-list-on-primefaces/1648</guid></item><item><title>Answer by HaraldWeber</title><link>https://answers.axonivy.com/questions/1350/exception-when-using-ch-ivyteam-ivy-scripting-objects-list-on-primefaces/1351</link><description>&lt;p&gt;Seems your getter and setter of data.selectedWeeklyDayList is private.&lt;/p&gt;
&lt;p&gt;To your clone() problem.
The interface List does not implement Cloneable. You have to use the actual Object. For example ArrayList.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;List&amp;lt;Object&amp;gt; list = new ArrayList&amp;lt;Object&amp;gt;();
list.clone(); &amp;lt;-- doesn't exist
((ArrayList) list).clone(); &amp;lt;-- unchecked cast to ArrayList. ArrayList implements Cloneable.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or you use ArrayList itself.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ArrayList&amp;lt;Object&amp;gt; list = new ArrayList&amp;lt;Object&amp;gt;();
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">HaraldWeber</dc:creator><pubDate>Fri, 05 Jun 2015 12:42:07 -0400</pubDate><guid>https://answers.axonivy.com/questions/1350/exception-when-using-ch-ivyteam-ivy-scripting-objects-list-on-primefaces/1351</guid></item></channel></rss>