• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to pass an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to pass an object


  • Subject: Re: how to pass an object
  • From: Art Isbell <email@hidden>
  • Date: Wed, 7 Jan 2004 22:39:05 -1000

On Wednesday, January 7, 2004, at 09:32  PM, Kranthi Sagar Borra wrote:

This is my requirement :when the user clicks on a icon he should be able to view the image.I used WOActiveImage for this and asociated a method to the action.On click of this image the action method will be invoked.It is in this action method that I am firing the query to fetch the object.

I am confused by this. It sounds like you are clicking on a WOActiveImage to fire an action method that fetches the image bound to the WOActiveImage! Are you trying to have this WOActiveImage display an image from a file until it is clicked upon which its image should change to that fetched? Please clarify.


And now as you said I have done the following

String sqlQuery="select PictureObj from ProblemPicture where ProblemID = "+theProblem.getProblemID();
String result = query.getCellAsString(1,1);
NSData ImageBLOBData=new NSData(result);

NSData(String value) has been deprecated since WO 5.0. Instead, NSData(String value, String encoding) or NSData(byte[] bytes) should be used.


In the above code fragment, sqlQuery is defined but not used and query is referenced by not defined. I have no idea what query.getCellAsString(1,1) does. It seems odd that BLOB data would be returned as a String. Are you certain that the BLOB is being correctly returned in "result"?

I have mapped ImageBLOBData to data in WOActiveImage.but when I also specify the filename in WOActiveImage, both these fields are turning red but if I dont mention the filename then it saving without problems.I still compiled my application without giving the filename.

The image for a WOActiveImage must come from either a file or an NSData object, but not both. So the red fields are probably telling you that both "filename" and "data" cannot be bound.


but now when I click on the icon, the method is getting called as expected but I cannot see any image.

Have you bound "mimeType" to the correct type of image whose data are in the bound NSData object? WOActiveImage must be told how to interpret the binary data in the NSData object.


Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: RE: how to pass an object
  • Next by Date: WORepetition Woes
  • Previous by thread: RE: how to pass an object
  • Next by thread: WOJC Thread-Problem... makes me crazy
  • Index(es):
    • Date
    • Thread