Xie Min,
This is a great find, very close to what I'm talking about. However,
in the following line:
<to-view-id>/view.jsp?objectId=#{view.objectId}</to-view-id>
what object does 'view' in the EL expression reference? Is this an
implicit object, or one defined in a configuration somewhere? If it is
implicit, how do I set it's properties from a backing bean?
Thanks a lot,
benjamin
On 4/29/06, xie min <[EMAIL PROTECTED]> wrote:
in myfaces
wiki(http://wiki.apache.org/myfaces/Custom_Navigation_Handler),
threr are some suggestion on url parameters passing:
Dynamic Url parameters passing: This allows passing parameters between pages
even when using redirection method. For exmaple, in order to navigate from a
pages name: view.jsp to a page named: edit.jsp, with the parameter:
objectId, the following thing can be done in navigation rule code:
<navigation-rule>
<from-view-id>/view.jsp</from-view-id>
<navigation-case>
<from-outcome>edit</from-outcome>
<to-view-id>/view.jsp?objectId=#{view.objectId}</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
2006/4/30, benjamin van der veen <[EMAIL PROTECTED]>:
> I think that jsf-comp onload thing might be what I'm looking for. I
> really surprised that something like this isn't built in to JSF. Is
> using this extension violating some design principle fundamental to
> JSF?
>
> benjamin
>
> On 4/28/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> > Have a look at:
> >
> >
http://wiki.apache.org/myfaces/InvokingJsfPagesWithStandardUrls
> >
http://jsf-comp.sourceforge.net/components/onload/index.html
> >
> > -Andrew
> >
> > On 4/28/06, benjamin van der veen <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I sent the message quoted below to this list a few days ago, but
> > > received no replies. I'm just wondering if perhaps it just got
> > > overlooked; I would appreciate any insight on this issue.
> > >
> > > Thanks a lot,
> > > benjamin
> > >
> > > On 4/26/06, benjamin van der veen <[EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > >
> > > > I'm coming from a PHP background, and I've run into a wall with JSF.
I
> > > > know how I'd get around it with PHP or ASP.NET, but for JSF I'm
> > > > stumped.
> > > >
> > > > Here's the scenario:
> > > >
> > > > I'm making a message board. It has multiple forum each of which has
> > > > many topics, each of which has many posts. Very standard thing here.
I
> > > > am implementing the page which allows a user to create a new topic.
> > > > The URI is of the form "createTopic.jsf?forumId=<n>" where <n> is an
> > > > integer corresponding to the forum's primary key in the database. I
> > > > have a backing bean mapped in faces-config to "CreateTopicBean", and
> > > > it is request scoped. Now, when the user submits the form to create
a
> > > > topic, what is the best way to let the bean know which forum this
> > > > topic should be created under? I tried having a managed property
like
> > > > this:
> > > >
> > > > <managed-bean>
> > > >
<managed-bean-name>CreateTopicBean</managed-bean-name>
> > > > <managed-bean-class>
> > > >
com.wepwnsnails.faces.managedbean.CreateTopicBean
> > > > </managed-bean-class>
> > > >
<managed-bean-scope>request</managed-bean-scope>
> > > > <managed-property>
> > > >
<property-name>forumId</property-name>
> > > > <value>#{param.forumId}</value>
> > > > </managed-property>
> > > > </managed-bean>
> > > >
> > > > but when the "action" attribute of the html <form> element rendered
by
> > > > JSF is simply "createTopic.jsf", so an EL exception is thrown when
JSF
> > > > fails to set the managed property.
> > > >
> > > > I've also tried adding a <h:inputHidden> tag set to the forumId on
the
> > > > backing bean in a variety of ways, but they leave much to be desired
> > > > as far as cleanliness.
> > > >
> > > > I'm sure that this is an issue every newbie JSF developer has
> > > > scratched his head over; so what's the best way to go about this?
I've
> > > > had a hard time finding anything in Google, mostly because I don't
> > > > know how to tersely phrase the problem for a seach query.
> > > >
> > > > Thanks a lot,
> > > > benjamin van der veen
> > > >
> > >
> >
>