-
1. Re: problem in position of jquery.ui.dialog ?
ilya_shaikovsky Apr 5, 2010 3:25 AM (in response to shasho)1 of 1 people found this helpful1) do not load jquerry base library as external resource. use bundled with richfaces as there could be versions conflicts. Check FAQ (common client side problems) and look through richfaces-demo load script page to learn how to load resources from class-path.
2) in general looks like just jquery problem.. Or it works fine if used on the pages without RF resources? Then it seems 1) is the reason.
-
2. Re: problem in position of jquery.ui.dialog ?
shasho Apr 6, 2010 12:07 AM (in response to ilya_shaikovsky)Hi,
You are right, here are the needed step for jquery.ui.dialog integration
1 in Web.xml
<rich:jQuery timing="onload" query="undefined" />
To use ONLY jquery
...
<context-param>
<param-name>org.richfaces.ExcludeScripts</param-name>
<param-value>Prototype,Scriptaculous</param-value>
</context-param>
...
2. just after the <body> add this
3 load all the external scripts and css
<a4j:loadStyle src="/resources/js/themes/start/jquery-ui-1.8.custom.css"/>
<a4j:loadScript src="/resources/js/jquery.dimensions.js" />
<!-- you pick the elements in http://jqueryui.com/download, -->
<a4j:loadScript src="/resources/js/jquery-ui-1.8.custom.min.js" />4. Add the ready function for jquery
<script language="JavaScript">
jQuery(document).ready(function(){
jQuery("#example").dialog({ autoOpen: false } );
});
</script>5. In your HTML define the dialog
<div id="example" style="display:none;" title="my title">
expmple
<br/>
<a href="/site/home.smart">
<img src="/resources/images/example.jpg"/>
</a>
</div>6. In your HTML call to open the dialog
</div>
<a href="#" onclick='jQuery("#example").dialog("open");'>Show it</a>
<br/>
<a href="#" onclick='jQuery("#example").dialog("close");'>Close it</a></c:if>
Amir
-
3. Re: problem in position of jquery.ui.dialog ?
ilya_shaikovsky Apr 6, 2010 10:24 AM (in response to shasho)<context-param> <param-name>org.richfaces.ExcludeScripts</param-name> <param-value>Prototype,Scriptaculous</param-value> </context-param>
this means that prototype and scriptaculous will not be loaded. But RichFaces heavily depends on them. And wiki post contains clear note that if you excluding them you should load alternative versions of them (designed just for case when you want to degrade or upgrade the versions manually.) But changing of our bundled libs with external - could cause problems because we have some patches applied to the libraries which still unsolved in original ones.
So I guess that this step should be reverted as RF features or components you using will possibly be broken.