voyent
How to access "class name" of icefaces component in jquery  XML
Forum Index -> General Help
Author Message
vinodp

Joined: 12/Jul/2010 02:13:33
Messages: 6
Offline


I am trying use jquery in icefaces and my component source code will be like this

<input name="searchFrm:j_idt98:0:j_idt31" class="iceCmdBtn Qbutton" id="searchFrm:j_idt98:0:j_idt31" onclick="return showLoader(0);iceSubmitPartial(form, this, event);return false;" onfocus="setFocus(this.id);" onblur="setFocus('');" type="submit" value="Search"/>

so here i am trying to acess the class name of component which is ="iceCmdBtn Qbutton" in jquery by using following code but its not working could anyone plz help me.

$(document).ready(function() {
$(".iceCmdBtn .Qbutton" ).click(function(){
alert("test");
});
});


bfuller18

Joined: 06/May/2014 11:50:53
Messages: 47
Offline


Which version of icefaces are you using?

Are you including your own jQuery or using the version in icefaces?

Do you have any javascript errors in your javascript console?

Code:
				
 				//Get a jQuery reference (using icefaces internal copy)
 				var $j = window.ice.ace.jq.noConflict();
 				// $j is now an alias to the jQuery function; creating the new alias is optional.
 				$j(document).ready(function() {
 					$(".iceCmdBtn .Qbutton" ).click(function(){
 						alert("test");
 					});
 				}); 		
 
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


There are probably other details you need to take care of when using jQuery and ICEfaces together (such as re-initializing jQuery handlers after an ICEfaces DOM update), but I think your selector above might not be right. Try removing the space between iceCmdBtn and Qbutton.

Code:
 $('.iceCmdBtn.Qbutton')...
 

.
vinodp

Joined: 12/Jul/2010 02:13:33
Messages: 6
Offline


Thanks for replies... currently i am using icefaces 3.3 version..

and yes i am able to acess it.. now
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team