webtier@glassfish.java.net

f:ajax pain

From: <webtier_at_javadesktop.org>
Date: Tue, 08 Jun 2010 11:36:19 PDT

I have a rather large form that I can't really break up for various reasons. I'm trying to submit a commandLink via ajax and my action is never getting called. I need to know if I'm going nuts.

Here's the command link.

<h:commandLink
    id="removeButton"
    styleClass="action-buttons"
    title="#{msgs.offer_exclusionRemove_title}"
    value="#{msgs.offer_exclusionRemove_label}"
    action="#{offerExclusionsHelper.removeExclusionAction}"
    rendered="#{cc.attrs.rendered and not cc.attrs.disabled}">
    <f:setPropertyActionListener target="#{offerExclusionsHelper.subjectDateSpec}" value="#{item.dateSpec}" />
    <f:setPropertyActionListener target="#{offerExclusionsHelper.subjectOffer}" value="#{cc.attrs.entity}" />
    <f:ajax execute="@this" render="@form :globalMessages"/>
</h:commandLink>

it's within a ui:repeat within a composite component if that makes any difference.

if I set the execute for f:ajax as @this then the ajax stuff occurs, and the form is re-rendered, but the action is never called, and neither are the property action listeners. I've temporarily removed the "required" attribute on other fields in the form so I know it's not a validation problem or anything.

If I set the execute for f:ajax as @form then my action is called, but I need to be able to do this without submitting the entire form. Notice I'm not submitting any inputText or any other input controls, just using the property action listeners to submit the values I need.

I'm hoping some wizard on this list will be able to give me some ideas because I've been fighting this all morning.

Thanks in advance,
Joel
[Message sent by forum member 'jweight']

http://forums.java.net/jive/thread.jspa?messageID=473392