DmiN
DmiN

Reputation: 786

rich:fileUpload submits whole form

Consider this snippet of code, which relies on JSF2 with RichFaces 4.5.0 as a used component library.

// some non-relevant attributes are omitted    
<rich:fileUpload fileUploadListener="#{bean.uploadListener}">
      <a4j:ajax event="uploadcomplete" render="imagePanel" immediate="true" />
</rich:fileUpload>

The given tag within a form submits the whole form. For instance, this is not the expected behaviour for me. I'd prefer that the component submits only the form properties of itself and skips the other form values within the same form, like ajaxSingle in RichFaces 3.

I did some research on this topic but did not find any conclusion how to manage the partial form submit for the fileUpload component, especially because there is no execute attribute for this tag, like in several other jsf ajax components.

I would appreciate any help on this case, especially how to manage that the fileUpload component only submits its own form values to the server.

Upvotes: 1

Views: 836

Answers (1)

fonkap
fonkap

Reputation: 2509

Try execute attribute of a4j:ajax.

From docs:

execute: Ids of components that will participate in the "execute" portion of the Request Processing Lifecycle. Can be a single id, a space or comma separated list of Id's, or an EL Expression evaluating to an array or Collection. Any of the keywords "@this", "@form", "@all", "@none", "@region" may be specified in the identifier list. Some components make use of additional keywords

I think that is exactly what you need.

More info: Richfaces docs

Upvotes: 1

Related Questions