jsf - How to dynamically wrap Primefaces component in a div? -
i want dynamically enclosed primefaces component in <div>
tag. possible?
example using
<p:inputtext />
will rendered as:
<div> <input id="j_idt18" ...> </div>
i tried creating custom component extending pf's inputtext , in renderer manually enclosed inputtext markup like:
@override protected void encodemarkup(facescontext context, org.primefaces.component.inputtext.inputtext inputtext) throws ioexception { responsewriter writer = context.getresponsewriter(); string clientid = div.getclientid(context); writer.startelement("div", div); super.encodemarkup(context, inputtext); writer.endelement("div"); }
it's working fine when ajax update on inputtext component, div rerendered , recreated again. how prevent div being rerendered in markup?
i can't use composite component custom component.
thanks
wrap input in <h:panelgroup layout="block">
:
<h:panelgroup layout="block"> <p:inputtext /> </h:panelgroup>
Comments
Post a Comment