This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes problem with <h:selectOneMenu component --- identifier 'motorcycleCat' resolved to null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "problem with <h:selectOneMenu component --- identifier Watch "problem with <h:selectOneMenu component --- identifier New topic
Author

problem with <h:selectOneMenu component --- identifier 'motorcycleCat' resolved to null

Giannis nasdades
Greenhorn

Joined: Feb 27, 2009
Posts: 10
Hi all,

I have made a simple application with seam but i am facing problems with selectOneMenu and s:selectItems make them work together.

The functionality is as follows:
I have an xhtml page from where i want to use selectOneMenu and s:selectItems (which gives me a list of values from the database) in order to select one value.
After this when i click the button i want to search in another table and render the results in the page. Right now, when i click the link the page renders fine and i can successfully select one falue from the selectOneMenu list. After that, when i click the submit button I get the exception javax.el.PropertyNotFoundException: /motorcycleSearchAction.xhtml @23,44 value="#{motorcycleCat.category}": Target Unreachable, identifier 'motorcycleCat' resolved to null. The property that becomes null is the property that should be set
from the selectOneMenu.

I would be more than greatfull if you could asist me on this as i am stuck two days now.

The contents of my files are:

MotorcycleSearchAction.xhtml



My action jave file MotorcycleActionImpl is:


The interface is:



And below is the stack trace:




Any help would be appreciated.

Thanks in advance,
giannis

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Giannis nasdades wrote:I get the exception

javax.el.PropertyNotFoundException: /motorcycleSearchAction.xhtml @23,44 value="#{motorcycleCat.category}":
Target Unreachable, identifier 'motorcycleCat' resolved to null.

The property that becomes null is the property that should be set from the selectOneMenu.
You read it wrong. It is 'motorcycleCat' which is null, not 'category'.
So, this managed bean is nowhere available in the JSF scope?
I am not that familiar with Seam, but shouldn't you declare the bean as managed bean in faces-config.xml?
Giannis nasdades
Greenhorn

Joined: Feb 27, 2009
Posts: 10
Bauke Scholtz wrote:
Giannis nasdades wrote:I get the exception

javax.el.PropertyNotFoundException: /motorcycleSearchAction.xhtml @23,44 value="#{motorcycleCat.category}":
Target Unreachable, identifier 'motorcycleCat' resolved to null.

The property that becomes null is the property that should be set from the selectOneMenu.
You read it wrong. It is 'motorcycleCat' which is null, not 'category'.
So, this managed bean is nowhere available in the JSF scope?
I am not that familiar with Seam, but shouldn't you declare the bean as managed bean in faces-config.xml?



Hi,

The bean was generated automatically by jboss tools as was geenrated the whole project. So i do not think this is the issue. For your reference i give yuo the whole bean code:



furntermore, this is the content of faces-config.xml "it was also generated by jboss tools".



if you have any more ideas please let me know.

Thanks in advance,
giannis
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Giannis nasdades wrote:
The bean was generated automatically by jboss tools as was geenrated the whole project. So i do not think this is the issue.

Trust me, the exception tells otherwise. I was just translating it. The bean is nowhere in the scope!

So there is either a bug in Seam or you misconfigured it. Try posting the issue at the Seam forums.
I haven't seen high experienced Seam boys walking around here before.
Giannis nasdades
Greenhorn

Joined: Feb 27, 2009
Posts: 10
Bauke Scholtz wrote:
Giannis nasdades wrote:
The bean was generated automatically by jboss tools as was geenrated the whole project. So i do not think this is the issue.

Trust me, the exception tells otherwise. I was just translating it. The bean is nowhere in the scope!

So there is either a bug in Seam or you misconfigured it. Try posting the issue at the Seam forums.
I haven't seen high experienced Seam boys walking around here before.


ok now you are the man.. you gave me the idea of what the error. The error was that inside the page i was not refering to bean with the name that i have put in @Name annotation. Now this part is working fine .. but my problem is that as soon i click the button the queryMotorcycles is not executed.

Thanks a lot for your help.

Regards,
giannis
 
GeeCON Prague 2014
 
subject: problem with <h:selectOneMenu component --- identifier 'motorcycleCat' resolved to null