Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I get f:selectItem to do not be rendered (as his parent) ?

731012Mar 19 2010 — edited Mar 22 2010
I've something like this :

<af:showDetailItem text="TEXT1" id="sdi123" rendered="#{is123Rendered}">
<f:subview id="sub123" rendered="#{is123Rendered}">
<jsp:include page="/tech/fragments/PROBLEM.jsff"/>
</f:subview>
</af:showDetailItem>

The idea is that if "is123Rendered" is true then this showDetailItem will be rendered, else it will be rendered elsewhere

So at the elsewhere place, I use the "same" af:showDetailItem/subview/include with another id and with rendered="#{not is123Rendered}"

It would be normal I get duplicates if rendered was true everywhere since the jsff is included 2 times

I've tried to replace rendered="#{not is123Rendered}" to rendered=false to be sure the problem does not come from the getter/variable

But it seems like f:selectItem does not care about the rendered attribute of his grand-grand-...-parent ... so I get this error :

java.lang.IllegalStateException: Duplicate component id: 'sH1:sub123:ttSGen:si1234', first used in tag: 'com.sun.faces.taglib.jsf_core.SelectItemTag'
[...]


In PROBLEM.jsff I've :

<af:selectOneChoice id="soc1234" value="#{something.output}" disabled="true" label="Select something">
<f:selectItem itemLabel="#{something.output}" itemValue="#{something.output}" id="si1234"/>
</af:selectOneChoice>

I've tried to comment/remove every selectOneChoice and then the page loads without any error.
It seems that f:selectItem are generating duplicates.
I've tried to put af:selectOneChoice rendered attribute to false, same problem.
f:selectItem does not have a rendered attribute ...

I'm thinking about using conditional JSP include instead of rendered attribute : http://forums.sun.com/thread.jspa?threadID=676322
But I'm not sure it's possible/elegant to to this using ADF.

Any idea ?

Thanks,
JP
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2010
Added on Mar 19 2010
1 comment
1,586 views