cancel
Showing results for 
Search instead for 
Did you mean: 

Image button URL

Former Member
0 Kudos

Hi,

I would like to know how to define an image button in Web Dynpro which link to a URL.

Thanks !

Patrick Cheung

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pravesh,

Thanks for the information !

However, where should I put the GIF file ? And how to insert the image once I have located the related iView ?

Thanks !

Patrick Cheung

pravesh_verma
Active Contributor
0 Kudos

Hi Patrick,

You have to place the image in following folder:

src -> mimes -> Components -> <i>(your_project_package_name)</i>, you directly go to Navigator and paste the images there. It will take the images it self.

You need not take care of inserting the image. It will directly take the path of the mime object. Just give the name of the image like: <b>abc.jpg</b>, which must be there in the specified folder. and it will display in the View as a link.

I hope this solves your problem.

Regards

Pravesh

Former Member
0 Kudos

Hi Pravesh,

Thanks very much for the solution !

Patrick

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have a similar problem, I need to link an Image to URL or an action and since the Image element doesn’t allow you to do that I tried using button or LinkToAction element , but the problem is that the Image is not showing when I pass the Image name to the ImageSource parameter even though the same Image is showing when used with Image element

Any suggestion

Former Member
0 Kudos

Are you sure you have used the exact same URL (including case) as for the Image element?

Armin

Former Member
0 Kudos

Hi

yeah I'm pretty sure

see the image

<a href="http://img237.imageshack.us/my.php?image=imageuk5.jpg">[IMG]http://img237.imageshack.us/img237/4004/imageuk5.th.jpg[/IMG]</a>

<a href="http://img181.imageshack.us/my.php?image=buttonnh6.jpg">[IMG]http://img181.imageshack.us/img181/1280/buttonnh6.th.jpg[/IMG]</a>

Former Member
0 Kudos

I got it this time..

it seems that I was doing it right in the first place

but it seems that an image in a button or in LinkToAction won't display in the layout so I only have to deploy and run and it will be shown

Armin , thanks for your reply

Regards

pravesh_verma
Active Contributor
0 Kudos

Hi Patrick,

Try and use this code for the image button:

IWDToolBarLinkToAction linkdown = (IWDToolBarLinkToAction)view.createElement(IWDToolBarLinkToAction.class,null);
		linkdown.setImageSource("//image_path");
		linkdown.setTooltip("set the Tool tip!!");
		IWDAction linkclickdown = wdThis.wdCreateAction(IPrivatePlugFDTView.WDActionEventHandler.MAP_ACTION,"");
		linkdown.setOnAction(linkclickdown);

After this add this <b>linkdown</b> variable to the table object. [ie: tb.addToolBarItem(linkdown)], like this, where tb =

IWDToolBar tb  = (IWDToolBar)view.createElement(IWDToolBar.class,null);

I hope this helps you and solves your problem

Regards

Pravesh

PS: Please consider rewarding points if helpful and solved.

Former Member
0 Kudos

Pravesh,

- Why do you propose to create a

ToolBar

LinkToAction?

- Why do you write this code in wdDoModifyView()?

- Why do you create the action programmatically?

Fragen über Fragen...

Armin

pravesh_verma
Active Contributor
0 Kudos

Hi Armin,

I didnt get any of your question!!

Well I would have suggested him the to create a

LinkToAction

only, but it was just that I have the code for the ToolBarLinkToAction so I posted it, without knowing whether he actually need the LinkToAction in Table or not.. I should have confirmed that

>>Fragen über Fragen...

What does this mean?? Kindly translate it in Engish.

Regards

Pravesh

Former Member
0 Kudos

"Fragen über Fragen" means something like "So many questions". Don't worry about that

I think a better proposal would have been:

Use LinkToAction, put the image into src/mimes/components/ and set LinkToAction.imageSource to the image file name.

No need for any manual coding.

Armin