XPages: SSJS @Formula returning "IBMJS built-in function"

Hello,

I’m very novice with XPages, just trying to create my first useful XPage.

I’m trying to use @Formulas in SSJS but it looks like I don’t know how to do it. I’ve tried e.g. a label whose value is computed with SSJS:

@UserName

I’ve also tried XPage afterRenderResponse e.g. with code:

facesContext.getResponseWriter().write(@Text(@Now));

I always get “IBMJS built-in function” as a result except if I use e.g.

@Text(“hiihaa”)

then it returns the text “hiihaa”. This is probably a very stupid question but what am I doing wrong and how should I use @Formulas in SSJS?

These are just simple tests and in the end I would like to build and show some HTML based on @DbLookup when the page loads. Now I realized that I should be able to do that with SSJS only (with no @Formulas) but anyway it would be nice to know how to use @Formulas.

thanks,

  • Panu

PS. Is there a good dedicated XPages discussion forum somewhere? I think we would need one. I found this but it does not seem to be active:

http://www-10.lotus.com/ldd/xpagesforumtrial.nsf

Subject: SOLVED: Need to put () after the @Formula!

For example @Now() works. I wish the editor OR runtime engine would mention where the problem is!

A few bugs found in XPages:

  1. I’ve always named my JS libraries ending with “.js”. Those do not work in XPages: it adds another .js to the end and the lib does not get loaded.

  2. In some apps that I work with, the style sheets have been named as css/styles.css. Those do not get loaded by XPages, it tries with name css_2f_styles.css or something like that.

I’m using 8.5.1FP2 Designer and server.