On 2010-07-23, at 2:38 PM, Andrew R. Kinnie wrote: > > On Jul 23, 2010, at 1:19 PM, David LeBer wrote: > >> >> Well that will update an ajax update container with the id >> 'attachmentUploadContainer' > > Well that clears that much up. Unfortunately, this didn't actually solve > anything. > >> >>> Also, I don't know where the default css is. >> >> Because ERAttachmentFlexibleUpload is based on AjaxFlexibleFileUpload the >> default css is in the Ajax framework: default_ajaxupload.css > > Thanks. I didn't even think of that. I'll look there. > >> >>> The main problem is that when I delete an attachment (by setting it to null >>> in the communication's edit component), then I want to add another >>> attachment, the old filename appears, with a clear link below it. I have >>> no idea why that is, or where that is happening. >> >> It is not clear what you are doing here. How and where are you deleting the >> attachment again? > > Basically, I have an edit component which contains the AjaxModalDialog > containing the subcomponent with the Flexible Uploader > > The edit component edits the communication in general, and as part of that, > the user can attach up to 5 files. These appear in an inline worepetition > with a close button. Clicking close tells the attachment represented by that > index to be set to null. e.g. click the close button for attachment1 sends > communcation.setAttachment1(null)
Are you ever actually deleting the Attachment? Wouldn't this leave one dangling? > > There are also links at the end of the repetition to add more attachments. > Clicking one opens the AjaxModalDialog containing the subcomponent with the > ERAttachmentFlexibleUploader. > > The first time you click "Add File" the dialog appears with the choose file > button reflected as a shrunken version of my standard "prettyButton" . . . > presumably it's shrunken because of something in the CSS. Once you choose a > file, it's uploaded and it appears with a red "x" close button. Presumably > also in the CSS. (I originally didn't set the choose button class and got a > blue "choose" button which apparently didn't have a grey background, so the > corners are a little weird. Hence I tried to use our button class) > > After you upload a file, and click my "Attach" button (which simply sets the > attachmentItem into the first available spot for the communication's > attachments -- e.g. communication().setAttachment1(attachmentItem). This > appears to work. The dialog goes away and the attachment appears. > > If you click our close button for it, it disappears. Then if you click > attach files again, the old attachment's filename appears, with a "Clear" > link under it. > > I'd rather have it just open an empty one uploader with a default button > instead of a clear link. > > Sorry I wasn't clearer earlier, Dave A was harassing me to go to lunch. I > can't disappoint Dave. Hmm. The ERAttachmentFlexibleUpload/AjaxFlexibleFileUpload cache the filename as their default behaviour. My brain is farting right now and I cannot think of a simple way to get them to reset that value when the AMD opens. There is a binding that will bypass the showing of the uploaded file name and clear button: 'clearUploadProgressOnSuccess' - it defaults to false. However with this set, there will be no indication of what file you uploaded, the uploader will revert to a select button. You can look at ERAttachmentFlexibleEditor as an example of how to setup a view/upload/replace workflow with these components. You could possibly set that binding and have the success function of the uploader close the AjaxModalDialog. > >> >> Have you looked at using ERAttachmentFlexibleEditor? It uploading adding >> *and* removing/replacing attachments. > > I was originally looking at using the editor, but they actively didn't want > to see the uploaded file (dunno why) so I went back to the Flexible Uploader. > > I will look at the other things you mentioned, and hopefully that will > explain things better for me > ;david -- David LeBer Codeferous Software 'co-def-er-ous' adj. Literally 'code-bearing' site: http://codeferous.com blog: http://davidleber.net profile: http://www.linkedin.com/in/davidleber twitter: http://twitter.com/rebeld -- Toronto Area Cocoa / WebObjects developers group: http://tacow.org _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
