199 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
IBM Connect with PSC and LDC
Mon, Feb 13th 2017 3
(Not So) Super Secret Discount Code for IBM Connect 2017
Thu, Jan 19th 2017 3
What’s Plasti Dip And How Did You Do That?
Wed, Dec 7th 2016 8
I Got a New Ride
Fri, Nov 18th 2016 5
Getting the Correct Syntax for JavaScript in XPages
Wed, Oct 5th 2016 7
Back to Running
Fri, Sep 23rd 2016 3
Recent Adjustments to 6 Years Cable Free
Wed, Sep 21st 2016 3
Top 10
Too Many Design Elements – Or Things I Forgot I Knew
Fri, Feb 19th 2016 15
What’s Plasti Dip And How Did You Do That?
Wed, Dec 7th 2016 8
Getting the Correct Syntax for JavaScript in XPages
Wed, Oct 5th 2016 7
Running Notes of a Different Kind – Part 2
Mon, Mar 21st 2016 6
Review: Hands On Sencha Touch 2
Tue, Aug 19th 2014 5
I Got a New Ride
Fri, Nov 18th 2016 5
View Article: Getting Started with XPages Localization
Fri, May 23rd 2014 4
Speaking at IBM ConnectED 2015
Wed, Dec 17th 2014 4
I Made Ribs So Good I Had To Blog About Them
Thu, Jun 11th 2015 4
IBM Champion
Mon, Nov 23rd 2015 4


Getting the Correct Syntax for JavaScript in XPages
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
Kathy Brown    

I was recently working on a project where my code was injecting XPage elements onto the page at runtime.  To do that, you need to know a lot of syntax.  Syntax that isn’t in the help file, or blogged about, or easily findable.  Sure, there’s this, but that isn’t exactly reader-friendly, nor are there examples of how to use the elements.  Just because you know you’re using “XspInputText”, doesn’t mean you know how to use it.  What’s the syntax for adding an attribute, for example?  Or maybe you know the syntax structure, but need to know what the parameter looks like in the code.

Designer Data Panel for Date Field For example, you want to add a Date field with certain parameters set.  You know how to set them in Designer in the data panel, but how do you set those parameters programmatically in JavaScript?

Thankfully, Toby Samples showed me a cheat to find out.  Create a dummy XPage, add your element and do whatever it is you want to do, i.e. set the parameters for your date field.  Save the page.  In Designer, go to Package Explorer and your nsf.  Expand the Local folder and then the xsp folder.  There you’ll see all of your custom controls and XPages with a .java extension.  Double-click on the XPage.java file.  It will open and there you’ll see the Java code used to generate that XPage, including your element and how the parameters were set programmatically.  This can be really useful when you’re adding something like an attribute via JavaScript and you can’t find any examples of HOW to add an attribute (or class or value binding or any other property).

Example, if you set the above “display format” to “Date and Time” in the picker, how is that set programmatically?

converter.setType(“both”);

With the parameter “both”.  Good luck figuring that out on your own.

File under: “Things you may have already known, but I didn’t, and I share it just in case you didn’t either” AND “Blog post titles I struggled with actually explaining what the post was about without actually typing the post in the title”



---------------------
http://feedproxy.google.com/~r/RunningNotes/~3/NT-PuAEgnd4/
Oct 05, 2016
8 hits



