- This topic has 10 replies, 3 voices, and was last updated 19 years, 4 months ago by donw1128.
-
AuthorPosts
-
donw1128MemberHi All,
I’m fairly new to MyEclipse and JSF, but have been gradually getting things working fairly well. So I decided I’d like to try MyFaces, and started with the inputCalendar component.
I created a new web project, selected “Add JSF Capabilities…”, chose “MyFaces 1.09″, and clicked finish. Then I created a simple .jsp page and added the following:
<%@ taglib uri=”http://myfaces.apache.org/extensions” prefix=”x”%>
.. other stuff ..
<h:form id=”myform”>
<x:inputCalendar id=”rt_date_from” value=”#{bean.fromDate}”
renderAsPopup=”true”/>
</h:form>and add the ‘bean’ of course. When I deploy and open the page, I get a Javascript error but the control renders fine. When I click on the “…” button, I get another Javascript error. Looking at the HTML source, it seems that the Javascript function jscalendarPopUpCalendar is called, but nothing on the page appears to load or define that function.
Looking in the myfaces-extensions.jar, I found the script. But why isn’t it being loaded in the page? What step am I missing to get things to work?
Thanks for the help.
Don
donw1128MemberBTW: I’m using the latest stuff (maybe that is the problem):
Tomcat 5.5
JDK 1.5
Eclipse 3.1
MyEclipse 4.0M2Thanks,
Don
Riyad KallaMemberMoving to OT > Soft Dev.
Don since you are using a MyFaces custom component I would direct you to their forums, not because we don’t want to help, but because we have no idea. none of us have used those tags before, so I don’t know what is required of you to get them working.
donw1128MemberThanks for the suggestion Riyad.
I posted the question on the MyFaces user list, and got a quick reply. The myfaces extensionFilter is needed in the web.xml. Perhaps MyEclipse should be automatically adding this when a new MyFaces based project is created? Here are the lines I added:
<!-- Extensions Filter --> <filter> <filter-name>extensionsFilter</filter-name> <filter-class> org.apache.myfaces.component.html.util.ExtensionsFilter </filter-class> <init-param> <description> Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> <param-name>uploadMaxFileSize</param-name> <param-value>100m</param-value> </init-param> <init-param> <description> Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB </description> <param-name>uploadThresholdSize</param-name> <param-value>100k</param-value> </init-param> <!-- <init-param> <param-name>uploadRepositoryPath</param-name> <param-value>/temp</param-value> <description>Set the path where the intermediary files will be stored. </description> </init-param>--> </filter> <filter-mapping> <filter-name>extensionsFilter</filter-name> <url-pattern>*.faces</url-pattern> </filter-mapping> <filter-mapping> <filter-name>extensionsFilter</filter-name> <url-pattern>/faces/*</url-pattern> </filter-mapping>
Thanks,
Don
Riyad KallaMemberDon thank you very much for posting your findings, I’ll file this as I think you have a very good point.
FleepMemberHi,
I encounter the same problem as you.
I test your solution, but nothing, I have always the javascript error. What can I do ?I don’t use MyEclipse, but I think it’s not a necessary.
I try also to subscribe to the MyFaces user list, but, my mail is always return with mailer-daemon.Thanks for help.
donw1128MemberI don’t have a clue why it is not working for you. Perhaps something else is missing in either your web.xml or faces-config.xml file.
But in order to send mail to the myfaces discussion group, you must subscribe. Go to the page:
http://myfaces.apache.org/mailinglists.html
and click the Subscribe link for the “users at myfaces.apache.org” line. This will send a blank e-mail to subscribe you. At that point you should get a confirmation e-mail which you must reply to to fully subscribe.
Don
FleepMemberOk, I didn’t see that the web site of MyFaces has move to this address.
In my web.xml, I add what you have write just before.
But, in the faces-config.xml, I do nothing.This file is the definition or your own component so I thought there is nothing to write here. Is it wrong ?
Thanks for your help.
donw1128MemberAre you using any IDE? There are so many things to set up for JSF that it really helps to have a tool that creates the initial JSF project at least.
If you are using a different tool than MyEclipse, it should have set everything else up for you, and all you need to add is the above definitions.
Don
FleepMemberNo, I don’t use any for create the initial JSF Project.
I have just Eclipse, Jboss, JDK, etc…
Have you something in your faces-config ?
donw1128MemberI have lots of things in my faces-config.xml file ;-] but nothing that pertains to MyFaces.
So assuming that you had created a working JSF application to start with, and then added the lines above to your web.xml, I have no idea why things are not working for you.
Did you also setup the Faces ConfigureListener in your web.xml?
<listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener>
Don
-
AuthorPosts