cancel
Showing results for 
Search instead for 
Did you mean: 

Create a button with image

Former Member
0 Kudos

I create a new button and set imageSource property with my image name (saved in mimes/components/<mycomponent>...).

The problem is that button don't display image.

If i try to use the same pic like image element it's all ok.

Someone has the same problem?

Thanks

Andrea

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please run and test the application.It should show the image during runtime.

Regards, Anilkumar

Former Member
0 Kudos

yes it show the image during runtime...

thank you very much.

Former Member
0 Kudos

If the image does not appear in the design time preview, open an OSS message.

Armin

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi!

I've met the same problem, but with a little bit another appearance:

- my gif files are saved in mimes/components/<component>

- when I do DC build locally (context menu DevComponent/Build)

- and then deploy (again context menu DevComponent/Deploy)

it works - images are shown in runtime.

I see .ear file (and wda inside ear), which contains my gif files in appropriate location.

Structure is (starting from root of wda):

- Applications

....<application> (empty folder)

- ComponentInterfaces

- Components

....<component>

........gif files

- PORTAL-INF

....folders (classes, lib, ...)

....webdynpro

........Applications

............<application>

................<application>.xml

........ComponentInterfaces

........Components

............<component>

................<component>.xml - no gif files in the folder

However when I download build result from CBS, the wda file has different structure - the only top level folder is "PORTAL-INF" and inside there are no gif files.

Correspondingly, when I deploy SCA, generated by CMS, the images are missing.

What should I do that server build will be similar to local build? I.e. how to bring "Components" top-level folder back in wda, when it's built by CBS?

Note: The problem appeared after upgrade from SP10 to SP12.

Any ideas?

Best regards,

Nick

Former Member
0 Kudos

Perhaps you made an error when setting the imageSource-Property. Try to bind both, Button.imageSource and Image.source to the same context attribute and set the value there, does the error disappear?

For image-only buttons, you might also use an LinkToAction.

Armin

Former Member
0 Kudos

I try to use a very small gif image, but the problem is the same.

If i create a LinkToAction element i don't see image like in button element.

Can I create an image like a context attribute?

thanks

Andrea

Former Member
0 Kudos

hi andrea,

well you have put the image the right folder. check its size as small size image are not displayed.

in my application jpg image of size 2k,8k and 46 kb are not displayed but if i use a image of 86 kb, it show the image.

try bigger image and write <image>.jpg in imageSource property.it'll show the image over button but button increase in size

Rgds,

Vilish

Former Member
0 Kudos

Use a view context attribute of type "string", set it's value to "image.gif" or whatever, bind the imageSource or source-properties of the Button, Image and LinkToAction to the context attribute. Then all UI elements will show the same image.

Armin

Former Member
0 Kudos

Try with .gif files.

Regards, Anilkumar

Former Member
0 Kudos

Check the file extension as said above and the imagesource property should be given the value <filename>.<extension>.

i.e

Check the property is correct

Check that the image is not of very big size.