Recent Blog Posts
3
IBM Connect with PSC and LDC
Mon, Feb 13th 2017 7:23p   Kathy Brown
IBM Connect 2017 is just a week away.  I’ll be there and look forward to learning new stuff and meeting new people.  In addition to attending sessions and networking events, John Head and I will available to meet with YOU to discuss your collaboration roadmap.  And thanks to our partnership with LDC, we will also be the onsite representatives for LDC Via. If you’d like to meet with us, then go check out what we’re offering and sign up here, connect17.psclistens.com!
3
(Not So) Super Secret Discount Code for IBM Connect 2017
Thu, Jan 19th 2017 3:50p   Kathy Brown
Okay, it’s a secret in that I’m not blogging it, but it’s not so secret, in that all you have to do is reach out to me ( @IamKathyBrown on most social media ) or any other IBM Champion of your choice, for a $100 discount to attend IBM Connect 2017. If you read this in time, you can also listen to the ICS Community call this morning at 10AM ET (link), where they will discuss “What To Expect at IBM Connect”.  If you miss it, they usually record it.
8
What’s Plasti Dip And How Did You Do That?
Wed, Dec 7th 2016 9:15p   Kathy Brown
I recently plasti-dipped my side mirror caps on my new MINI.  I posted pics in various places online and several people asked “What’s Plasti Dip?” So, PlastiDip is “an air-dry rubber coating”.  Originally used to cover tool handles by dipping them in the substance.  Then people started dipping their car tire rims, then other parts of the car.  PlastiDip now comes in cans, so you can spray it on almost anything.  Why is it so great?  Because it peels off.  Dec
5
I Got a New Ride
Fri, Nov 18th 2016 1:19p   Kathy Brown
The Background: I’ve never had a fancy car.  Cars aren’t really my thing, so I always chose utility, safety, price, etc.  I also have what I jokingly call “car dyslexia”.  I can never remember or distinguish between anyone’s cars.  Sure, I can tell the difference between a sedan and a truck, but all sedans look the same to me. My first car was an ’86 Honda Accord manual hatchback in “champagne”.  It was high school, the car was used and afford
8
Getting the Correct Syntax for JavaScript in XPages
Wed, Oct 5th 2016 11:00a   Kathy Brown
I was recently working on a project where my code was injecting XPage elements onto the page at runtime.  To do that, you need to know a lot of syntax.  Syntax that isn’t in the help file, or blogged about, or easily findable.  Sure, there’s this, but that isn’t exactly reader-friendly, nor are there examples of how to use the elements.  Just because you know you’re using “XspInputText”, doesn’t mean you know how to use it.  What’s the syntax
3
Back to Running
Fri, Sep 23rd 2016 2:46p   Kathy Brown
Tomorrow will be the fourth run of my current return to running.  Coincidentally, tomorrow is the 9th anniversary of my first run. (Excluding the time when I lived in New York and signed up for the Chase corporate challenge and did almost no training and attempted to run 3 miles..  I had no idea what I was doing, I ran too fast, hated it, and immediately quit.  So I count September 24, 2007 as my first run.)  It was the “run” before I started the couch to 5k program.  After that
3
Recent Adjustments to 6 Years Cable Free
Wed, Sep 21st 2016 10:55p   Kathy Brown
Like many people these days, I cut the cord.  In the summer of 2010, I moved into my current house and decided from the start that I wouldn’t have cable.  A few of my friends were already cable-free and could provide advice (thank you, Carl Tyler!).  Here’s the thing though, I’m lazy.  I want things to “just work”.  I don’t want to have to fiddle and futz.  So I knew I wasn’t going to jump through a bunch of hoops to go cable-free, it was going to
3
Some Experiments in Running and Technology
Sun, Sep 18th 2016 2:58p   Kathy Brown
Okay, technically it was one experiment testing several hypotheses, but anyway. Background for the experiment: I used to run.  I had a Garmin Forerunner for a very long time that I loved very much and then I had a Garmin 220, which I also loved very much.  These both served me well before there were phones with GPS and apps and watches, oh my.  I also used to upload the data from these watches to the very awesome RunningAhead website.  I love the site, and especially the training log.   Al
3
MWLUG 2016 Wrap Up
Mon, Aug 22nd 2016 10:49p   Kathy Brown
Last week I was in Austin, TX for MWLUG 2016.  This was my second time speaking at this event, and once again, it was a great experience. I have been to Texas several times, but had never been to Austin.  I’m still not sure I can say I’ve been to Austin, I feel like I only got to see a small slice of it.  Between humidity that felt like I was drowning (it IS August in Austin) and pouring rain, I didn’t get to get out and about as much as I would have liked (and I even stayed




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition