Hi there I wonder what is the best way to get a CMS value in a value-field of a JSF/HMTL dialog.

My first Approach was:

<h:outputText value="<%=ivy.cms.co('/#{data.type}/dialog/infoText')%>" </h:outputText>

But this wont work due to the '<' 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

<h:outputText value="<%=ivy.cms.co('/#{data.lblInfoText')%>" </h:outputText>

but this can't be the best solution. Does anyone knows the proper way to add CMS values in a jsf value-field?

thx in advance!

EDIT:

This is the exact line I use in the code.

<h:outputText value="#{ivy.cms.co('/#{data.sma}/dialog/lblInputtext')}" style="height: 300px; width:450px"/>

In this line i eliminated the dynamic sma #{data.sma}.

<h:outputText value="#{ivy.cms.co('/sma25/dialog/lblInputtext')}" style="height: 300px; width:450px"/>

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:

HTTP Status 500 - javax.el.PropertyNotFoundException: Property 'co' not found on type ch.ivyteam.ivy.page.engine.jsp.JspCms


type Exception report

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)

asked 25.11.2013 at 11:50

Daniel%20Oechslin's gravatar image

Daniel Oechslin
45771121
accept rate: 36%

edited 26.11.2013 at 11:08


Try:

<h:outputText value="#{ivy.cms.co('/your/folder/in/cms/yourLabel')}" />
link

answered 25.11.2013 at 12:24

Nikel%20Weis's gravatar image

Nikel Weis
321262933
accept rate: 57%

worked perfectly!

thx for the fast help!

(25.11.2013 at 13:22) Daniel Oechslin Daniel%20Oechslin's gravatar image

You're welcome. :)

(25.11.2013 at 13:22) Nikel Weis Nikel%20Weis's gravatar image

Dear Nikel

Unfortunately your line: <h:outputtext value="#{ivy.cms.co('/your/folder/in/cms/yourLabel')}"/>

Triggers the following exception:

javax.servlet.ServletException: javax.el.PropertyNotFoundException: Property 'co' not found on type ch.ivyteam.ivy.page.engine.jsp.JspCms

Do you have any other ideas how to Access the CMS from whitin JSF-Code?

@Nikel regarding if I use a CMS-JSF page or a HTML-Page

I am using a HTML-user-page.

(25.11.2013 at 14:35) Daniel Oechslin Daniel%20Oechslin's gravatar image

@Daniel: 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.

(25.11.2013 at 14:46) Nikel Weis Nikel%20Weis's gravatar image

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. :-(

(26.11.2013 at 13:59) Daniel Oechslin Daniel%20Oechslin's gravatar image

Have a look at the FormDemo in the HtmlDialogDemos it seems to work there like this: "<p:outputlabel value="#{ivy.cms.co('/ch.ivyteam.htmldialog.demo/FormDemo/Labels/Name')}" for="Name"/> "

(26.11.2013 at 14:52) Peter Stöckli ♦ Peter%20St%C3%B6ckli's gravatar image

After some fiddling it worked.

<h:outputText value="#{ivy.cms.co('/your/folder/in/cms/yourLabel')}" />

I can't figure why it didn't work the whole time. In the end I changed nothing compared to the answer of Nikel.

Thx to all who helped!

(26.11.2013 at 16:42) Daniel Oechslin Daniel%20Oechslin's gravatar image
showing 5 of 7 show 2 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×72

Asked: 25.11.2013 at 11:50

Seen: 2,270 times

Last updated: 26.11.2013 at 16:54