-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
Asked: 2014-03-21 00:19:32 +0800
Seen: 20 times
Last updated: Mar 21 '14