>Thank you for your opinions
>
>I have a few notes:
>
> 1) If you need to invoke an action method you should definitely use
> h:commandLink or h:commandButton BUT is it necessary to call an action method
> whenever you need to move to a different page?
> * using outputLink to navigate to a different page (plus specifying page
> name + parameters explicitly) is not the best way BUT >what if we would use
> <y:navigation method="GET" navigationResult="detailPage"
> value="#{item.label}">
> <f:param name="itemName" value="#{item.name}" />
> <f:param name="itemCategory" value="#{item.category}" />
> </y:navigation> - this could render as simple link <a
> href="detailPage.jsp?itemName=FerrariF50?>itemCategory=SportsCars">Ferrari
> F50</a>
>
> 2) Personally, I consider our solution as a hack from the point of view of
> JSF BUT what if your application is REQUIRED to support >links like
> "page.jsp¶meters= ..."? (this requirement is pretty valid and useful!) Is
> it impossible to achieve this "neatly" using JSF >(MyFaces)???
I think code is sometimes like a cup of coffee. The taste is a unique
experience. I wouldn't say that creating a custom JSF component is a hack.
JSF just give you several methods to accomplish page navigation.
If you favor classic struts, you might prefer something like this:
<h:outputLink value="detailPage.jsp">
<f:param name="itemName" value="#{bean.productName}"/>
<f:param name="itemId" value="#{bean.productId}"/>
<f:verbatim>View acme widget</f:verbatim>
</h:outputLink>
<managed-bean>
<description>
This class simulates the classic Struts FormBean where
request parameters are populated in a POJO object.
</description>
<managed-bean-name>formBean</managed-bean-name>
<managed-bean-class>xxx.MyFormBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>productId</property-name>
<value>#{param.itemId}</value>
</managed-property>
<managed-property>
<property-name>productName</property-name>
<value>#{param.itemName}</value>
</managed-property>
</managed-bean>
Gary
--- Begin Message ---
Thank you for your opinions
I have a few notes:
1) If you need to invoke an action method you should
definitely use h:commandLink or h:commandButton BUT is it necessary to
call an action method whenever you need to move to a different page?
* using outputLink to navigate to a
different page (plus specifying page name + parameters explicitly) is
not the best way BUT what if we would use
<y:navigation method="GET" navigationResult="detailPage"
value="#{item.label}">
<f:param name="itemName" value="#{item.name}" />
<f:param name="itemCategory" value="#{item.category}" />
</y:navigation> - this could render as simple link <a
href=""
F50</a>
2) Personally, I consider our solution as a hack from the
point of view of JSF BUT what if your application is REQUIRED to
support links like "page.jsp¶meters= ..."? (this requirement is
pretty valid and useful!) Is it impossible to achieve this "neatly"
using JSF (MyFaces)???
MN
On 8/30/05, Gary VanMatre <[EMAIL PROTECTED]> wrote:
> >>>>>
> <snip>
> I'm still a bit confused on how you deal with links that go to backing
> bean methods for standard links/buttons. As an example, imagine the
> header on a page...
>
> John Doe [edit user] [logs for user] [user summary] [look up company]
> 1455 some address [edit address]
> Somewhere, state, 12456
>
> The example above is a bit exaggerated, but the point is the links(or
> even buttons) would have to access methods in all different kinds of
> backing beans.
> <<<<<<<<<<
You might give the commandLink component a try.
<h:commandLink id="editUser" action=""
somBean.editUser}">
<h:outputText value="edit user"/>
</h:commandLink>
<h:commandLink id="logsForUser" action=""> <h:outputText value="logs for user"/>
</h:commandLink>
> --
> Rick
Gary
--- End Message ---