tags:

views:

335

answers:

2

Hi!

I have such structure in my jsp:

<h:commandLink action=#{docbean.save}>
    <a4j:actionParam name="somename" value="bill_all" assignTo="#{billdoc.billType}"/>
    <a4j:actionParam name="somename" value="bill_document" assignTo="#{docbean.doctype}"/>
</h:commandLink>

While debugging i saw, that billdoc.billtype and docbean.doctype have the same values: "bill_document".

Is it bug? If not, then how can i put value to my managed-bean?

UPDATED:

Found the answer:

I had two actionParams with one name. ActionParam is f:actionListener + f:param. So, if you have several actionparams with one name, you will have the problem i had. RichFaces and JSF doesn't warn you about it.

+1  A: 

First, you need a space here <a4j:actionParamvalue - before value

Second, You may try this instead of <a4j:actionParam>:

<f:setPropertyActionListener value="bill_all" target="#{billdoc.billType}" />

You may need to put immediate="true" on your commandLink if there are validation errors in your form. You can view these errors by adding <rich:messages /> ontop of the page.

Bozho
I tried replace <a4j:actionParam> with <f:setPropertyActionListener>, but nothing happens. Form is submitted, bet action does not execute. Maybe <f:setPropertyActionListener> is not allowed inside <h:commandLink>?
Yurish
@Yurish - it is allowed. Check your logs and check my update.
Bozho
Solved. See updated post.
Yurish
A: 

Try using an a4j:commandLink. Or - if you stick to h:commandLink - try embedding your a4j:actionParams in an a4j:support tag.

David