202 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 6
(Not So) Super Secret Discount Code for IBM Connect 2017
Thu, Jan 19th 2017 5
What’s Plasti Dip And How Did You Do That?
Wed, Dec 7th 2016 11
I Got a New Ride
Fri, Nov 18th 2016 8
Getting the Correct Syntax for JavaScript in XPages
Wed, Oct 5th 2016 9
Back to Running
Fri, Sep 23rd 2016 6
Recent Adjustments to 6 Years Cable Free
Wed, Sep 21st 2016 12
Top 10
Recent Adjustments to 6 Years Cable Free
Wed, Sep 21st 2016 12
Too Many Design Elements – Or Things I Forgot I Knew
Fri, Feb 19th 2016 11
What’s Plasti Dip And How Did You Do That?
Wed, Dec 7th 2016 11
Getting the Correct Syntax for JavaScript in XPages
Wed, Oct 5th 2016 9
IBM Champion!
Mon, Jul 28th 2014 8
I Got a New Ride
Fri, Nov 18th 2016 8
How Staying in a Hotel Teaches Empathy
Fri, Jul 8th 2016 7
MWLUG 2016 Wrap Up
Mon, Aug 22nd 2016 7
Gotcha for Adding Ext JS (or other extras) to Domino Designer
Tue, Jun 2nd 2015 6
Some Experiments in Running and Technology
Sun, Sep 18th 2016 6


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
10 hits



Recent Blog Posts
6
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!
5
(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.




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