File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF target unreachable identifier null issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF target unreachable identifier null issue" Watch "JSF target unreachable identifier null issue" New topic
Author

JSF target unreachable identifier null issue

Kumar Gaurav
Ranch Hand

Joined: Apr 08, 2008
Posts: 108
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.


Regards,
Gaurav
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16051
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kumar Gaurav
Ranch Hand

Joined: Apr 08, 2008
Posts: 108
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

Joined: Jun 25, 2001
Posts: 16051
    
  21

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

Joined: Apr 08, 2008
Posts: 108
Hi Tim,

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

Can you please provide me sample code.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16051
    
  21

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

Joined: Apr 08, 2008
Posts: 108
Hi Tim,

Sorry but i want iteration only.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF target unreachable identifier null issue