hello out there,
i can`t figure it out how the new canvas api replaces anchorWithDocument. i want to write a document that first uploads a file and display an anchor to it after uploaded. html form multipart; with: [ html bold: 'Load version from file: '. html break. html fileUpload callback: [:f | file _ f]. html space. html submitButton callback: [self save]; text: 'Load'. ]. file ifNotNil: [ html anchor; url: ??file urlFromFile??]. could anyone point me in the right direction? thanks a lot! _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Martin,
I believe you are looking for something like html anchor document: file contents; mimeType: file mimeType; fileName: file name; text: shortName Kind regards, Mart-Mari -----Original Message----- From: Martin Schubert [mailto:[hidden email]] Sent: 01 September 2006 03:38 nm To: The Squeak Enterprise Aubergines Server - general discussion. Subject: [Seaside] new canvas replacement for #anchorWIthDocument: searched hello out there, i can`t figure it out how the new canvas api replaces anchorWithDocument. i want to write a document that first uploads a file and display an anchor to it after uploaded. html form multipart; with: [ html bold: 'Load version from file: '. html break. html fileUpload callback: [:f | file _ f]. html space. html submitButton callback: [self save]; text: 'Load'. ]. file ifNotNil: [ html anchor; url: ??file urlFromFile??]. could anyone point me in the right direction? thanks a lot! _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
hello Mart-Mari,
thanks for your quick reply : when i insert your code i got the follwowing error : WAAnchorTag(Object)>>doesNotUnderstand: #document: so WAAnchorTag does not understand these messages. ... any idea? Mart-Mari Breedt schrieb: > Hi Martin, > > I believe you are looking for something like > > html anchor > document: file contents; > mimeType: file mimeType; > fileName: file name; > text: shortName > > Kind regards, > > Mart-Mari > > -----Original Message----- > From: Martin Schubert [mailto:[hidden email]] > Sent: 01 September 2006 03:38 nm > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: [Seaside] new canvas replacement for #anchorWIthDocument: > searched > > hello out there, > i can`t figure it out how the new canvas api replaces > anchorWithDocument. > i want to write a document that first uploads a file and display an > anchor to it after uploaded. > > html form > multipart; > with: [ > html bold: 'Load version from file: '. > html break. > html fileUpload callback: [:f | file _ f]. > html space. > html submitButton callback: [self save]; text: 'Load'. > ]. > > file ifNotNil: [ > html anchor; > url: ??file urlFromFile??]. > > could anyone point me in the right direction? thanks a lot! > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Mart-Mari Breedt
Hello Mart-Mari Breedt,
thanks for quick reply. unfortunatelly this does`t work at all. ithis is my last version which serves a link to the file contents. but the mimeType is not available. does anybody know how to attach a mimeType or wrap a binary file with mimeType in an objects instance (class variable)? > Hi Martin, > > I believe you are looking for something like > > html anchor > document: file contents; > mimeType: file mimeType; > fileName: file name; > text: shortName > > Kind regards, > > Mart-Mari > > -----Original Message----- > From: Martin Schubert [mailto:[hidden email]] > Sent: 01 September 2006 03:38 nm > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: [Seaside] new canvas replacement for #anchorWIthDocument: > searched > > hello out there, > i can`t figure it out how the new canvas api replaces > anchorWithDocument. > i want to write a document that first uploads a file and display an > anchor to it after uploaded. > > html form > multipart; > with: [ > html bold: 'Load version from file: '. > html break. > html fileUpload callback: [:f | file _ f]. > html space. > html submitButton callback: [self save]; text: 'Load'. > ]. > > file ifNotNil: [ > html anchor; > url: ??file urlFromFile??]. > > could anyone point me in the right direction? thanks a lot! > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Martin Schubert
Hallo Martin,
Sorry about this, I tested this myself, and you are right, it doesn't work. I will investigate a bit and see if I can find another solution. About the mimeType. I normally do something like this: file := FileStream readOnlyFileNamed: fileName. mimeType := file mimeType. Hope this can help. Kind regards, Mart-Mari -----Original Message----- From: Martin Schubert [mailto:[hidden email]] Sent: 01 September 2006 06:58 nm To: The Squeak Enterprise Aubergines Server - general discussion. Subject: Re: [Seaside] new canvas replacement for #anchorWIthDocument: searched Hello Mart-Mari Breedt, thanks for quick reply. unfortunatelly this does`t work at all. ithis is my last version which serves a link to the file contents. but the mimeType is not available. does anybody know how to attach a mimeType or wrap a binary file with mimeType in an objects instance (class variable)? > Hi Martin, > > I believe you are looking for something like > > html anchor > document: file contents; > mimeType: file mimeType; > fileName: file name; > text: shortName > > Kind regards, > > Mart-Mari > > -----Original Message----- > From: Martin Schubert [mailto:[hidden email]] > Sent: 01 September 2006 03:38 nm > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: [Seaside] new canvas replacement for #anchorWIthDocument: > searched > > hello out there, > i can`t figure it out how the new canvas api replaces > anchorWithDocument. > i want to write a document that first uploads a file and display an > anchor to it after uploaded. > > html form > multipart; > with: [ > html bold: 'Load version from file: '. > html break. > html fileUpload callback: [:f | file _ f]. > html space. > html submitButton callback: [self save]; text: 'Load'. > ]. > > file ifNotNil: [ > html anchor; > url: ??file urlFromFile??]. > > could anyone point me in the right direction? thanks a lot! > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Martin Schubert
Hallo Martin,
You can try the #anchorWithDocument in the render canvas like this: html anchor attributeAt: 'href' put: (html context urlForDocument: file contents mimeType: file mimeType fileName: file name); text: 'Click for file'. This is not the neatest way of doing it since it is only an adaption of the original #anchorWithDocument:..., but you can maybe write your own extention to WAAnchorTag to allow for this behaviour. Or perhaps someone else knows of an even better way of implementing this? Thank you, Mart-Mari -----Original Message----- From: Mart-Mari Breedt Sent: 04 September 2006 07:26 To: The Squeak Enterprise Aubergines Server - general discussion. Subject: RE: [Seaside] new canvas replacement for #anchorWIthDocument: searched Hallo Martin, Sorry about this, I tested this myself, and you are right, it doesn't work. I will investigate a bit and see if I can find another solution. About the mimeType. I normally do something like this: file := FileStream readOnlyFileNamed: fileName. mimeType := file mimeType. Hope this can help. Kind regards, Mart-Mari -----Original Message----- From: Martin Schubert [mailto:[hidden email]] Sent: 01 September 2006 06:58 nm To: The Squeak Enterprise Aubergines Server - general discussion. Subject: Re: [Seaside] new canvas replacement for #anchorWIthDocument: searched Hello Mart-Mari Breedt, thanks for quick reply. unfortunatelly this does`t work at all. ithis is my last version which serves a link to the file contents. but the mimeType is not available. does anybody know how to attach a mimeType or wrap a binary file with mimeType in an objects instance (class variable)? > Hi Martin, > > I believe you are looking for something like > > html anchor > document: file contents; > mimeType: file mimeType; > fileName: file name; > text: shortName > > Kind regards, > > Mart-Mari > > -----Original Message----- > From: Martin Schubert [mailto:[hidden email]] > Sent: 01 September 2006 03:38 nm > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: [Seaside] new canvas replacement for #anchorWIthDocument: > searched > > hello out there, > i can`t figure it out how the new canvas api replaces > anchorWithDocument. > i want to write a document that first uploads a file and display an > anchor to it after uploaded. > > html form > multipart; > with: [ > html bold: 'Load version from file: '. > html break. > html fileUpload callback: [:f | file _ f]. > html space. > html submitButton callback: [self save]; text: 'Load'. > ]. > > file ifNotNil: [ > html anchor; > url: ??file urlFromFile??]. > > could anyone point me in the right direction? thanks a lot! > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hello Mart-Mari,
thanks for your hint, especially for getting the url to a document sitting in a object : html context urlForDocument: ....... i finally extended the MIMEDocument to MyMIMEDocument to remember the file`s name : renderContentOn: html html form multipart; with:[ html fileUpload callback: [:f | file := MyMIMEDocument contentType: f contentType content: f contents fileName: f fileName]. html submitButton callback: []; text: 'Load'. ]. file ifNotNil: [ Transcript show: file. html anchor url: (html context urlForDocument: file contents mimeType: file mimeType fileName: file fileName ); text: file fileName. ] this finally can manage most of the mimeTpyes i need to work with. thanks a lot! > Hallo Martin, > > You can try the #anchorWithDocument in the render canvas like this: > > html anchor > attributeAt: 'href' > put: (html context urlForDocument: file contents mimeType: file > mimeType fileName: file name); > text: 'Click for file'. > > This is not the neatest way of doing it since it is only an adaption of > the original #anchorWithDocument:..., but you can maybe write your own > extention to WAAnchorTag to allow for this behaviour. Or perhaps someone > else knows of an even better way of implementing this? > > Thank you, > > Mart-Mari > > -----Original Message----- > From: Mart-Mari Breedt > Sent: 04 September 2006 07:26 > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: RE: [Seaside] new canvas replacement for #anchorWIthDocument: > searched > > Hallo Martin, > > Sorry about this, I tested this myself, and you are right, it doesn't > work. I will investigate a bit and see if I can find another solution. > > About the mimeType. I normally do something like this: > > file := FileStream readOnlyFileNamed: fileName. > mimeType := file mimeType. > > Hope this can help. > > Kind regards, > > Mart-Mari > > -----Original Message----- > From: Martin Schubert [mailto:[hidden email]] > Sent: 01 September 2006 06:58 nm > To: The Squeak Enterprise Aubergines Server - general discussion. > Subject: Re: [Seaside] new canvas replacement for #anchorWIthDocument: > searched > > Hello Mart-Mari Breedt, > thanks for quick reply. > > unfortunatelly this does`t work at all. > ithis is my last version which serves a link to the file contents. but > the mimeType is not available. > does anybody know how to attach a mimeType or wrap a binary file with > mimeType in an objects instance (class variable)? > > >> Hi Martin, >> >> I believe you are looking for something like >> >> html anchor >> document: file contents; >> mimeType: file mimeType; >> fileName: file name; >> text: shortName >> >> Kind regards, >> >> Mart-Mari >> >> -----Original Message----- >> From: Martin Schubert [mailto:[hidden email]] >> Sent: 01 September 2006 03:38 nm >> To: The Squeak Enterprise Aubergines Server - general discussion. >> Subject: [Seaside] new canvas replacement for #anchorWIthDocument: >> searched >> >> hello out there, >> i can`t figure it out how the new canvas api replaces >> anchorWithDocument. >> i want to write a document that first uploads a file and display an >> anchor to it after uploaded. >> >> html form >> multipart; >> with: [ >> html bold: 'Load version from file: '. >> html break. >> html fileUpload callback: [:f | file _ f]. >> html space. >> html submitButton callback: [self save]; text: 'Load'. >> ]. >> >> file ifNotNil: [ >> html anchor; >> url: ??file urlFromFile??]. >> >> could anyone point me in the right direction? thanks a lot! >> _______________________________________________ >> Seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> >> _______________________________________________ >> Seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> >> >> > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ > Seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |