Categories
Learning XPages XPages

NotesIn9 188: Adding a “Please Wait” to XPages

In this show I demonstrate a couple of techniques for improving your UI when you have a longer running code process. I show how to add a “Standby” custom control to your application for Partial Refreshes and another technique for when you’re opening a page that needs a few extra moments to process your data.

Big thanks to Fredrik Norling and Vikas Tiwari for their original contributions on this subject.

Categories
XPages

Alert! Danger! Chrome has a Dojo Bug that affects XPages

Declan Lynch found this bad news today.

ATTENTION

There is a known bug in Google Chrome 48 that is affecting DOJO resource loading which in turn is causing XPages application to stop working.

https://code.google.com/p/chromium/issues/detail?id=570622

End users may see the page freeze and interaction with things like pagers stop working. From a development point of view having the DevTools running and the Disable Cache option enabled means you may not see this issue during development.

 

 

PLEASE go to that issue and sign in with a Google account and star it.  Hopefully the more stars the higher priority it’ll get.  Comments might also be helpful.

 

Categories
Learning XPages XPages

Viewer Question about scoped variables in XPages

So I got this in my inbox :

Dave,

Do you happen to know of a good article or video that talks about scope variables (i.e. applicationScope and sessionScope ) and passing values between different web pages?  Passing information like unid, user name and contact information (i.e. phone and address).

So loading the variables and writing the information to fields on different pages.

Thanks,

I don’t have an article to point to so I figure I’ll just give it my best shot and make one up.

First let’s remember that applicationScope is for the whole app.  Anything you put in there is available to all users. So you would not want to put in anything you listed in your email. The unid, user name, etc…  are all user specific.

Now, sessionScope is an interesting case, and just so we’re clear, sessionScope is often thought to be the USERS session BUT IT’S NOT. It’s really the BROWSERS session. For example, if you are using sessionScope for things and the user logs out and then a different user logs in from the same browser – assuming it’s not been closed…  it’s possible the second user might get some left over values from the first user. So you have to be careful and sometimes you need to manually clear sessionScope.

Often people new to XPages might use sessionScope to hold things like a unid, or maybe other things about the users navigation status like last page or whatever. These are NOT good things to put into sessionScope because if the user opens your web app in another tab and starts doing 2 things at once then putting data like unids and stuff in sessionScope will be a problem.  The users second tab will interfere with the first tab.

What sessionScope IS good for is things like a shopping cart or the user and contact information.  Something that’s for the user and needs to span multiple pages.  Things like UNID’s or keys, I always try to put in the URL itself.  This solves the problem of 2 browser tabs bumping into each other and also makes the pages easier to bookmark for later use if need be.

Personally I used to use sessionScope for EVERYTHING when I started out.  Now I use it much less.  I do much more with viewScope.  Conceptually what I do is in the beforePageLoad event, I’ll grab any parameters I need from the URL and anything I need from session or applicationScopes and then use that to continue loading my page.  In the example of a “company document”.  If I have a main page I’ll pass the unid or key (I use keys more then unids) in via the URL and grab that and load the data that I want.  Now if there’s a link to another page related to the same company I’ll just keep that unid/key in the url and simply reload the company from disc on the next page.  So it’s kind of a bummer to reload the company data for each page, but doing so makes things a lot easier.  If you have a big app there are caching solutions to aid this and we use some in the day job, but I’ve never really found it to be a problem.

So with the information you’ve given me, I’d suggest you keep your unid/key in the url.  UserName should be global really so I’m not sure if you really need to store that anywhere, but yes I’d store the contact information in scope.  If you know Java that could be a small managed bean or other object that lives in a pageController.  If you’re using SSJS you could make several variables – ssAddress1, ssCity, ssState, etc…  and put those in sessionScope.

But I’d probably sooner make a little map and put the map into sessionScope rather then having a ton of variables I need to track… I’ve done this on NotesIn9 several times I think…  something like

var myMap = new java.util.HashMap();
myMap.put(“address1”, ..myValue..);
myMap.put(“city”, ..myCityValue..);
sessionScope.put(“userAddress”, myMap);

then to use the map it should look something like this :

document.replaceItemValue(“address1”, sessionScope.userAddress.address1);

(Note I’m not typing in an editor and testing…  but that should work or be REALLY close.)

Creating and putting your own map into scope will at least let you group the data together.

 

Hopefully that helps a little bit.  If not just let me know.

Good Luck!

Dave

 

Categories
Community Notes In 9 Uncategorized XPages

XPages.TV is dead. XPages.TV is born again.

For years I’ve known that my XPages.TV site sucked. For years you knew that also. Well finally I’m starting to do something about it.

XPages.TV was meant to be an on line catalog of all the NotesIn9 shows. Since the shows have a longer shelf life then a typical blog/podcast I wanted some way to get to them easier. And I didn’t know a way to do something clever in wordpress itself. So I wrote a little template to try and do some clever things and it was a total failure. So tonight I’ve killed that.

