File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes prependId doesn't work properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "prependId doesn Watch "prependId doesn New topic

prependId doesn't work properly

binay rai

Joined: Jan 22, 2012
Posts: 1
I have the following code.

<h:form prependId="false" id="bank_form">

<p:tab title="Basic Information">
<ui:include src="basic_info.xhtml" />
<ui:include src="branch/index.xhtml" />



In basic_info.xhtml page include following code.

<p:panel xmlns=""

<h:panelGrid columns="3" id="bank_entry">

<hutputLabel for="name" value="Name: *" />
<h:inputText id="name" value="#{}"
required="true" size="15" />
<p:message for="name" />

<hutputLabel for="bankCode" value="Bank Code: *" />
<h:inputText id="bankCode" value="#{bankBean.instance.code}"
required="true" size="15" />
<p:message for="bankCode" />

<hutputLabel for="centralize" value="Centralize : " />
<h:selectBooleanCheckbox id="centralize"
value="#{bankBean.instance.centralize}" required="true"
readonly="#{ != null}">
<f:ajax event="click" render="panel_driver" execute="@this"
listener="#{bankBean.onCentralizationChange}" />
<p:message for="centralize" />


<p:panel style="border: none;" id="cPanel">
<f:facet name="header">
<h:commandButton type="button" id="addBranch"
rendered="#{not empty}"
value="Add Branch Details" onclick="" />
<h:commandButton id="saveReq" value="Save"
action="#{bankBean.saveBranch}" style="display: none" />


here is my problem the panelGrid is is generate like this j_065:bank_entry
I just want only bank_entry id name.
I have already made prependId equal to false in main page form id but it won't work.
please suggest me.
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 171

Welcome to JavaRanch..

Please don't forget to use code tags for program/source code of your post.

Can you test the includes out of <p:tabView> and <p:tab> ? This prependId="false" will not work for composite components since

"The IDs are as they should be. One thing to keep in mind is that *all* composite components are NamingContainers which means all components within the composite component will inherit its ID. Setting prependId on the form has no bearing here (and no, there is no way to disable the ID behavior on composite components as you can with the form)."

I suspect <p:tabView> and <p:tab> belongs to the same.

No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
I agree. Here's the link:
subject: prependId doesn't work properly
It's not a secret anymore!