<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Best way to read values from the CMS in a JSF dialog</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog</link><description>&lt;p&gt;Hi there
I wonder what is the best way to get a CMS value in a value-field of a JSF/HMTL dialog.&lt;/p&gt;
&lt;p&gt;My first Approach was: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;h:outputText value="&amp;lt;%=ivy.cms.co('/#{data.type}/dialog/infoText')%&amp;gt;" &amp;lt;/h:outputText&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this wont work due to the '&amp;lt;' in front of the '%'. My current apporach now is to read the CMS values in the dialog-bean by a scriptstep. Then accessing them by &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;h:outputText value="&amp;lt;%=ivy.cms.co('/#{data.lblInfoText')%&amp;gt;" &amp;lt;/h:outputText&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but this can't be the best solution. Does anyone knows the proper way to add CMS values in a jsf value-field?&lt;/p&gt;
&lt;p&gt;thx in advance!&lt;/p&gt;
&lt;p&gt;EDIT:&lt;/p&gt;
&lt;p&gt;This is the exact line I use in the code.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;h:outputText value="#{ivy.cms.co('/#{data.sma}/dialog/lblInputtext')}" style="height: 300px; width:450px"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this line i eliminated the dynamic sma #{data.sma}.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;h:outputText value="#{ivy.cms.co('/sma25/dialog/lblInputtext')}" style="height: 300px; width:450px"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Neither of these lines work. They do compile but when I press on the link in the engine-browser i get the following exception still:&lt;/p&gt;
&lt;p&gt;HTTP Status 500 - javax.el.PropertyNotFoundException: Property 'co' not found on type ch.ivyteam.ivy.page.engine.jsp.JspCms&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;type Exception report&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;message javax.el.PropertyNotFoundException: Property 'co' not found on type ch.ivyteam.ivy.page.engine.jsp.JspCms

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: javax.el.PropertyNotFoundException: Property 'co' not found on type ch.ivyteam.ivy.page.engine.jsp.JspCms
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)
        org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
        ch.ivyteam.ivy.dialog.execution.jsf.controller.rest.IvyRestServiceFilter.doFilter(IvyRestServiceFilter.java:54)
        ch.ivyteam.ivy.dialog.execution.jsf.controller.IvyFacesInstanceFilter.filterAsSystem(IvyFacesInstanceFilter.java:104)
        ch.ivyteam.ivy.dialog.execution.jsf.controller.IvyFacesInstanceFilter.access$0(IvyFacesInstanceFilter.java:79)
        ch.ivyteam.ivy.dialog.execution.jsf.controller.IvyFacesInstanceFilter$1.call(IvyFacesInstanceFilter.java:55)
        ch.ivyteam.ivy.dialog.execution.jsf.controller.IvyFacesInstanceFilter$1.call(IvyFacesInstanceFilter.java:1)
        ch.ivyteam.ivy.security.internal.SecurityManager.executeAsSystem(SecurityManager.java:1425)
        ch.ivyteam.ivy.dialog.execution.jsf.controller.IvyFacesInstanceFilter.filter(IvyFacesInstanceFilter.java:49)
        ch.ivyteam.ivy.dialog.execution.jsf.controller.IvyFacesInstanceFilter.doFilter(IvyFacesInstanceFilter.java:37)
        com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)
        com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
