Andrew Pollack's Blog

Technology, Family, Entertainment, Politics, and Random Noise

XPages - Suggestion and a Tip for Newbies on Repeat Controls

By Andrew Pollack on 03/02/2012 at 09:11 AM EST

I've created a two new categories on my blog called "XPages Newbie Tips" and "XPages Feedback". In posts under either of these categories, but especially "Newbie Tips" my goal is to be positive rather than my usual bitching about the product.

The idea for the newbie tips is that as I'm digging into serious development with XPages, I'm coming across things that would really have helped me if I knew them at the start. I plan to make these newbie tips into blog entries, and then as I get a good solid list of them together turn them into a sort of "Frequent Questions You Didn't Know You Should Ask" list.

The "XPages Feedback" category is for blog entries that I hope will spur discussion and consideration that gets to the designers of XPages at IBM. I know some of them keep an eye on what I write from time to time, so I'm sure the occasional positive comment may come as a welcome surprise.

This morning's tip is about the option "Create controls at page creation".

I believe this option is poorly labeled. It should say "Create controls ONLY at page creation". The current wording is "positive" and makes the option seem like an extra help, when in fact it's a LIMITING option. My thought was that by creating them at page creation it would make debugging easier since there would be less stuff changing dynamically on the page. Wow, was I wrong on that one!

Below the repeat was a panel that let me add a new document, which was to show up in the repeat list. The idea was when you clicked the submit button on the new document, the new document's fields would clear and the new document would be added to the repeat control list. I'd properly set the the partial refresh on the submit button to include the whole panel containing both the new document and the repeat control. It didn't work. For many, many hours I tried to find a way to update the repeat control. I went down several wrong paths, spending hours on each one. I asked a question on Stack Overflow as clearly as I could, and both Tim and Nathan made an effort to help me out. I spent more hours (and learned a few things from Tim's article) but nothing helped. Declan joined in, and I learned something new there as well -- but still no dice. Only through trial and error did I finally figure out what had caused my problem.

I had added some computed fields showing random numbers to a few parts of the XPage so I could tell when different parts would refresh. Finally, I discovered that the repeated elements were actually refreshing but I wasn't seeing a new entry added to the list. The reason, ultimately, turned out to be that to add another entry to the repeat list I needed a new "control" -- but I'd checked that box that said "Create Controls at Page Creation". It was preventing my XPage from creating another entry for the new document to display!

Aside from the things I learned from the debugging and the tips from Tim and Declan, an important XPages lesson was driven home about what an "XPage" really is, it's persistence, and what are considered "controls".


There are  - loading -  comments....

re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy Declan Lynch on 03/02/2012 at 10:35 AM EST
A good idea is to always post some sanitized code on StackOverflow questions.
I'd guess that if we'd seen the repeat control with that setting enabled you'd
have been told to disable it on one of the answers.
re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy Andrew Pollack on 03/02/2012 at 10:50 AM EST
I agree. If you'd seen the option I'm sure some of you would have noticed it
right away.

Two things prevented me doing that. First, I hadn't yet fully bought into the
idea that the source xml as presented is actually the complete source in a way
that made sense to post. Second -- I hate when people send me source code
along with their questions. Generally, I won't read it. It usually takes more
time than I'm willing to spend on the question to figure out what they're
doing. Since I don't like it when people do it to me, I was trying to avoid
being "that guy". :-)
re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy Nathan T. Freeman on 03/02/2012 at 11:55 AM EST
"First, I hadn't yet fully bought into the idea that the source xml as
presented is actually the complete source in a way that made sense to post."

But you have, now, right? :-)

"Second -- I hate when people send me source code along with their questions.
Generally, I won't read it. It usually takes more time than I'm willing to
spend on the question to figure out what they're doing."

A matter of taste, I suppose, but I prefer seeing the source code as early as
possible. For me, it's always easier to diagnose the code than it is the
person's description of the code.
re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy Mike Woolsey on 03/06/2012 at 09:28 AM EST
Actually, I had bought into it, and then I was deprived of that notion when I
was trying to build the extension library's "application control".

