File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF target unreachable identifier null issue

 
Kumar Gaurav
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using Spring web flow, JSF 1.2 and tomcat.
I have a xhtml page where there is a textbox:

<h:inputText
id="#{parameter.uniqueId disabled="#{!parameter.enable}"
required="#{parameter.mandatory}"
binding="#{parameter.uIComponent}"
maxlength="#{parameter.paramSize}"
value="#{parameter.value}"
style="border:1px solid black;"
converter="#{parameter.converter}"
validator="#{parameter.validator.validate}" />

When validation gets invoked i am getting error

"Target unreachable identifier"parameter" null".

parameter is an attribute of a managed bean which is session scope. Also parameter.validator is a class implmenting VAildator and it is not declared in faces-config.xml as i have to use it for so many parameters.

Any pointer will be of great help.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17621
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If parameter is a property of a managed bean, what is the managed bean?

The proper usage would be like this: rendered="#{myBean.parameter.showMe}"

Since a View can reference more than one backing bean, you have to provide the name of the bean as part of the EL reference expression.
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

I cannot use the el expressionas you suggested as i am no. of textboxes like


<c:forEach var="parameterSets" items="#{myBean.list}" >

<c:forEach var="parameterSet" items="#{parameterSet.parameterSets}" >

<c:forEach var="parameter" items="#{parameterSet.visibleParameters}" varStatus="status">

<h:inputText id="#{parameter.uniqueId}"
rendered="#{parameterSet.gruppeRendered}"
disabled="#{!parameter.enable}"
maxlength="#{parameter.paramSize}"
style="border:1px solid black;"
converter="#{parameter.converter}"
validator="#{parameter.validator.validate}"
binding="#{parameter.uIComponent}"
value="#{parameter.value}">

</c:fprEach>
</c:forEach>
</c:forEach>


This is how i am rendering text boxes and problem metioned in previous post occur.
Can you advise me now how to go ahead.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17621
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get rid of the JSTL. JSF has better ways of doing that kind of stuff. Besides, mixing JSTL on JSF frequently ends up with people screaming and crying in despair. It really isn't a good mix.
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Can you tell me how can achieve iteration without using JSTL.

Can you please provide me sample code.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 17621
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I'm reading this wrong, you don't want iteration, you want a tablular display. Iteration is just the means in cruder environments to generate a tabular display and JSF is more of a high-level environment than that.

It looks, in fact, like you want a multi-level table display, which means tables embedded inside other tables. The JSF h:dataTable can handle the display, and the corresponding table JSF table DataModel class provides the means of wrapping your backing data do that the table can be rendered properly.
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Sorry but i want iteration only.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic