0

After a timeout I logout the user and redirect to Login as described here:

NotesSpeak

A part of this code is executed in onCliendLoad().

    var thisUrl = window.location.pathname;
    var finalPath = thisUrl + "?Logout&redirectto=" + thisUrl + "?opendatabase&login";
    setAutoRefresh(15000, finalPath);

Now I want to use it on several XPages and add a custom control. With a custom property (needsLogout) I want to decide if the timeout should executed or not.

I created a custom control and a custom property called needsLogout. On SSJS I get this property using compositeData.needsLogout.

But I need this property in the onClientLoad. But this is CSJS and compositeData is not defined.

Is it possible to get the property in CSJS?

Sebastian

4
  • What computational problem are you trying to solve? Can you provide your sample code, including where you want to utilize the property. Your compute problem might have a very different solution than your property approach Commented Mar 22, 2024 at 1:54
  • Thanks for your comment. I added more information and some code in my question. Maybe it could help to understand what I want to do. Commented Mar 22, 2024 at 6:48
  • let your custom control compute client side js and use ${} JSF syntax to insert your property value Commented Mar 22, 2024 at 6:56
  • Thanks a lot. Works like charm. I think I need some basics. ;-) Commented Mar 22, 2024 at 7:47

1 Answer 1

0

My code in onClientLoad() looks like this.

if (!${compositeData.needsLogout}) {return false} 
else {
var thisUrl = window.location.pathname;
var finalPath = thisUrl + "?Logout&redirectto=" + thisUrl + "?opendatabase&login";
setAutoRefresh(15000, finalPath);
}
Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.