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".
Asked
Active
Viewed 1,314 times
1 Answers
-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
-
@BalusC also added code comments about it. for you. – Ori Refael Jun 28 '14 at 20:05
-
@BalusC I did understand, but if i made a mistake he can just tell. still, dont think being a douch about it works. – Ori Refael Jun 28 '14 at 20:07