Suddenly that control instructed me to add a pile of XML at a random point in
Designer.

I flipped to the XPage to see where it landed.

It didn't.

I dunno where it went.
re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy Declan Lynch on 03/02/2012 at 12:26 PM EST
I took the liberty of adding an update to your question explaining the issue
you had so anybody else searching on SO will find it. I basically lifted the
second last paragraph of your blog post rather then reword it.
re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy Erik Brooks on 03/02/2012 at 06:49 PM EST
You're also noticing one of the big ROIs of XPages:

1. You can talk with another developer who is also looking at code remotely and
say "line 237" and everybody has a clue as to what you mean.

2. It's downright trivial to copy/paste source for help like StackOverflow,
etc.
re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy Mike Woolsey on 03/06/2012 at 09:31 AM EST
Practical information on your last sentence -- what an XPage is, where its
persistence is "good" and "bad" for your application -- that'd be really useful
for me to hear.

I've a beginner's grasp of the control (a servlet blindly processing and
spitting out stuff), and I have some idea of the XPage persistence, but it's
not always working with the conclusions I reach.
re: XPages - Suggestion and a Tip for Newbies on Repeat ControlsBy XPages Hater on 05/31/2012 at 07:17 AM EDT
XPages is the biggest pile of steaming shite the world has ever seen. It's
flakey and completely pants at doing anything but the simplest of tasks. It
just doesn't work and it's riddled with bugs. You wouldn't sell a car if the
doors didn't shut or the engine occasionally started, but this is what IBM has
done to us! A complete waste of time and effort. Stay away from this
embarrassment to the IT community.


Other Recent Stories...

  1. 05/05/2016Is the growing social-sourced economy the modern back door into socialism?Is the growing social-sourced economy the modern back door into socialism? I read a really insightful post a couple of days ago that suggested the use of social network funding sites like “Go Fund Me” and “Kickstarter” have come about and gained popularity in part because the existing economy in no longer serving its purpose for anyone who isn’t already wealthy. Have the traditional ways to get new ventures funded become closed to all but a few who aren’t already connected to them and so onerous as to make ...... 
  2. 04/20/2016Want to be whitelisted? Here are some sensible rules for web site advertisingAn increasing number of websites are now detecting when users have ad-blocking enabled, and refuse to show content unless you "whitelist" their site (disable your ad-blocking for them). I think that is a fair decision on their part, it's how they pay for the site. However, if you want me (and many others) to white list your site, there are some rules you should follow. If you violate these rules, I won't whitelist your site, I'll just find content elsewhere. 1. The total space taken up by advertisements ...... 
  3. 12/30/2015Fantastic new series on Syfy called “The Expanse” – for people who love traditional science fiction[] “The Expanse” is a new science fiction series being broadcast onthe Syfy channelthis winter. It’s closely based on a series of books by author James S. A. Corey beginning with “Leviathan Wakes”. There are 5 books in the “Expanse” series so far. If you’re a fan of the novels you’ll appreciate how closely the books are followed.TIP: The first five episodes are already available on Syfy.com. If you’re having trouble getting into the characters and plot, use those to get up to speed.The worlds created for ...... 
  4. 10/20/2015My suggestion is to stay away from PayAnywhere(dot)com  
  5. 08/07/2015Here is one for you VMWARE gurus - particularly if you run ESXi without fancy drive arrays 
  6. 08/06/2015The Killer of Orphans (Orphan Documents) 
  7. 06/02/2015Homeopathic Marketing: Traveler on my Android is now calling itself VERSE. Allow me to translate that for the IBM Notes community... 
  8. 03/17/2015A review of British Airways Premium Economy Service – How to destroy customer goodwill all at once 
  9. 02/26/2015There's a bug in how @TextToTime() and @ToTime() process date strings related to international standards and browser settings. 
  10. 01/21/2015Delivering two new presentations at Developer Camp (EntwicklerCamp) 2015 in Germany 
Click here for more articles.....


pen icon Comment Entry
Subject
Your Name
Homepage
*Your Email
* Your email address is required, but not displayed.
 
Your thoughts....
 
Remember Me  

Please wait while your document is saved.