Hi there! Another fun JSF related question.

I want a nested el:

<ui:param name="sma" value="#{data.sma}/dialog/lblInputtext')}" />
<ui:param name="smalbl" value="#{sma}" />
<h:outputText value="#{smalbl}" style="height: 300px; width:450px"/>

The output is the following:

#{ivy.cms.co('/sma25/dialog/lblInputtext')}

I want exactly this output evaluated by jsf. It doesn't work when I put the result in #{} one more time. JSF prints out a warning due to wrong syntax.

Has anyone else tried to nest el's?

thx for help!

asked 26.11.2013 at 16:53

Daniel%20Oechslin's gravatar image

Daniel Oechslin
(suspended)
accept rate: 39%

Nesting EL expressions is illegal syntax. You should see the #{} as one big space where variables/strings can interact with each other.

(27.11.2013 at 08:41) Nikel Weis Nikel%20Weis's gravatar image

THX for the hint!

(27.11.2013 at 11:37) Daniel Oechslin Daniel%20Oechslin's gravatar image

I solved the problem using a ManagedBean. Concatenating the strings in the bean itself and reading it via EL-function call. I took this solution because I needed a value from the dialog-data-class and a value from the cms. This could not be solved in the JSF-Dialog due to the nested EL impossibility.

ManagedBean:

public String getCmsValue(){
        return Ivy.cms().co(getConcatenatedValues());
    }

JSF:

<h:outputText value="#{dialogBean.getCmsValue()}"

THX to Raphael Bürgin

link

answered 28.11.2013 at 09:06

Daniel%20Oechslin's gravatar image

Daniel Oechslin
(suspended)
accept rate: 39%

Glad I could help

(28.11.2013 at 13:20) Raphael Bürgin Raphael%20B%C3%BCrgin's gravatar image

Use #{ivy.cms.co(data.sma.concat('/dialog/lblInputtext'))}

link

answered 26.11.2013 at 22:07

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

Hi this works if the two values are both stored in the CMS.

What if one value is stored in the data class and this value should get concatenated with something from the CMS?

How to do that? like data.sma is a value from the data class.

(27.11.2013 at 12:02) Daniel Oechslin Daniel%20Oechslin's gravatar image
1

In your way I've never tried. I always (outsource) nested EL. For a workaround you can try something like this: In the Javasource you can join cms Strings easily. public String getRoleName(){ return Ivy.cms().co("/ch/lepa/common/roles/" + role.getName() ); }

(27.11.2013 at 13:36) Raphael Bürgin Raphael%20B%C3%BCrgin's gravatar image

Not sure if I understand you right. You want to concat as string from the data class and one from the cms? Then you can use two el expressions the result of both expressions are concated.

Example:

<p:outputlabel value="#{ivy.cms.co('/dialog/lbInputtest')} #{data.sma}"/>

(27.11.2013 at 13:54) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

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:

×79

Asked: 26.11.2013 at 16:53

Seen: 3,675 times

Last updated: 28.11.2013 at 13:20