How to access the parent Composite name container?

I have JSP 2.0 <ui:component>inside of which there is <p:dataTable>a column that uses Composite to display a special border about some content. Now I need to identify <p:dataTabe>in the ajax attribute rendered, which is in the content.

<ui:component>
  <p:dataTable id="dataTable" var="userItem" ... />
    <p:column>

        <my:borderBox id="borderBox">
           <p:commandButton
               action="#{userController.doDelete(userItem.id)}"
               value="delete" 
               update="?????"/>  <!-- How to address the dateTable? -->
        </my:borderBox>

      </p:column>
    </p:dataTable>
 <ui:component>

My BorderBox:

<html xmlns:composite="http://java.sun.com/jsf/composite" ...>
   <composite:interface>
      <composite:attribute name="styleClass" default="" type="java.lang.String"/>
   </composite:interface>

   <composite:implementation>
      <h:panelGroup ...>
         ...
         <composite:insertChildren/>
      </h:panelGroup>
   </composite:implementation>

My idea was to use something like

update=":#{component.namingContainer.parent.namingContainer.clientId}:dateTable

But the component.namingContainer.parentseams should be empty.

When I replace <p:commandButton>with these statements:

Parent ClientId 1: #{component}
Parent ClientId 2: #{component.namingContainer}
Parent ClientId 3: #{component.namingContainer.clientId}

Parent ClientId 4: #{component.namingContainer.parent}
Parent ClientId 5: #{component.namingContainer.parent.namingContainer}

I get this output:

Parent ClientId 1: javax.faces.component.html.HtmlPanelGroup@3d957419

Parent ClientId 2: javax.faces.component.UINamingContainer@23db9e8f
Parent ClientId 3: main_form:profilTabView:dataTable:0:borderBox

Parent ClientId 4:
Parent ClientId 5: 

I have no idea what the problem is: mybey is my idea of ​​identifying the list is complete incorrectly or is there some kind of error or is there a better way? (But I can't use the absolute fix identifier for dateTable!)

Versions: Primeface 3.2, Mojarra 2.1.6 on Glassfish 3.1.2

+5
1

. , . jsf javascript. (, "myTable" ).

<p:dataTable id="dataTable" var="userItem" ...  widgetVar="myTable"/>

javascript "myTable". . (h: commandButton not p: commandButton) onklick:

<h:commandButton id="deleteItem" action="#{userController.doDelete(userItem.id)}"
 value="delete" onclick="PrimeFaces.ab({formId:$(this).closest('form').attr('id'),source:this.id,process:'@all',update:myTable.id});return false;" /> 


formId - Jquery
update - myTable.id - ( div)
process - @all, @this, @form ..

+1

All Articles