Skip to main content

how to use JSF EL in jmaki.accordionMenu

3 replies [Last post]
yughandhar
Offline
Joined: 2008-02-20
Points: 0

Greetings,

for example the following script is throwing an exception where empAction is a JSF managed bean.

JSP script :

Exception :

on Glass Fish :
java.lang.ClassCastException: com.sun.el.ValueExpressionImpl cannot be cast to java.lang.String
at jmaki.runtime.IOUtil.createJavaScriptObject(IOUtil.java:108)
at jmaki.runtime.IOUtil.createJavaScriptObject(IOUtil.java:73)
at jmaki.runtime.WidgetCommonRenderer.writeAddWidget(WidgetCommonRenderer.java:245)
at jmaki.runtime.WidgetCommonRenderer.writeResources(WidgetCommonRenderer.java:145)

on JSP page :
com.sun.el.ValueExpressionImpl cannot be cast to java.lang.String'

With Cheers
Yughandhar Kakani

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kenpaulsen
Offline
Joined: 2005-03-30
Points: 0

Yughandhar,

What version of JSF are you using? It appears you are using JSF 1.2, however, I don't understand why you're getting a ValueExpressionImpl at that point in the code. Did you manually call setValue() and pass in a ValueExpression Object? getValue() should evaluate a ValueExpression. Are you using Mojarra or MyFaces?

When did you get this exception? During the initial page load, or after you resubmitted the page?

I did find (and fixed) a bug in jMaki that caused the ClassCastException if the value wasn't a String at that point in the code (i.e. for you it was a ValueExpression). However, it should not have been a ValueExpression at that point. If you're manually setting the value to a ValueExpression, you should be calling component.setValueExpression("value", expression).

Good luck!

Ken Paulsen
https://jsftemplating.dev.java.net

yughandhar
Offline
Joined: 2008-02-20
Points: 0

can some one spare some time to look into this issue !!
my project strucked with this issue
cant we trigger managed bean method from the jmaki.accordionMenu links ?
if no is there any work around to do the same.i need to trigger manged bean metod from the accordianmenu link click.

if explanation is not sufficient to look into the issue please let me know the same

Thanks & Cheers
yughandhar kakani

gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

You can not use partial value binding expressions in a jMaki value. The entire value needs to be generated by the managed bean.

This post has the solution you are looking for:

http://forums.java.net/jive/thread.jspa?messageID=251086

There is more on how to do this here:

https://ajax.dev.java.net/usingFaces.html

We are in the process of updating this document. I would also recommend the JSP quick start guide as it talks about dealing with server side JSON.

https://ajax.dev.java.net/quickstartJSP.html

Let us know if this doesn't work for you.

-Greg