Johnno's Workbench - Page 2 of 23 - Tips, Tutorials, Domino, XPages, Java, Mobile, Appcelerator, etc

15 May 2015
10

XPages Tip: Filter your design elements for quicker navigation

This is a quick tip on how to filter your design elements in Domino Designer to help quickly find what you’re looking for.

I have to laugh at myself sometimes. 80% into one of my recent XPages Projects, I found myself completely frustrated, trying to pinpoint 1 of many custom control designs in Domino Designer. I almost fell off my chair when I realised that the solution was staring me in the face the entire time.

In Domino Designer, irrelevant of if you’re viewing XPages design elements, custom controls, views, forms, etc, there is a filter option on the top right side of the content Pane. This allows you to track a certain design element using a keyword. As long as that keyword exists in the design element name or alias column, you’re good to go.

EXAMPLE OF FULL LIST OF VIEWS

Screen Shot 2015-05-15 at 11.35.24 AM

EXAMPLE WHERE FILTERED BY KEWORD “Reports”

Screen Shot 2015-05-15 at 11.36.12 AM

Pity I only found this out now :(

Hope this helps.

Cheers. John

UPDATE:

Thanks to Tommy Valand and Per Lausten for suggesting Ctrl + Shift + R, which searches for any design element by name in applications that are open in DDE.

Per also referenced a great blog post: “10 Eclipse Navigation Shortcuts every Java programmer should know

14 May 2015
5

Java XSnippet Published: Translate an ArrayList to a Vector

Here is a Java XSnippet I published the other day on how to manually convert an ArrayList Object to a Vector Object.

UPDATE

Thanks to “Martin Rolph” and “Jesse Gallagher” for providing a much simpler method of getting the same result without having to use my XSnippet. I’ve decided to keep my XSnippet published as I do feel it will add value as a reference point.

ORIGINAL POST

Click here to view XSnippet

When binding Scoped Variables to a List Control in XPages, the values returned are defined as an ArrayList. You might want to convert these values into a Vector for whatever reason.

Quick Example of how to use XSnippet:

doc.replaceItemValue("MultiValueField", TranslateArrayListToVector(viewScope.get("Values"));

Martin’s and Jesse’s much better alternative:

doc.replaceItemValue("MultiValueField", new Vector(viewScope.get("Values")));
31 Mar 2015
1

Appcelerator workaround for ACS Publish “Request is not recognised” error

This is a workaround when getting a ‘Request is not recognised” Error when trying to publish a Node.ACS App to the Appcelerator Cloud.

The problem seems to be with the latest version of Node.ACS (In my case version 1.0.23) not compatible with the public Appcelerator Cloud platform. As per this post, it’s recommended to downgrade to version 1.0.21. This worked for me.

To downgrade your version of Node.ACS, do the following:

  1. Open Terminal
  2. Enter the following command: “sudo npm install -g acs@1.0.21
  3. Provide administrator password if requested
  4. Restart Titanium Studio (Just in case)
  5. Once Titanium Studio is restarted, select Node.ACS app and Deploy.

That’s it. Hope this helps.

John

9 Mar 2015
13

XPages Best Practice: Don’t add ids to controls if they are not required

This is a quick best practice tip and what will most likely become an involved discussion around ids for XPages controls.

I had to think carefully before posting this, but decided to do so as I know it would prove beneficial to the online community either way.

One of the recent items I’ve added to my “best practices” list, is to not use ids for XPages controls that do not require it. A great example of this are label controls. 99.9% of the time, I require no programmatic handle on any of my label controls. What most should know by now is that if you assign an id of “label1” to the label control, this id gets converted to something along the lines of “view:_id1:_id2:_id11:label1” when the HTML page gets rendered to the user. I’m hoping by now you start understanding my concern?

Let’s say you had about 20 controls that make up your XPage that don’t require ids….that’s at least about 500 bytes of data the user has to download just for these id names. NOTE: This is before compression has taken place. (This could be 100 bytes after compression is applied)

See below example XPage. All it contains (other than the defaults that Domino provides) is 20 label controls with an id name of “label1“. The size of the HTML page is 633 bytes (post compression).

Screen Shot 2015-03-09 at 12.07.12 PM

See below 2nd example of the same XPage, except there are no ids assigned to these 20 labels. The size of the HTML page is 567 bytes (post compression).

Screen Shot 2015-03-09 at 12.05.16 PM

For most of you (i’m guessing), the difference in size is probably too small to action, but for me, it forms part of a drive to deliver the best online, mobile and browser experience possible to my clients and users.

Ok people, bring on the discussions….I’m ready!! :)

11 Feb 2015
0

IBM Domino Designer Tip: Change measurement for notes-based designs

This is a quick tip for those who want to change the unit of measure in IBM Domino Designer from inches to centimeters.

Inches are a default for IBM Domino Designer when setting up table designs and the like in Notes, but I prefer to use centimeters. To modify the measurement, do the following:

  1. Open Domino Designer
  2. Click on “File\Preferences”
  3. Select “Regional Settings”
  4. Select which Unit of Measurement you want to use
  5. Click on “Ok”
  6. Restart Domino Designer