-
1. MultiSelect DropDown Custom Component
srini0883 Feb 7, 2011 1:11 AM (in response to srini0883)Hi,
To put this question in otherway around,
Did anyone came across this situation of conflicts arising between the Richfaces javascript libraries and other javascript libraries while using the custom component.
How can we crack this ?
Regards,
Srinivasan Mahadevan
-
2. MultiSelect DropDown Custom Component
blabno Feb 7, 2011 3:18 AM (in response to srini0883)Hi, of course we did. Reasons may varry. In my case it was usage of $ (dollar) in stead of jQuery. Both jQuery and Prototype use dollar as shorthand.
Could you please share your component's source?
-
3. Re: MultiSelect DropDown Custom Component
srini0883 Feb 7, 2011 3:44 AM (in response to blabno)Hi,
Even i see that is the reason behind my components problem too. Can you please help me how to overcome this ?
I am sharing my components source code here for you to look into it.
Thanks for your response.
Regards,
Srinivasan Mahadevan
-
Multiselectdropdown.zip 211.4 KB
-
-
4. Re: MultiSelect DropDown Custom Component
blabno Feb 7, 2011 3:59 AM (in response to srini0883)1 of 1 people found this helpfulAs I've suspected. You are using $ shorthand in stead of jQuery.
Substitute stuff like $(document), $("#s1"), $("#s2"), etc. with jQuery(document), jQuery("#s1"), etc.
-
5. Re: MultiSelect DropDown Custom Component
ilya40umov Feb 7, 2011 4:16 AM (in response to blabno)1 of 1 people found this helpfulI noticed that you are using jquery.js from your resources. Why aren't you using RichFaces built-in jquery?
-
6. Re: MultiSelect DropDown Custom Component
ilya40umov Feb 7, 2011 4:18 AM (in response to ilya40umov)
RichFaces includes jQuery JavaScript framework. You can use the futures of jQuery directly without defining the <rich:jQuery> component on a page if it is convenient for you. To start using the jQuery feature on the page, include the library into a page with the following code:...
<a4j:loadScript src="resource://jquery.js"/>
...Refer to the jQuery documentation for the right syntax. Remember to use
jQuery()
function instead of$()
, as soon as jQuery works without conflicts withprototype.js
. -
7. Re: MultiSelect DropDown Custom Component
srini0883 Feb 7, 2011 4:50 AM (in response to blabno)Bernard Labno wrote:
As I've suspected. You are using $ shorthand in stead of jQuery.
Substitute stuff like $(document), $("#s1"), $("#s2"), etc. with jQuery(document), jQuery("#s1"), etc.
Hi Bernard,
i tried by replacing $ with jQuery, but it did not resolve my issue.Regards,
Srinivasan Mahadevan
-
8. Re: MultiSelect DropDown Custom Component
srini0883 Feb 7, 2011 4:52 AM (in response to ilya40umov)Hi Ilya,
Ok, i shall try using the built in Richfaces Jquery and get back.
Thanks for your replies.
Regards,
Srini
-
9. Re: MultiSelect DropDown Custom Component
srini0883 Feb 7, 2011 5:34 AM (in response to srini0883)Hi Ilya,
I am not very sure of how to use the <rich:jQuery> tag in the page.
Am i doing something wrong by including the jquery.js in the component jar directly ?
The component works fine when i am not using it along with any of the Richfaces out of the box components.
The Ridiculous thing is that when i use the component more than one time in the page, only one of them is working.
I am attaching a screen shot to just give an insight of the problem.
Regards,
Srinivasan Mahadevan
-
twocomponents.JPG 8.9 KB
-
component.JPG 11.1 KB
-
-
10. MultiSelect DropDown Custom Component
ilya40umov Feb 7, 2011 8:41 AM (in response to srini0883)1) Don't add jquery.js because there will be two jquery implementation on the page.
2) You don't need to use rich:jQuery tag. You can simply use jQuery() but you need to load jQuery library from RF jars.
<a4j:loadScript src="resource://jquery.js"/>
3) If you have some additional issues don't mix them in this thread and create a new one.
-
11. MultiSelect DropDown Custom Component
srini0883 Feb 7, 2011 8:50 AM (in response to ilya40umov)Now the Component is working fine. The issue was due to the jquery.js file which i had included.
As you have mentioned, i am using the jQuery from RF jars only now.
Thanks for your Response Ilya!!!
-
12. MultiSelect DropDown Custom Component
srini0883 Feb 7, 2011 11:36 PM (in response to blabno)Thanks Bernard for your inputs.
Regards,
Srinivasan Mahadevan
-
13. Re: MultiSelect DropDown Custom Component
sathiyanvenkatesh Oct 1, 2013 2:33 AM (in response to srini0883)