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. 01/26/2023Better Running VirtualBox or VMWARE Virtual Machines on Windows 10+ Forgive me, Reader, for I have sinned. I has been nearly 3 years since my last blog entry. The truth is, I haven't had much to say that was worthy of more than a basic social media post -- until today. For my current work, I was assigned a new laptop. It's a real powerhouse machine with 14 processor cores and 64 gigs of ram. It should be perfect for running my development environment in a virtual machine, but it wasn't. VirtualBox was barely starting, and no matter how many features I turned off, it could ...... 
  2. 04/04/2020How many Ventilators for the price of those tanks the Pentagon didn't even want?This goes WAY beyond Trump or Obama. This is decades of poor planning and poor use of funds. Certainly it should have been addressed in the Trump, Obama, Bush, Clinton, Bush, and Reagan administrations -- all of which were well aware of the implications of a pandemic. I want a military prepared to help us, not just hurt other people. As an American I expect that with the ridiculous funding of our military might, we are prepared for damn near everything. Not just killing people and breaking things, but ...... 
  3. 01/28/2020Copyright Troll WarningThere's a copyright troll firm that has automated reverse-image searches and goes around looking for any posted images that they can make a quick copyright claim on. This is not quite a scam because it's technically legal, but it's run very much like a scam. This company works with a few "clients" that have vast repositories of copyrighted images. The trolls do a reverse web search on those images looking for hits. When they find one on a site that looks like someone they can scare, they work it like ...... 
  4. 03/26/2019Undestanding how OAUTH scopes will bring the concept of APPS to your Domino server 
  5. 02/05/2019Toro Yard Equipment - Not really a premium brand as far as I am concerned 
  6. 10/08/2018Will you be at the NYC Launch Event for HCL Domino v10 -- Find me! 
  7. 09/04/2018With two big projects on hold, I suddenly find myself very available for new short and long term projects.  
  8. 07/13/2018Who is HCL and why is it a good thing that they are now the ones behind Notes and Domino? 
  9. 03/21/2018Domino Apps on IOS is a Game Changer. Quit holding back. 
  10. 02/15/2018Andrew’s Proposed Gun Laws 
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.