It has been very frustrating running into issues like showing/hiding a div based on a button click in an xPage.
I have this code in the onclick of my button (have tried both lines) and get
– Object doesn’t support this property or method. –
dijit.byId(‘p1’).hide();
//dijit.byId(‘#id:pic_main1’).hide();
the generated html code for that section of the page is:
My ultimate goal, of course is to be able to toggle the 3 pic_main divs without using wrapper divs at all (using the commented version of the code as is illustrated in the designer help).
Can someone point me to what I’m doing wrong here? Also, a decent guide to xpages that covers everything would be nice, but I understand that no such books are available yet.
Is there any word on an official developers guide for xPages? I have a lot of questions about this topic.
Subject: Comprehensive XPages training manual for newbies and phobes
Howdy - we just posted our new XPages developer training manual.
This course is designed for Notes programmers well versed in using Domino Designer but who are new to XPages. The 462-page manual leads you step-by-step through the essential steps to adapt an application originally developed for Notes and then modified as a classic Domino web application, to become a fully functional XPage application.
Read the course description and download the first six topics for free at http://www.waresource.com/kurchak/ka1.nsf/8f1ec7851d34b09a852566de0078eb7a/46b20c4bdcae25c5852576fc005e13e9?OpenDocument.
Subject: Answering Show/Hide A div
Joel,
When I want to show/hide a panel here’s what I do…
go to all properties of the panel and find the rendered section. You can set that to true or false. So what I’ll do in the button for instance is set a scoped Variable. Maybe sessionScope. Set it to true or false.
Then in the rendered section of the div retrieve the scoped variable.
Also in the button you need to do a full or partial refresh.
Hope that helps
P.S. I’m actually going to be demonstrating this very soon on notesin9.com.
Subject: Show/hide div visibility
I’d thought of this, and I know it is not a large tax on the network/server to do it this way, but isn’t a scoped variable server-side? Wouldn’t changing this and re-rendering even part of the page require an AJAX request to the server? I suppose I could do it this way if forced, but ideally, I’d like to use traditional DHTML methods and avoid that round-trip altogether.
Subject: Yes.
You are correct. That would basically do an AJAX call inside a partial page refresh. It’s easy to do but there is a server hit. I’ve not worked on an app yet where that is a concern. But it certainly could be.
You’re alternative is the Client Side JS… I’ve NOT done a lot there. I don’t recall seeing this as an example anywhere…
I’d suggest IQJam.net as another place to ask questions… Xpages especially.
Have you seen Xpageswiki.com? There’s a ton of useful little snippets over there.
I don’t know if an official developers guide. Unlike when I was starting out there’s a LOT of good info on the wiki’s now. There’s a redbook/redwiki as well.
For paid education
Matt White has Xpages101.net which is awesome and of course TLCC.com has a really quality module.
For Free- there was the 54 part Learning Xpages series on qtzar.com and my own notesin9.com stuff…
Oh and of course the Xpagesblog.com…
hope that helps.