&lt;/code&gt;&lt;/pre&gt;</description><atom:link href="https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 26 Nov 2013 16:42:01 -0500</lastBuildDate><item><title>Comment by Daniel Oechslin on Nikel Weis's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#138</link><description>&lt;p&gt;After some fiddling it worked. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;h:outputText value="#{ivy.cms.co('/your/folder/in/cms/yourLabel')}" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I can't figure why it didn't work the whole time. In the end I changed nothing compared to the answer of Nikel.&lt;/p&gt;
&lt;p&gt;Thx to all who helped!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Tue, 26 Nov 2013 16:42:01 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#138</guid></item><item><title>Comment by Peter Stöckli on Nikel Weis's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#137</link><description>&lt;p&gt;Have a look at the FormDemo in the HtmlDialogDemos it seems to work there like this: "&amp;lt;p:outputlabel value="#{ivy.cms.co('/ch.ivyteam.htmldialog.demo/FormDemo/Labels/Name')}" for="Name"/&amp;gt; "&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Stöckli</dc:creator><pubDate>Tue, 26 Nov 2013 14:52:34 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#137</guid></item><item><title>Comment by Daniel Oechslin on Nikel Weis's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#136</link><description>&lt;p&gt;I did a full clean. And the spelling is correct. I added the code I use. But the Problem seems to be the method call. The method you use simply doesn't exist in the API in this context. :-(&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Tue, 26 Nov 2013 13:59:01 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#136</guid></item><item><title>Comment by Nikel Weis on Nikel Weis's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#128</link><description>&lt;p&gt;&lt;a href="/users/36/daniel-oechslin/"&gt;&lt;a href="/users/36/daniel-oechslin/"&gt;@Daniel&lt;/a&gt;&lt;/a&gt;: Something seems to be wrong here. This code should work (retested it). Did you try it in a "clean" projects environment? Did you recheck spelling? Because in your initial question you used a el-Expression as well. Otherwise I've to resign here. Sorry. Or provide full code example in your initial question.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikel Weis</dc:creator><pubDate>Mon, 25 Nov 2013 14:46:50 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#128</guid></item><item><title>Comment by Daniel Oechslin on Nikel Weis's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#127</link><description>&lt;p&gt;Dear Nikel&lt;/p&gt;
&lt;p&gt;Unfortunately your line:
&amp;lt;h:outputtext value="#{ivy.cms.co('/your/folder/in/cms/yourLabel')}"/&amp;gt;&lt;/p&gt;
&lt;p&gt;Triggers the following exception:&lt;/p&gt;
&lt;p&gt;javax.servlet.ServletException: javax.el.PropertyNotFoundException: Property 'co' not found on type ch.ivyteam.ivy.page.engine.jsp.JspCms&lt;/p&gt;
&lt;p&gt;Do you have any other ideas how to Access the CMS from whitin JSF-Code?&lt;/p&gt;
&lt;p&gt;&lt;a href="/users/12/nikel-weis/"&gt;&lt;a href="/users/12/nikel-weis/"&gt;@Nikel&lt;/a&gt;&lt;/a&gt; regarding if I use a CMS-JSF page or a HTML-Page&lt;/p&gt;
&lt;p&gt;I am using a HTML-user-page.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Mon, 25 Nov 2013 14:35:15 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#127</guid></item><item><title>Comment by Nikel Weis on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#125</link><description>&lt;p&gt;&lt;a href="/users/36/daniel-oechslin/"&gt;&lt;a href="/users/36/daniel-oechslin/"&gt;@Daniel Oechslin&lt;/a&gt;&lt;/a&gt;: Do you use a jsp-Page (created within the CMS) or are you using a view which is created within a HTML-User dialog? By the way: Better edit your initial question or comment to the answer you are refering to. That will save the administrators tiome cleaning up our threads. ;)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikel Weis</dc:creator><pubDate>Mon, 25 Nov 2013 14:26:56 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#125</guid></item><item><title>Comment by Nikel Weis on Nikel Weis's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#121</link><description>&lt;p&gt;You're welcome. :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikel Weis</dc:creator><pubDate>Mon, 25 Nov 2013 13:22:59 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#121</guid></item><item><title>Comment by Daniel Oechslin on Nikel Weis's answer</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#120</link><description>&lt;p&gt;worked perfectly!&lt;/p&gt;
&lt;p&gt;thx for the fast help!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Mon, 25 Nov 2013 13:22:10 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog#120</guid></item><item><title>Answer by Nikel Weis</title><link>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog/119</link><description>&lt;p&gt;Try:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;h:outputText value="#{ivy.cms.co('/your/folder/in/cms/yourLabel')}" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nikel Weis</dc:creator><pubDate>Mon, 25 Nov 2013 12:24:41 -0500</pubDate><guid>https://answers.axonivy.com/questions/118/best-way-to-read-values-from-the-cms-in-a-jsf-dialog/119</guid></item></channel></rss>