0

Access a static resource from a component on the client site

asked 2011-06-29 14:05:43 +0800

steffenf gravatar image steffenf
15

I'm developing a component. Now my widget need the URI to an image. The image is stored in the component JAR file: /web/stfo/comp/img/image.png. How can the widget compute the URI?

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-06-29 15:00:56 +0800

myzkdemo gravatar image myzkdemo
154 3

Hi steffen,

if the jar file is in your web application folder try this:

<zk>
<button image="~./zul/img/breeze/menu/btn-arrow.gif"/>
</zk>

The example has button with an image loaded from the breeze.jar which is avaliable in ...WEB-INF/lib of the web application.

Maybe you should us the address: ~./web/stfo/comp/img/image.png but I'm not sure.

regards,
Gunter

link publish delete flag offensive edit

answered 2011-07-01 12:41:50 +0800

steffenf gravatar image steffenf
15

Hi Gunter

I think your solution works for a ZUML file. But I need the encoded URI into the Widget JavaScript file of my custom component. Do you have any suggestion for this problem?

Thanks,
Steffen

link publish delete flag offensive edit

answered 2011-07-01 12:47:28 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

You can use

uriToImage = zk.ajaxURI("/web/stfo/comp/img/image.png", {au : true, ignoreSession : true});

in your JavaScript-widget.

Cheers, Maik

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2011-06-29 14:05:43 +0800

Seen: 184 times

Last updated: Jul 01 '11

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