193 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Questions from the DataTables Webinar
Tue, Oct 18th 2016 10
Upcoming Webinar: XPages and jQuery DataTables
Tue, Oct 4th 2016 9
Adding icon columns to DataTables with FontAwesome
Wed, Sep 14th 2016 13
Demo database from my MWLUG session
Thu, Sep 8th 2016 9
Slides (and thoughts) from MWLUG – XPages & jQuery DataTables
Wed, Aug 24th 2016 10
I’m speaking at MWLUG about…
Wed, Jun 29th 2016 12
XPage loading slow? Check your document datasource
Wed, Dec 16th 2015 10
Top 10
Adding icon columns to DataTables with FontAwesome
Wed, Sep 14th 2016 13
I’m speaking at MWLUG about…
Wed, Jun 29th 2016 12
XPage loading slow? Check your document datasource
Wed, Dec 16th 2015 10
Slides (and thoughts) from MWLUG – XPages & jQuery DataTables
Wed, Aug 24th 2016 10
Questions from the DataTables Webinar
Tue, Oct 18th 2016 10
Boot your alerts in the … with bootAlert
Tue, Feb 10th 2015 9
Demo database from my MWLUG session
Thu, Sep 8th 2016 9
Upcoming Webinar: XPages and jQuery DataTables
Tue, Oct 4th 2016 9
SSJS variables vs. scope variables
Mon, Jul 14th 2014 8
My first OpenNTF project – Dojo Name Picker
Fri, Jul 25th 2014 7


XPages tip: Using jQuery class selectors with hidden inputs
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
michaelgsmith    

If you cut your XPages teeth by using the out-of-the-box-included dojo libraries, then you are probably intimately familiar with dojo.byId(“#{id:myElementID}”) to locate elements on your XPage based on the id attribute.

After starting to weave jQuery into your projects, you probably realized pretty quickly that the jQuery id selector syntax of $(“#myElementID”) does not work well with XPage component ids. But of course there is a solution for that – Marky Roden’s XSnippet which wraps the jQuery ID selector function in a XPage version.

Due to the above issues with getting elements by ID in jQuery, you probably started using class selectors such as $(“.myClassName”). This is all fine and good – until you go to add a class to the properties panel of a hidden input control:

As you can see from the screenshot above, there is no place to enter a class name in the properties for a hidden input control. Seems kind of silly, doesn’t it? It’s a field. Fields have classes. I should be able to add a class to a hidden field. Apparently not.

Luckily, there is an incredibly simple way to do this using the attrs properties in the basics section of the properties panel:

2014-08-17_23-05-43
  • Add a new attribute by clicking the plus sign
  • In the name field, enter “class” (do not add the quotes)
  • In the value field, enter the name of your class, for example, “myClassName” (again, no quotes)

Now, you should be able to access your hidden input using a jQuery selector.




---------------------
http://xpage.me/2014/08/18/xpages-tip-using-jquery-class-selectors-with-hidden-inputs/
Aug 18, 2014
5 hits



Recent Blog Posts
10
Questions from the DataTables Webinar
Tue, Oct 18th 2016 11:58a   Michael Smith
A
9
Upcoming Webinar: XPages and jQuery DataTables
Tue, Oct 4th 2016 8:39a   Michael Smith
A
13
Adding icon columns to DataTables with FontAwesome
Wed, Sep 14th 2016 1:55a   Michael Smith
A
9
Demo database from my MWLUG session
Thu, Sep 8th 2016 7:11a   Michael Smith
A
10
Slides (and thoughts) from MWLUG – XPages & jQuery DataTables
Wed, Aug 24th 2016 9:49a   Michael Smith
A
12
I’m speaking at MWLUG about…
Wed, Jun 29th 2016 8:41a   Michael Smith
A




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