Hi,

When components are dynamically created, you MUST explicitly assign ids to 
them. I forget where this is documented, but the JSF spec explicitly says so. 
You need to invent some kind of mechanism of your own for generating unique 
ids; jsf doesn't provide any helper methods for this.

The lack of an ID may be the problem; on postback each component is asked to 
check the submitted data and respond appropriately. If the commandlink 
component cannot find a submitted value in the received data matching its id 
then it will think it was not clicked.

The setting of the onclick attribute is also possibly a problem. A commandlink 
must use script in its own onclick to set a hidden property in the form that 
indicates which command has been activated. Have a look at the html generated 
by a normal commandLink, and then make sure that when you override onclick this 
doesn't prevent the normal script from running.

Regards, Simon

---- Rajeshekar S <[EMAIL PROTECTED]> schrieb:
> Hi,
> 
>       I want to create a customTable component in which paginator will be a
> sub tag.
> 
> <custom:customTable value="#{testBean.data}" var="current1">
> <t:panelGrid binding="#{tableBean.paginator}"></t:panelGrid>
> <t:column>
> <h:outputText value="#{current1.name}"/>
> </t:column>
> <t:column>
> <h:outputText value="#{current1.id}"/>
> </t:column>
> 
> </custom:customTable>
> 
> In the encode method of custom renderer ,I am writing logic to render the
> paginator child component.
> 
> In encode:
> List children = getChildren(uiComponent);
> for (int j = 0, size = getChildCount(uiComponent); j < size; j++) {
> UIComponent child = (UIComponent) children.get(j);
> if (child.isRendered()) {
> boolean columnRendering = child instanceof HtmlPanelGrid;
> if(columnRendering){
> RendererUtils.renderChild(facesContext, child);
> }
> }
> 
> }
> 
> In <t:panelGrid binding="#{tableBean.paginator}"></t:panelGrid>
> ,getPaginator returns a *PanelGrid which has dynamically created
> CommandLinks.*CommandLink has action bind to a method in the managed bean.
> 
> HtmlCommandLink htCommLink = (HtmlCommandLink) jsfUtil
> .createComponent(HtmlCommandLink.COMPONENT_TYPE);
> htCommLink.getAttributes().put(IISWebConstants.VALUE_ATTRIBUTE,
> "A");
> htCommLink.setAction(jsfUtil.createMethodBinding("#{tableBean.createData
> }"));
> htCommLink.getAttributes()
> .put(IISWebConstants.ON_CLICK, "submit()");
> 
> htCommLink.getAttributes().put(IISWebConstants.RENDERED,
> Boolean.TRUE);
> htCommLink.getAttributes().put(IISWebConstants.STYLE_CLASS,
> "link");
> //hpg PanelGrid instance hpg.getChildren().add(htCommLink);
> Problem:Paginator  and table are  rendering but if I click on the
> commandLink ,action method is not calling.Can any body tell me how to
> resolve this issue
> Thanks,
> Rajeshekar

Reply via email to