Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

prependId doesn't work properly

 
binay rai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic