This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem while creating RichFaces FileUpload component in Java code  RSS feed

 
Hemant
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I want to generate Richfaces FileUpload on server side by java code and bind it in page. But I am not able to set the action method which get called when user uploads file through FileUpload.

This is what I did in my code,

HtmlFileUpload artattribComponentType = new HtmlFileUpload();
artattribComponentType.setId("testfileUpload");
artattribComponentType.setListWidth("150");
artattribComponentType.setListHeight("40");
// artattribComponentType.setAddControlLabel("Upload");
artattribComponentType.setMaxFilesQuantity(5);
artattribComponentType.setImmediateUpload(true);


artattribComponentType.setValueExpression("altValue", altExpression);
//This is Important
MethodBinding action = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{massProductOrderGrid.uploadListener(fileUpload_" + idCnt + "_" + attribCount + ")}", new Class[] {});
artattribComponentType.setFileUploadListener(action);

By above code I am able to display RichFileUpload on page.

In Rich File upload there is one FileuploadListener method which get called when we upload the Image with the parameter as UploadEvent, but when
I am building the FileUpload on server, how do I set the UploadEvent of the uploadedd file.

My question is how do I set the UploadEvent of uploaded image in my fileListener method. Form that event I can get the Information abt uploaded file

Can anyone please guide me here what am I doing wrong?
Am I missing something obvious here?

Thanks and appreciate your response...
Hemant
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!