<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Use import enum in xhtml page</title><link>https://answers.axonivy.com/questions/1417/use-import-enum-in-xhtml-page</link><description>&lt;p&gt;Hello everybody!&lt;/p&gt;
&lt;p&gt;Can I use import enum in Ivy Designer?
Example: like show case of primefaces extension
&lt;a href="http://www.primefaces.org/showcase-ext/sections/utils/importEnum.jsf"&gt;http://www.primefaces.org/showcase-ext/sections/utils/importEnum.jsf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1417/use-import-enum-in-xhtml-page" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 07 Sep 2015 14:28:21 -0400</lastBuildDate><item><title>Comment by Hap Em on Reguel Wermelinger's answer</title><link>https://answers.axonivy.com/questions/1417/use-import-enum-in-xhtml-page#1458</link><description>&lt;p&gt;Hello Reguel,&lt;/p&gt;
&lt;p&gt;Thank you very much for your support!
But, the solution is not flexible for us (just like a work around)
I hope that ivy can support like we do in eclipse! :)&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hap Em</dc:creator><pubDate>Mon, 07 Sep 2015 14:28:21 -0400</pubDate><guid>https://answers.axonivy.com/questions/1417/use-import-enum-in-xhtml-page#1458</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1417/use-import-enum-in-xhtml-page/1420</link><description>&lt;p&gt;To make it work you have to ensure, that &amp;lt;pe:importenum&amp;gt; can access the enum class it references in the type attribute.&lt;/p&gt;
&lt;p&gt;Unfortunately ivy currently only supports the access to converters and managed beans from ivy projects. So the pe:importEnum will raise a classNotFoundException if your enum is defined in an ivyProject.&lt;/p&gt;
&lt;p&gt;To work around this problem you could copy the compiled enum class into the global webapp classes container: designer/webapps/ivy/WEB-INF/classes or if you already have it in a JAR put it into designer/webapps/ivy/WEB-INF/lib.&lt;/p&gt;
&lt;p&gt;A big drawback of this solution is, that you no longer can have different version of this classes in multiple PMVs. The class is global available for any PMV in your application. And of course you have to deploy it manually on the server side.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;To support java sources which will be compiled directly into this global webapp classes you could do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Java Perspective -&amp;gt; Create a new Source Folder (e.g. src_webContent)&lt;/li&gt;
&lt;li&gt;Add the enum you wan't to access from the pe:importEnum to this source folder&lt;/li&gt;
&lt;li&gt;Add a virtual folder which references WEB-INF/classes into you project: Context Menu of Project -&amp;gt; New -&amp;gt; Folder -&amp;gt; Advanced -&amp;gt; Link to alternate Location -&amp;gt; Variables -&amp;gt; ECLIPSE_HOME -&amp;gt; Extend -&amp;gt; webapps/ivy/WEB-INF/classes -&amp;gt; OK &lt;img alt="alt text" src="https://answers.axonivy.com/upfiles/addVirtualFolderToWcClasses.PNG"&gt;&lt;/li&gt;
&lt;li&gt;Configurate the src_webContent folder to use a specific output folder: Java Perspective -&amp;gt; Context Menu of Project -&amp;gt; Properties -&amp;gt; Java Build Path -&amp;gt; Source -&amp;gt; Check: Allow output folder for source folders -&amp;gt; Edit the output of src_webContent -&amp;gt; choose the virtual folder as target (which was create in step 3) &lt;img alt="alt text" src="https://answers.axonivy.com/upfiles/virtualFolderAsOutputLocation.PNG"&gt;&lt;/li&gt;
&lt;li&gt;Done. Sources within this special src_webContent folder should be globally accessible within JSF views. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This adventurous project configuration can be inspected within this demo project: &lt;a href="/upfiles/demoPrimeImportEnum-globalClasses_51.iar"&gt;demoPrimeImportEnum-globalClasses_51.iar&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 30 Jul 2015 13:39:10 -0400</pubDate><guid>https://answers.axonivy.com/questions/1417/use-import-enum-in-xhtml-page/1420</guid></item></channel></rss>