-
1. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 13, 2008 1:48 AM (in response to nohacks)This is all I have in my JSP that is causing the problem.
--script language="JavaScript" type="text/javascript" src="js/testUtils.js"-- --/script--
=======================
file testUtils.js
=======================
function swap(str){
alert("Phil in Swap");
} -
2. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 13, 2008 4:48 PM (in response to nohacks)any ideals out there???
Phil -
3. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
maksimkaszynski Apr 14, 2008 8:48 AM (in response to nohacks)Maybe, Mojarra redefines your function somehow?
Could you use Firebug to browse all loaded javascript files to find swap function redefined? -
4. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 9:04 AM (in response to nohacks)Yes, That is a great ideal...The problem is that my page hits an error and then redirects..
When I view Page source I dont see JavaScript Tag at all.
Mojarra is just JSF 1.2..
This worked with RichFaces 3.14 with the upgrade it does not seem to work.
Does it still support the < script > tag for javascript ??
Phil -
5. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
maksimkaszynski Apr 14, 2008 9:09 AM (in response to nohacks)Phil,
I still can't believe that when javascript error occurs, the page is getting redirected.
Or do I miss something? -
6. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 9:16 AM (in response to nohacks)Yes, It is very strange...
The pages does not get redirected.
I just add the redirect to the bottom of the current page.
It is like two pages in one. I have my
< % @ page errorPage="error.jsp" % >
this just sends them to login again....
It appends this to the current page...the view page source shows two pages...very strange..
Thanks for your help.
Phil -
7. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
maksimkaszynski Apr 14, 2008 9:22 AM (in response to nohacks)Phil,
please attach pages where you get such strange behavior -
8. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 9:50 AM (in response to nohacks)Hi Maksim,
It is hard for me to attach pages. I have a
do not disclose contract clause in my current contract.
I will mock up a page taking out the content for this company.
Will post in a few mins...
Thanks for your help
Phil -
9. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 10:20 AM (in response to nohacks)When I take out the < script > the page works fine.
Thanks
Phil
======================
<%@ page errorPage="error.jsp" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<h:graphicImage id="pic1"
style="border: thin solid black" height="500" width="450"
url="testServlet?file=#{employeeViewForm.photoName1}"
/>
... page edited here....
<h:graphicImage style="border: thin solid black" height="80" width="80"
onmouseover="swap('#{employeeViewForm.photoName6}')"
url="testServlet?file=#{employeeViewForm.photoName6}" />
... page edited here....
< script type="text/javascript">
function swap(str){
var swapImage = "testServlet?file=" + str ;
document.images[26].src = swapImageName;
}
< /script > -
10. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 10:50 AM (in response to nohacks)Hi,
The other issue I have is the
< h:graphicImage does not support name it has id option
This generates an < img > Tag...most functions use the name of the image tag.
The h:graphicImage does not create a name so I have to use the document.images[ numb ].src
it is ugly but I cant seem to get at the src any other way.
Thanks
Phil -
11. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 11:26 AM (in response to nohacks)I even looked at jQuery with rich:jQuery
it uses the name that is NOT generated with h:graphicImage too...
Any ideals
Phil
See example
============================
attr( key, value )
Set a single property to a value, on all matched elements.
Can compute values provided as ${formula}, see second example.
Note that you can't set the name property of input elements in IE. Use $(html) or .append(html) or .html(html) to create elements on the fly including the name property.
Return value: jQuery
Parameters:
* key (String): The name of the property to set.
* value (Object): The value to set the property to.
Example:
Sets src attribute to all images.
$("img").attr("src","test.jpg");
Before:
Result: -
12. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 12:40 PM (in response to nohacks)Any help from the board would be appreciated...
Thanks
Phil -
13. Re: RichFaces 3.2 app ...is there issues with JavaScript Tag
nohacks Apr 14, 2008 1:29 PM (in response to nohacks)I found a work around...
Thanks for all the help...
Phil