Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Adding js to my JSF page

843844Feb 23 2010 — edited Feb 23 2010
Hey

I am trying to add javaScript functionality to my JSF page. I have been trying almost everything and still I cant figure it out.

The last version:

Adding this line to my JSF page:

<f:verbatim>
<script src="#{facesContext.externalContext.requestContextPath}/resources/javascript/chat.js" >
</script>
</f:verbatim>

Remark: The js file is located under: IceFacesExample3\IceFacesExample3\WebRoot\resources\javascript

<------------------------------------------------------------------------------------------------------->
In - chat.js I have only one function trying to alert some data:

function KeyDownHandler()
{
window.alert("natalie");
return true ;

}

<------------------------------------------------------------------------------------------------------->

In my JSF page I am calling KeyDownHandler :

<ice:inputText id="txtMsg" value="#{eITMessagesListRequest.message}" onkeypress="KeyDownHandler()"></ice:inputText>

<------------------------------------------------------------------------------------------------------->
I assume the js file can't be reached!!! I was trying also to locate the js file in the same place my JSF files are located and using,

<f:verbatim>
<script src="chat.js" >
</script>
</f:verbatim>

I hope some one can help me!!!!

Thanks,Natalie

Edited by: nataly_afota7777 on Feb 23, 2010 4:59 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2010
Added on Feb 23 2010
3 comments
270 views