Here’s a news flash:
Some things in XPages don’t work the way you want them to or the way you thought they were going to work or the way IBM said they were going to work.
That’s not meant to be a knock of any kind. XPages are an awesome execution of extending JSF and coupling it into a very robust environment but the fact is there are a lot of moving parts and it is complex. The folks at IBM spend their time trying to reduce the complexity of the tool itself and that is hard work so if the odd bug or challenge creeps in in your specific use case…well, so be it.
When you do encounter strangeness, make sure you isolate the issue and test it by itself.
Sounds obvious but when you’re knee deep in battle with the code you might feel it is a waste of time to extract code to try and fix a problem.
If your XPage will not work without a bunch of nested custom controls, it will not work with a bunch of nested custom controls.
One development path could be to develop the entire XPage and see if all of the data saves when everything is displayed and it is all in the same page. If it does, great! Now break it up into smaller pieces where pieces are panels or custom controls. etc.
If your XPage does not work and you have it built with custom controls or other dynamic elements, save yourself some time and frustration by removing everything except for the problem and work the problem until it is fixed.
You can do this by making a copy of the original XPage and then tearing down the “live” XPage and then rebuilding it piece by piece until you find the problem or by creating the simplest of XPages and testing the problem there.
Also, if you're like me, sooner or later you'll get your XPage working but can't remember what wasn't working or maybe even break it even more. Compare With -> Local History is your friend. Just make a note of the save time when you started working on it and compare back. I've heard people say Local History doesn't work if you use source control. I don't know as yet. But equally source control will allow you to compare back to a fixed point as well, if used correctly.
I often copy the whole source code, paste it on a new Xpage, and Clean the project… I think I've used this too many times though.
Paul,
That is a great point. No matter how many times people point out this great functionality (you do it, Paul Calhoun and I do it in the XPages Bootcamps) a lot of people simply do not know about it.
It is a life saver for sure!
And source control is even better.
Cleaning can certainly help when all of the sudden your design changes are not being accepted and other problems.
Just like Local History though,a lot of people simply forget that Project Clean is there.
Thanks for the tip!
I have gotten in the habit of doing a Clean about every 3rd or 4th time I make a change and save it.
Never remember to look at Local History and I know you told me about it at least a dozen times