cancel
Showing results for 
Search instead for 
Did you mean: 

Image Button click?

Former Member
0 Kudos

I would like have a row of image buttons in my view.

But normal buttons do not have the possibility to add an image in stead of text.

So I put images on my view. Now the layout is fine, but the image element do not have an OnClick...

Is this impossible?

Accepted Solutions (1)

Accepted Solutions (1)

sridhar_k2
Active Contributor
0 Kudos

Hi,

You Can add images to buttons.

IWDButton modify = (IWDButton) view.getElement("Modify");

if (modify != null) {

modify.setImageSource("edit.gif");

}

//copy this image(edit.gif) in the project -> src -> mimes -> components.

Regards,

Sridhar

Former Member
0 Kudos

> Hi,

>

> You Can add images to buttons.

> IWDButton modify = (IWDButton)

> view.getElement("Modify");

> if (modify != null) {

> modify.setImageSource("edit.gif");

> }

> //copy this image(edit.gif) in the project -> src ->

> mimes -> components.

>

> Regards,

> Sridhar

Perfect...thanks for sharing!

BK

Answers (4)

Answers (4)

Former Member
0 Kudos

LinkToAction is working fine.

I put the images in that mime..etc directory.

They are properly shown when I deploy and run the program, but the Developer Studio can't find them.

Not a big problem, but it would be nice to see them in the designer.

Former Member
0 Kudos

Normal buttons have also the possibility to add an image, but you will see the button border which may look ugly. For image-only buttons, you can use LinkToAction.

Armin

Former Member
0 Kudos

Hi

See this thread

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

There is no onAction for Image UI Element. so you can use LinkToAction UI Element and set the imageSource property with the image file name. You need not to set the text property so it will show only the image. In the onAction event you can write your code.

regards

karthik