XPages.TV is currently showing the raw data of the NotesIn9 shows. Big thanks to Tim Briley for helping me gather the data. It’s barebones and ugly, but already should be doing a better job then my last attempt.

So if you’re looking for a particular NotesIn9 show, check out XPages.TV for the complete list and you can open links to get to the Youtube video or even the blog post.

Categories
Community XPages

Announcing the XPages Development chat on Slack

If you’ve never heard of Slack, it’s basically a “messaging app for Teams”.  You can access it via the web, desktop application or mobile app. Slack is a persistent chat experience with really good software behind it.  It allows for different “channels” inside the room so we currently have “general”, “beginner”, “advanced” and “random” discussion area.

I little while ago Jesse Gallagher and I setup an XPages Development chat on Slack.  We’ve been playing with it and would now like to make this available to the public.

The goal of the chat is to be a place where people can come together and talk XPages. There’s no good public place to really do this that I know of.  The XPages Forum is a disappointment.  Stack OverFlow wants specific questions and abhors actual “discussions”, and you can’t really start a discussion on someones blog.

So where do you go to just discuss an idea, ask a generic question or even just say hi to like minded individuals? We give you:

XPages.slack.com

Because this is an open invite we do have some rules that are needed to maintain decorum.  Those rules are at the bottom of the post.

How do you join?  Unfortunately email addresses have to be “approved” currently.  There are ways around this but we’ve not really looked into it yet.  So for now just send me an email and I will add you to the group as I FIND THE TIME.  So don’t expect instant access.  🙂

UPDATE: Thanks to Declan Lynch you can now auto join. Please use this link :

http://xpages-slack-invites.herokuapp.com/

Thanks!

Dave

=====

XPages Slack Chat Rules

1. No Bitching at all. We are about Doing.

2. Stay close to the XPages topic.  Off topic is allowed in #random. Bitching is never allowed.

3. All content discussed in the chat should be considered public. Do not share code or ideas that you consider private. Do not discuss NDA material.

This is a community chat of XPages enthusiasts and NOT a support group. While questions may be asked do not expect a solution.  If you get one great.  If not then realize that everyone is busy with their day jobs.

The recommended way to ask a question is to post it on StackOverFlow and then post a link to the question in the chat.

Categories
Community XPages

Ask the XPages Experts Webinar Next Week!

Next week, on Tuesday November 17th from 10:30 AM EST to 12:00 PM EST TLCC and Teamstudio will be hosting an XPages webinar called “Ask the Experts”. For FREE!!!!

I’ll be joining the panel with  3 true experts in the form of Mike McGarel, Jesse Gallagher and Nathan T. Freeman.

We’ll each be bringing a SHORT 5-10 minute XPages topic.  The rest of the time will be dedicated to any question you might have.

So please, if you’re working with XPages.  Come join us next week.  Watch the short demos.  Say Hi. Ask any question you want.  We’re all happy to try and help out.

http://www.tlcc.com/xpages-webinar

Categories
Bluemix Podcast XPages

NotesIn9 186: XPages and IBM Bluemix Part 3

In this show IBM Champion Oliver Busse concludes his 3 part series on getting started with XPages inside IBM Bluemix.

Categories
Bluemix Podcast XPages

NotesIn9 185: XPages and IBM Bluemix Part 2

In this show IBM Champion Oliver Busse returns to talk more about using XPages inside IBM Bluemix.

 

Categories
Mobile XPages

Turn off Phone number Detection in iOS

Today I had a problem where iOS on an iPad was thinking some numbers where phone numbers when they really weren’t.  Normally that’s not the end of the world but in this case it converted the number to a blue link, and I was expecting it to be white on a dark background.  The blue made it difficult to read.

I quickly found these 2 links :

https://developer.apple.com/library/safari/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html#//apple_ref/doc/uid/TP40007899-CH6-SW1

https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html#//apple_ref/doc/uid/TP40008193-SW5

Which detail the solution of adding a meta tag to the XPage.  But where do you add the meta tag in XPages?

There’s a couple ways to do it I think.  I don’t really do much with themes but I chose to go that route so it’s once and done for the application.  I found this blog post :

XPages – Theme – Add Meta Tag

which gave me all the information I needed to do this :

 

<resources>
 <metaData>
 <name>format-detection</name>
 <content>telephone=no</content>
 </metaData>
</resources>

Problem solved!  Thanks Ferhat for the blog post.  I tried to leave a comment while signed in as twitter and it didn’t work, so I figured I’d thank him here.

 

Categories
Bluemix Notes In 9 Podcast XPages

NotesIn9 184: XPages and Bluemix Part1

In this show, IBM Champion and all around awesome person, Oliver Busse returns to kick off a three part series on using XPages with IBM Bluemix.