a:mediaOutput is not compatible with a Seam long running conversation
Over the weekend I was working on a Seam project that required images to be uploaded so I took a look at the rich:fileUpload component. Looking at the RichFaces sample code it looked very straightforward and I assumed it would take just a couple of hours to implement. 2 days later I still couldn’t get it to work. I was so frustrated that I started questioning my intelligence. Fortunately I am stubborn, just ask my wife, and I refused to give up. This time it paid off. I finally found out via the Seam framework forums that the a:mediaOutput RichFaces component is not compatible with Seam long running conversations. The file was uploading fine and the listener method could see the object but when it came time for a:mediaOutput to paint the object to the screen it could not be found.
The solution was to simply add an s:conversationID component to a:mediaOutput so that Seam would know the conversation id. Once I added this everything worked fine. UGH! Below is an example.
1 2 3 4 5 6 | <a4j:mediaOutput element="img" mimeType="#{file.mime}" createContent="#{fileUploadBean.paint}" value="#{row}" style="width:100px; height:100px;" cacheable="false"> <f:param value="#{fileUploadBean.timeStamp}" name="time"/> <s:conversationId value="#{conversation.id}"/> </a4j:mediaOutput> |
These are the kind of things that drive me crazy when programming. Things like this can totally blow a schedule out of the water.










Charles July 13th
Thank you! You save my day! lol
Brian July 13th
Glad it helped Charles.
Betto Mcrose July 16th
and you save my week =D
Brian July 17th
Betto – Glad it saved your week because it cost me a week.
Betto McRose July 17th
I also found another tip
for the FileUploaderBean I had to set the scope to conversation because there were no other way to find the back bean
I know it sounds stupid, but in the examples I found there are no comments about, just looking at the exadel’s demo page (which is the fist plate to look at) you will see
any way… God/Alá/Buda/or whatever save Internet!
=D
Rodrigo Okada July 29th
Thank you!
Brian July 29th
You are welcome Rodrigo. Glad it helped you.
Add Yours
YOU