2

I have a template file that has top,left,right,center,bottom layout parts. In one of my .xhtml pages I'm including my template ui:composition template="template" and defining the left and the center part of my page. Left part is a menu that has 2 items that change the content of the center part of the page. Center part is a panel that has 2 panels inside him so when I click one item of the menu it chooses to display one of the subpanels. Panel has an id="panel1". Menuitem has action="#{bean.setpanel(1 or 2)}" update="panel1" but it doesnt work because they arent in the same "space". I cant figure out how to call panel1 which is in center, from the left side menu - How can I figure out the full path of that element id (main:bla:bla:panel1 or smth like that) and if i do how to figure out how to call that element from a diferent "space".

VoX
  • 83
  • 1
  • 5

1 Answers1

-1

check this out, see if its what you need.. if you need explanation about the code, please ask.

 var path = $(this)
      .parentsUntil('body') //target parent
      .andSelf() //include this element in the following string array
      .map(function() { //build an array out of the results in the provided format
        return this.nodeName + ':eq(' + $(this).index() + ')';
      }).get().join('>'); //put it into string and between each result add '>'
Ori Refael
  • 2,888
  • 3
  • 37
  • 68