私は使用<rich:fileupload>
していますが、コントローラーにいくつかの追加パラメーターを送信する必要があります。これに使っ<f:param>
てみました。
ビューは次のとおりです。
<rich:fileUpload
fileUploadListener="#{fileUploadController.listener}"
maxFilesQuantity="#{fileUploadController.uploadsAvailable}"
addControlLabel="Hinzufügen"
uploadControlLabel="Hochladen"
cancelEntryControlLabel="Abbrechen"
doneLabel="Fertig"
clearAllControlLabel="Alle entfernen"
noDuplicate="true"
stopControlLabel="Stop"
clearControlLabel="Entfernen"
id="upload"
immediateUpload="#{fileUploadController.autoUpload}"
ajaxSingle="true"
acceptedTypes="jpg"
allowFlash="#{fileUploadController.useFlash}"
rerender="info">
<a4j:support event="onuploadcomplete" reRender="info" status="globalStatus" />
<f:param
value="#{imageFormat}"
name="#{fileUploadController.imageFormat}"/>
</rich:fileUpload>
これがFileUploadController
バッキングBeanです。
private String imageFormat;
public void setImageFormat(String imageFormat) {
this.imageFormat = imageFormat;
}
public String getImageFormat() {
return imageFormat;
}
ただし、セッターが呼び出されることはないため、変数は常にnull
です。は#{imageFormat}
正しい値です。で確認しました<h:outputText>
。
<a4j:param>
引っ掛けるボタンがないので使えません。
JSF2.0ではなくJSF1.2を使用しています。