voyent
Problem with commandButton in simple example - BEA Workshop for JSF 3.2.1  XML
Forum Index -> Tools
Author Message
msanders

Joined: 21/Nov/2006 00:00:00
Messages: 14
Offline


Hi,

Could anyone explain why the h:commandButton in the following example doesn't work, now that I've integrated ICEfaces?

It all worked before I used the context menu "ICEfaces Integration > Enable ICEfaces...".

The managed bean called "simple" just returns "success". The action listener in the same bean is correctly called.

I'm running: Tomcat 5.5.20, BEA Workshop for JSF 3.2.1, ICEfaces workshop integration 1.5.1, Sun JSF RI 1.1, Internet Explorer 6.0.

- Mark

The faces-config.xml is as follows:
Code:
 <?xml version='1.0' encoding='UTF-8'?>
 <!DOCTYPE faces-config PUBLIC
   "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
   "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
 
 <faces-config>
 
   <application>
     <message-bundle>resources.application</message-bundle>
     <locale-config>
       <default-locale>en</default-locale>
     </locale-config>
   </application>
 
   <managed-bean>
     <managed-bean-name>simple</managed-bean-name>
     <managed-bean-class>com.nr.Simple</managed-bean-class>
     <managed-bean-scope>request</managed-bean-scope>
   </managed-bean>
   <navigation-rule>
     <from-view-id>/welcome.jspx</from-view-id>
     <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/success.jspx</to-view-id>
     </navigation-case>
   </navigation-rule>
 </faces-config>
 
 Filename web.xml [Disk] Download
 Description web.xml
 Filesize 4 Kbytes
 Downloaded:  699 time(s)

 Filename welcome.jspx [Disk] Download
 Description Basic JSP document with a command button, converted to use ice:outputDeclaration because jsp:out is ignored.
 Filesize 923 bytes
 Downloaded:  550 time(s)

liming.wu

Joined: 26/Oct/2004 00:00:00
Messages: 441
Offline


msanders,

1. in welcome.jspx, values taken from resource bundle should be value="#{bundle['welcomeTitle']}" instead of value="#{bundle.welcomeTitle}"

2. You have mentioned that you use Sun RI 1.1 but your web.xml shows you use MyFaces

Regards

Liming
[Email]
msanders

Joined: 21/Nov/2006 00:00:00
Messages: 14
Offline


Thanks for your reply.

liming_w wrote:

1. in welcome.jspx, values taken from resource bundle should be value="#{bundle['welcomeTitle']}" instead of value="#{bundle.welcomeTitle}"
 
These are equivalent ways to reference the entries in a map (or other indexed property): if the key is a string without a '.' in it (e.g. 'welcomeTitle') you can access the value with the '.' operator.

Here's a reference for this part of the JSP 2.0 expression language:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html#wp84857

Changing all these to the form you suggest doesn't make a difference.

liming_w wrote:

2. You have mentioned that you use Sun RI 1.1 but your web.xml shows you use MyFaces
 
My mistake. Here is the web.xml:
 Filename web.xml [Disk] Download
 Description
 Filesize 4 Kbytes
 Downloaded:  512 time(s)

liming.wu

Joined: 26/Oct/2004 00:00:00
Messages: 441
Offline


Sorry. I missed that there is no "." in your property name.

Based on your files you posted, I can run it on tomcat 5.5.20 without problem using workshop with icefaces capabilities added.

I attached war file here. Note faces-config has been slightly changed and dependent jar files are not included.
 Filename bundle.war [Disk] Download
 Description
 Filesize 61 Kbytes
 Downloaded:  520 time(s)

[Email]
msanders

Joined: 21/Nov/2006 00:00:00
Messages: 14
Offline


Hi Liming, and thank you for your reply,

liming_w wrote:
Note faces-config has been slightly changed 
Interesting. The changes you made to the faces-config.xml fixes the application, and clicking on the submit commandButton moves to the second page.

The changes are as follows:
Old Code:
   <navigation-rule>
     <from-view-id>/welcome.jspx</from-view-id>
     <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/success.jspx</to-view-id>
     </navigation-case>
   </navigation-rule>
 

New Code:
   <navigation-rule>
     <from-view-id>/welcome.iface</from-view-id>
     <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/success.iface</to-view-id>
     </navigation-case>
   </navigation-rule>
 

However, the old code, referencing the underlying jspx document, works fine using the MyFaces implementation.

Also, BEA Workshop for JSF is now complaining that it doesn't know about the navigation rules for the application. Specifically, BEA Workshop is warning that
The navigation outcome "success" returned from the "submit" action is not valid from this page. 

Actually, the following works as well:
Code:
   <navigation-rule>
     <from-view-id>/welcome.iface</from-view-id>
     <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/success.jspx</to-view-id>
     </navigation-case>
   </navigation-rule>
 


- Mark
msanders

Joined: 21/Nov/2006 00:00:00
Messages: 14
Offline


Hi,

The following works with both the Sun RI and MyFaces, and also stops BEA Workshop complaining about missing navigation rules:
Code:
 <navigation-rule>
   <from-view-id>/pages/welcome.*</from-view-id>
   <navigation-case>
     <from-outcome>success</from-outcome>
     <to-view-id>/pages/success.jspx</to-view-id>
   </navigation-case>
 </navigation-rule>
 
I'm going to investigate a bit further, and have a look at the JSF specs. I don't think I understand the definition of a "view identifier".

- Mark
 
Forum Index -> Tools
Go to:   
Powered by JForum 2.1.7ice © JForum Team