Thursday, October 31, 2013

JSON Issues in XPages - Unknown literal of class

This post does not speak about any fixes for this error message, however, contains a tip that will help avoid the issue.

I encountered this error when I tried to apply toJson method on a json construct.

I had the following json construct. Let me say this as "x"

{"menuItems": [
"serialNumber": 1,
"Label": "Label_1",
"subMenuItems": [
"serialNumber": 1,
"Label": "Label_1",
"subMenuItems": [


When i attempted some thing like toJson(x), I got the FBSUndefined error. How ever, when I attempted, fromJson(x) I got sort of I got the following error

Error when parsing JSON string
Encountered " "object "" at line 1, column 2. Was expecting one of: "false" ... "null" ... "true" ...blah blah blah

When I just put my json construct on to a field's default value and tried to parse the field's value using the following code


getComponent("result").setValue(y.menuItems.length)//-> result was 2.0 (i guess)
it worked like charm. Voila

I understand that this must be sort of, a beginner level stuff for Json in XPages.
If you would like to be saddened further by coding a lot to obtain perfection, may be you can explore "" and use them in your SSJS :P

Issues working with XPage Tabbed Panel Controls - Aligning Tab Headers with Margin

This was something that I was thinking to do for a long time but never had to do it before. Thanks to my most demanding customer who literally takes a scale and measures micrometer differences on the screen, I am now finding time for working with this finer details on the screen.

The goal is to get the tab headers of a Tabbed Control in XPages to align itself with the margin. I know we always play around with options available in the control's property tab to do it. Atleast I always do it that way :P. I did play around with margins and found some frustrating issues that resulted in some sort of "so-close" answers all the time.

Thanks to chrome and firefox and their developer modes, I was able to do something that pleases me.

Jumping straight to the point, my XPage Tabbed Control looked some what like one in the following screen shot

Hmm looking at this part of screen alone make me realize why my customer was like "WHAT THE HELL!!! WHY IS THE PASSENGER DATA OUT OF LINE!!!". That was scary :P

At last (so at least now) I was able to modify that to look like the following

  Looks pretty nice tight. My customer is really something. Wonder about the eagle eyes my customer has got :)

The trick that helped me do this is very simple. Just add the following to your style sheet

ul.xspTabbedPanelTabs {
left: 0px;

and by the way if you are interested, its 10px by default. Thank you wasting some of your time reading my story and not scolding me :)

Monday, October 28, 2013

Working with Design Definition in Custom Controls - XPages

I see design definitions in Custom controls as the name states are for providing a design description.

I see this more like a beautification part to your design. Cos I think , simple multiline comments also would serve the same purpose. The top side is , I looks good when included on the XPages.

The down side is, I feel little irrated to work with the xml mark up I have to provide in the Design Definitions tab.

Coming to the point, the simplest syntax that I learn is, you got to provide xml markup inside the Design Definitions text area as you would do in a normal XPage. Take a look at the following screen shot on how/where to provide the markup value

If you do this, you custom control when included on an XPage, would look  something like the following on the designer

Looks pretty design to me :), at least better when compared to the native appearence

Working with Property Definition in Custom Controls - Xpages

I found a nice lesson about this in Xpages 101. Hola, my innernet connection was awesome, that I was not able to view the video through the vimeo player. With a bit of research, I was able to figure it out and thus this fine article :P

I dont remember using this or seeing this in 8.5 or 8.5.1. And now I see that this is very useful and can be used in a lot of ways. To me this feature really does make more sense to the existence or employment of custom controls in designs. As a matter of fact, I think I should start sticking with Custom controls and use Xpages only to resuse my custom control. Dont O.o me if you think other wise. May be I am just curious

Jumping right on to the topic, try the following and you may understand how it works.

1. As always, You must start with creating or using an existing custom control. Open it and go to the properties pane.

2. Now add a property to the custom control as illustrated in the following screen shot. In addition you can go to the validation and visible tabs and code your way as per your necessity

3. Now include this custom control in some XPage and click on the custom control. You will find a tab called as "Custom Properties" when you select the included custom control. You can infer what I see in my case. I see the property that I created and I am able to assign a value to it

4. The little diamond symbol beside the custom property value says I can do stuffs like link it with a scoped variable or some thing :). Think you get the idea

5. Now to see how to provide and retrieve the value for/from the custom property, create a computed field in your custom control and look for compositeData. You can find your property name and use it as per your requirement.

There you go. Hope this helps :)

Tuesday, October 1, 2013

Accidentally discovered Mirror Image of L (:P)

Do not expect any serious stuff from this article as expectations might lead to disappointments. Was casually working and happened to punch in a couple of keys by mistake and found a ridiculous character which I have never seen before in the Lotus script editor (Of course I had seen it in other platforms).

I cannot type in that symbol here as I did on the lotusscript editor, so as an alternative I will do the most brilliant thing of showing you a screen shot, rofl.

I guess its easy for you to see what I am speaking about in the image. I must say that I have found some thing different to decorate my multi line comments with :)

Also I tried an msgbox on that. Seems to work. Another discovery - mirror image of L, rofl

Now I can give more meaningful message boxes for my client ;P