Why would you use an f:param tag rather than using t:updateActionListener?

I didn't know updateActionListener existed. And frankly I don't really
see the difference. Before I used a f:param embedded in a
h:commandLink, now I use a t:updateActionListener embedded in a
h:commandLink but I get the same result. Perhaps I'm missing
something.

Are you somehow then expecting this parameter to continue to exist as
page B is submitted?

Well I somehow thought the "state" of the previous page would be
restored on validation failure. Maybe I should explain what I'm trying
to do. I have an entry which a user can add comments to, much like a
blog entry with user comments. When a user displays the entry a form
for comment submission is present.

To be able to display the entry I pass an entry id. The form I have
has a hidden component with the entry id used when saving the comment,
_but_ when validation fails the entry id is null despite the fact that
I use a hidden component. My guess is that it's set to null because
there is no parameter longer present (in my managed beans section I
set the id property with the parameter, perhaps this is wrong), which
would imply that parameters properties are set after post data
properties.

it may not be feasable in your situation, but I have used the tomahawk
sandbox form tag for a situation like this

Maybe the tomahawk sanbox form is a solution, but to me it seems like
this is a quite common thing to do and I strongly suspect, as stated
before, that I'm missing something obvious.

/Olof

On 1/8/07, Harlan Iverson <[EMAIL PROTECTED]> wrote:
it may not be feasable in your situation, but I have used the tomahawk
sandbox form tag for a situation like this (taking a restful URL and using
the value on a request scoped bean). it allows you to specify an action
attribute, which works like a normal html form. unfortunately you also have
to use tomahawk commandLink and possibly other tomahawk components.



On 1/8/07, Simon Kitching <[EMAIL PROTECTED]> wrote:
> Olof Næssén wrote:
> > Hello!
> >
> > I have a jsp page which is reached by using a commandLink with a
> > parameter. In the page I have a form with validation. If validation
> > fails, and the user is redirected back to the page, the parameter is
> > lost. Is this expected behavior? Is there a way around this?
>
> Hmm..you have page A which has a commandLink that encodes a URL for page
> B with a parameter?
>
> Why would you use an f:param tag rather than using t:updateActionListener?
>
> Anyway, in page B, obviously no validation is going to occur on first
> access, because this is not a "postback" to page B; this is simply a
> "first render" of the page. The special parameter value *will* be
> accessable at this point.
>
> Are you somehow then expecting this parameter to continue to exist as
> page B is submitted? It won't be. Instead, just copy it into the
> "backing bean" for page B on the first render...
>
> Regards,
>
> Simon
>
>


Reply via email to