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. 03/26/2019Undestanding how OAUTH scopes will bring the concept of APPS to your Domino serverWhile a full description of OATH is way beyond what I can do in this quick blog entry, I wanted to talk a bit about how "SCOPES" interact with the already rich authorization model used by Domino. Thanks to the fantastic work by John Curtis and his team, the node.js integration with Domino is going to be getting a rich security model. What we know is that a user's authorizations will be respected through the node.js application to the Domino server -- including reader names, ACLs, Roles, and so on. The way ...... 
  2. 02/05/2019Toro Yard Equipment - Not really a premium brand as far as I am concernedDear Toro Customer Service, I arm writing about the following machine: Toro Power Max 1120 OXEModel:38654S/N:31000#### Specifically, bearing part #:63-3450 This is the part ($15 online / $25 at the local dealer) that caused me to raise my objections on-line. This piece of garbage is supposed to be a bearing. It carries the shaft which drives both stages of the auger. The shaft passes through the bearing (which is what bearings do) after the auger drive pulley as the shaft goes through the back (engine ...... 
  3. 10/08/2018Will you be at the NYC Launch Event for HCL Domino v10 -- Find me!Come find me in NYC on Wednesday at the Launch Event if you're there. I really do want to talk to ...... 
  4. 09/04/2018With two big projects on hold, I suddenly find myself very available for new short and long term projects.  
  5. 07/13/2018Who is HCL and why is it a good thing that they are now the ones behind Notes and Domino? 
  6. 03/21/2018Domino Apps on IOS is a Game Changer. Quit holding back. 
  7. 02/15/2018Andrew’s Proposed Gun Laws 
  8. 05/05/2016Is the growing social-sourced economy the modern back door into socialism? 
  9. 04/20/2016Want to be whitelisted? Here are some sensible rules for web site advertising 
  10. 12/30/2015Fantastic new series on Syfy called “The Expanse” – for people who love traditional science fiction 
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.