0

show on image component blob image

asked 2014-03-21 00:19:32 +0800

vljc2004 gravatar image vljc2004
1 2

updated 2014-03-21 12:17:57 +0800

Hi,

I´m need show a image on image that is a Blob . I´m have a table when yo do click on data open an window and in this window I need show a image.

Controller

public class ...

public final void doAfterCompose(final Component comp) throws Exception {

 .... do actions to load data into table
 .... listener table

 @Override
 public final void onEvent(final Event event) throws Exception {
  //Load object with data like name, type and BLOB IMAGE
  final MyEmp me = (MyEmp) empList.getData();
  //Private method to send information to view
  mData(emp);
 }
}
 private void mData(final MyEmp me) throws IOException {

    final Map<String,Object> args = new HashMap<String,Object>();

    // Get from object
    byte[] data = me.getImage();
    // Convert to image
    AImage img = new AImage("img.jpg", data);
    System.out.println( img.getName()+" "+img.getHeight() );

    //Map to send view
    args.put("test", me);
    // I´m tryng with img, img.getName(), img.getStringData()
    args.put("myimg",img );
    //special method to open window
    oWind("/ct/edit.zul","Edit", args,
                MODAL);
    }

My view edit.zul

<row>
  <cell colspan="2">
   <image id="logo" src="@{winEditEmp$composer.myimg}" />
  </cell>
</row>

Every data is load fine except my image, only show me the path class controller.

If I´m review the header information on browser show this:

Request    URL:...localhost/mytestsite/com.mytestsite.controller.MyController@99a39f
Request Method:GET
Status Code:404 Not Found
Request Headersview source
Accept:image/webp,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-03-21 00:19:32 +0800

Seen: 19 times

Last updated: Mar 21 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More