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 5
Upcoming Webinar: XPages and jQuery DataTables
Tue, Oct 4th 2016 3
Adding icon columns to DataTables with FontAwesome
Wed, Sep 14th 2016 4
Demo database from my MWLUG session
Thu, Sep 8th 2016 2
Slides (and thoughts) from MWLUG – XPages & jQuery DataTables
Wed, Aug 24th 2016 8
I’m speaking at MWLUG about…
Wed, Jun 29th 2016 5
XPage loading slow? Check your document datasource
Wed, Dec 16th 2015 5
Top 10
My first OpenNTF project – Dojo Name Picker
Fri, Jul 25th 2014 8
My first #MWLUG … what was I waiting for?
Sun, Aug 23rd 2015 8
Slides (and thoughts) from MWLUG – XPages & jQuery DataTables
Wed, Aug 24th 2016 8
Modernizing A Notes App With XPages (MANA-X) Part 1 – Introduction
Wed, Sep 3rd 2014 6
XPage loading slow? Check your document datasource
Wed, Dec 16th 2015 5
I’m speaking at MWLUG about…
Wed, Jun 29th 2016 5
Questions from the DataTables Webinar
Tue, Oct 18th 2016 5
XPages tip: Using jQuery class selectors with hidden inputs
Mon, Aug 18th 2014 4
SSJS variables vs. scope variables
Mon, Jul 14th 2014 4
Adding icon columns to DataTables with FontAwesome
Wed, Sep 14th 2016 4


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
5
Questions from the DataTables Webinar
Tue, Oct 18th 2016 11:58a   Michael Smith
A
3
Upcoming Webinar: XPages and jQuery DataTables
Tue, Oct 4th 2016 8:39a   Michael Smith
A
4
Adding icon columns to DataTables with FontAwesome
Wed, Sep 14th 2016 1:55a   Michael Smith
A
2
Demo database from my MWLUG session
Thu, Sep 8th 2016 7:11a   Michael Smith
A
8
Slides (and thoughts) from MWLUG – XPages & jQuery DataTables
Wed, Aug 24th 2016 9:49a   Michael Smith
A
5
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