Subject: Might be a problem in the execution order
Hi,
This might be a problem in the order in which the events are executed: if you click the link the URL is opened by the browser and there is no server interaction.
What I’d suggest: remove the URL from the link control and add a serverside redirect to the (SSJS) code that’s being executed. Use one of the context redirecTo methods (e.g. context.redirectToPage(“anXPage”) ) or use this:
thanks for the reply. The reason I’m using the repeat control is that the set of urls in my list are built dynamically. They are children pages. So a link to say the ‘customers’ page will generate one set of navigation links, but the ‘Industries’ link will generate a different set. And it actually is pretty cool the way it works. What I need to do next is tie the grandchild link to a grandchild page.
But I think you’re right, I should use SSJS. I can do this if I could push the grandchild’s url href property to into a session scope variable but I can’t figure out how to get a handle to the link control.
So the idea is that when I select a grandchild link, the url selected is pushed into a session scope variable, then I load the xpage. On load, it parses the link and will know what unid in the backend to point to. I thought I could do this in the onClick event of the url but that won’t work. So if I could just get the href property to the session variable, I could make it work.
It was easier than I thought. Since the link control has the specific document in context, I just pull out the index to that document and passed it to the xpage. It decides to display the content of the document that’s in context. It all just works.