AuthorDocumentController.findNodesByXPath returning null after first use
Posted: Thu Aug 15, 2024 11:57 pm
Hello!
I'm using a custom renderer called by webappRendererClassName property in CSS.
In two particular element renderers, I need to get attributes values from another element, which I find by using AuthorDocumentController.findNodesByXPath.
When it passes through the first element render, everything goes fine, the element is located and the rest of the function runs normally.
The second render occurs just after the first one, it's a sibling element and it's utilizes the same custom renderer as the first one. The problem is that when it gets to findNodesByXPath function, searching for the same node from before, it returns null.
For instance, there is a function inside this renderer that inserts text in the current element, in addition to rendering some content.
I get the AuthorDocumentController from AuthorInplaceContext.getAuthorAccess().getDocumentController() received by renderControl function in the custom WebappFormControlRenderer.
The context for findNodesByXPath is not specified, what I believe makes it use the root element as context.
What could be happening?
Thanks!
Vitor
I'm using a custom renderer called by webappRendererClassName property in CSS.
In two particular element renderers, I need to get attributes values from another element, which I find by using AuthorDocumentController.findNodesByXPath.
When it passes through the first element render, everything goes fine, the element is located and the rest of the function runs normally.
The second render occurs just after the first one, it's a sibling element and it's utilizes the same custom renderer as the first one. The problem is that when it gets to findNodesByXPath function, searching for the same node from before, it returns null.
For instance, there is a function inside this renderer that inserts text in the current element, in addition to rendering some content.
I get the AuthorDocumentController from AuthorInplaceContext.getAuthorAccess().getDocumentController() received by renderControl function in the custom WebappFormControlRenderer.
The context for findNodesByXPath is not specified, what I believe makes it use the root element as context.
What could be happening?
Thanks!
Vitor