How to use facelets' ui:param in 8M1?

Answered

I have a JSF-managed session bean named selectContactSession. In my jsf page, I wrote

<ui:param name="model" value="#{selectContactSession.model}" />

Then IDEA cannot resolve the variable 'model'.

If I write

<c:set var="model" value="#{selectContactSession.model}" />

then IDEA understands what 'model' is.

I never use c:set in JSF so I'm not sure if I can replace all ui:param with it.

5 comments
Comment actions Permalink

We have the same problem. Parameter cannot be resolved by IDEA in child pages.

3
Comment actions Permalink

Same problem here, parameter cannot be resolved in the same page.

0
Comment actions Permalink

Bug still exists after 12 years... It is really annoying, isn't there a fix available somehow? Or a way to tell JSF that the parameter is expected or something without usind the c:set tag? I don't want to directly insert JSP tags into my application

0
Comment actions Permalink

There is no workaround, unfortunately. 

Here is the bug request for that: https://youtrack.jetbrains.com/issue/IDEA-63450

You can vote for it to be notified once there are updates. Your comments inside are also welcome. 

0
Comment actions Permalink

Actually, I found a workaround:

You can change your facelet from something like this:

<h:body>
<ui:composition>
<h:outputText value="#{parameterName}"/>
</ui:composition>
</h:body>

to something like this:

<h:body>
<!--@elvariable id="parameterName" type="java.lang.String"-->
<ui:composition>
<h:outputText value="#{parameterName}"/>
</ui:composition>
</h:body>

So, you basically just have to add this macro/comment/whatever and change the id and type accordingly, but this shouldn't be the only way

0

Please sign in to leave a comment.