-
1. Re: DropDownMenu How to redirect to another page
sergeysmirnov Jun 24, 2007 8:02 AM (in response to haoues01)action="http://www.google.com" is incorrect statement in JSF. action is NOT a URL, but reference to the action method returns String (or just String outcome in the simple case) that is used than in the navigation rule defined the faces-config.xml
However, if you DO NOT want to navigate through your application (like you originally asked), but want to navigate to outside the application (using external URL), you can use approach shown in the http://livedemo.exadel.com/richfaces-demo/richfaces/dropDownMenu.jsf , See "Links" menu item there. -
2. Re: DropDownMenu How to redirect to another page
haoues01 Jun 24, 2007 7:11 PM (in response to haoues01)Hi SergeySmirnov,
Thanks a lot for you reply. You'll find below my faces-config.xml and my DropDownMenu. Could you please tell me what's wrong whith this ?
faces-config.xml :
...
<navigation-rule>
<from-view-id>/accounts.jsp</from-view-id>
<navigation-case>
<from-outcome>acctedit</from-outcome>
<to-view-id>/account-edit.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/main.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/members.jsp</from-view-id>
<navigation-case>
<from-outcome>memberedit</from-outcome>
<to-view-id>/member-edit.jsp</to-view-id>
</navigation-case>
</navigation-rule>
...
Menu :
<c:if test="${user.loggedIn}">
<f:view>
<h:form>
<rich:toolBar width="500px" itemSeparator="line">
<rich:dropDownMenu value="Accounts Receivable" >
<rich:menuItem value="Main AR" action="memberedit"/>
<rich:menuItem value="Preview Invoices" action="acctedit"/>
</rich:dropDownMenu>
</rich:toolBar>
</h:form>
</f:view>
</c:if>
Thanks in advance. -
3. Re: DropDownMenu How to redirect to another page
haoues01 Jun 24, 2007 7:13 PM (in response to haoues01)Sorry ...
I tried to find out the source code of the demo http://livedemo.exadel.com/richfaces-demo/richfaces/dropDownMenu.jsf but I haven't found it so far. -
4. DropDownMenu How to redirect to another page
carlhowarth Oct 11, 2007 8:18 AM (in response to haoues01)Hello there,
I think there may be a bug in this, unless of course I'm doing something incorrectly (always possible!). I have a global navigation rule setup and have tried the following two ways of getting this rule to be called from the drop down menu item:
Number 1:<rich:dropDownMenu value="Test"> <rich:menuItem value="Test1" action="testnavrule1"/> </rich:dropDownMenu>
Number 2:<rich:dropDownMenu value="Test"> <rich:menuItem> <h:commandLink action="testnavrule1" value="Test1" /> </rich:menuItem> </rich:dropDownMenu>
Both of which don't work! If I put the command link outside of the menu item the navigation rule is adhered to.
Can anybody help at all?
I am using:
Tomcat 6.0.14
MyFaces 1.2.0
Tomahawk 1.1.6
Richfaces 3.1.1-GA
Ta very much, Carl -
5. Re: DropDownMenu How to redirect to another page
dmitry.demyankov Oct 11, 2007 8:22 AM (in response to haoues01)The first one worked fine for me..
-
6. Re: DropDownMenu How to redirect to another page
carlhowarth Oct 11, 2007 8:53 AM (in response to haoues01)Yes, I've cracked it now - it was entirely my fault - a new app mixing up 'from-outcome' with 'from-action' in my faces-config.
Sorry for wasting your time!