Thank you both for your responses. Malcolm, my case is a rapid dev intranet application (quick and dirty for now) so I can trust the users (hey what trust a user!?#@). I think it would be ideal to let the developer decide the fate of things...can the user upload certain mime tyes, file sizes etc. At the end of it the lazy programmers dream would be to have file uploads link in to Cayenne or Hibernate et al. without too much work. (Too much to ask? :) ) Bob, thanks. My first test using your code worked, debugger tripped over "getFileItem().get();" and the values were inserted into DB. So from that I could sure apply the mime type, file size logic validations. When would "getFileItem()" not be null?
Oh a lot to learn for me as usual, I'll get more into this next week. As an aside...before I had done too much in Click I easily implemented a SearchFormTablePage using a custom CayenneSearchForm extending the FormTable work already there. Both still under development but quick and easy to extend your work to provide even more power with a search form. I hope to submit something on this when it has been a little more developed. Cheers, Steve 2009/7/31 sabob <[email protected]> > > > sabob wrote: > > > > > > I think we should enhance FileField to better handle this mapping. One > > issue > > might be that blobs uses byte[] or InputStream while clobs uses char[] or > > Reader. Perhaps we should change FileField so one can specify the type of > > the > > data, ala HiddenField. > > > > > > Then again such a change might create confusion because by default > FileField.getValueObject returns the value of the field, in this case the > name > of the file that was uploaded, not the *content* of the file. > > bob > > > Steve Wells wrote: > > Hi all, > > > > I've only just begun using Click and so far it looks like a winner, well > > done guys on a simple and effective framework. Finally things are > > starting to look they way they should for the end-user developer! It > > takes me way back to my Delphi days. > > > > As a Cayenne user one of the most appealing facets was the slick > > integration between the 2 frameworks. > > > > I have hit my first snag trying to use a FileField that links > > automagically to a Cayenne object field of type byte[] (db is BLOB). > > The field displays fine but as it is a Cayenne mandatory the commit > > fails with a Cayenne validation exception; it looks like the screen > > field is not wired to the Cayenne field. > > > > Is my approach wrong? > > > > Thank you, > > > > Steve > > > > > > > > > > > -- > View this message in context: > http://n2.nabble.com/CayenneForm-and-FileField-tp3359910p3361110.html > Sent from the click-user mailing list archive at Nabble.com. >
