my dog learned polymorphism*
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


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "prependId doesn Watch "prependId doesn New topic
Author

prependId doesn't work properly

binay rai
Greenhorn

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

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

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

</p:tab>
</p:tabView>

</h:form>

In basic_info.xhtml page include following code.

<p:panel xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core">

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

<hutputLabel for="name" value="Name: *" />
<h:inputText id="name" value="#{bankBean.instance.name}"
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="#{bankBean.instance.id != null}">
<f:ajax event="click" render="panel_driver" execute="@this"
listener="#{bankBean.onCentralizationChange}" />
</h:selectBooleanCheckbox>
<p:message for="centralize" />



</h:panelGrid>

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

</p:panel>

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: 166

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: prependId doesn't work properly