cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Webdynpro ViewSwitch

former_member182048
Active Contributor
0 Kudos

Hi,

How do i add an icon to a viewswitch line entry

the documentation suggests

'See also Handling Web Icons' but i cannot determine how.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182048
Active Contributor
0 Kudos

I think i should rephrase the question.

I have a 'ViewSwitch' pattern in my application.

I want to add an ICON that corresponds to the text for each entry.

see for ViewSwitch properties

http://help.sap.com/saphelp_nw04s/helpdata/en/7c/1fae42e0fac911e10000000a1550b0/frameset.htm

The documentation eludes that it may be possible to link an ICON in via the ItemSource dynamically - currently this bound to a context node, my question is how can i maintain the context node and add icons?

thomas_szcs
Active Contributor
0 Kudos

Hi Jasper,

I just checked it. In NW2004s, having icons inside of a view switch item is not supported. The next release will support this though...

Best regards,

Thomas

former_member182048
Active Contributor
0 Kudos

Thanks,

nothing possible now, like embedding html tags for a graphic in the Text or is there an extension interface like a BSP Bee

thomas_szcs
Active Contributor
0 Kudos

Hi Jasper,

It is not possible to create your own ui elements or render your own HTML within Web Dynpro.

Best regards,

Thomas

Answers (5)

Answers (5)

0 Kudos

Does anybody know how to use this UI element? The property itemSource is required to be bound to a context node. But after this...what do you do?

If you need three view switches, do you create three view switches in your contextual panel? Or is this context node and its elements somehow connected to the number view switches?

Any help ASAP is welcomed.

former_member182048
Active Contributor
0 Kudos

Hey mate

I think there is a couple of ways to use it from memory, my solution was one view switch under a contextual panel, the view switch was bound to a node in the context, this node has an attribute which supplies the text (for each entry it creates a switch) and another attribute to determine whether or not it is enabled. I used a supply function to populate node at runtime.

Take a look at WDR_TEST_EVENTS ->Template ->Contextual panel, for a simple example.

alternatively you can do a where used on CL_WD_VIEW_SWITCH and you will see different applications.

Hope this helps

thomas_szcs
Active Contributor
0 Kudos

Hi Christopher,

>Does anybody know how to use this UI element? The

>property itemSource is required to be bound to a context

>node. But after this...what do you do?

The view switch has as many entries as there are elements in the corresponding context node. Bind itemText to an attribute of this node and provide a different value for each element. Bind the onSelect to an action and switch the tabs inside once a user clicked at a bar. The currently selected bar is the one for which the correspondong context element has a leadSelection.

>If you need three view switches, do you create three

>view switches in your contextual panel? Or is this

>context node and its elements somehow connected to the

>number view switches?

Usually, a single view switch is enough. The number of bars is determined by the number of context elements in the corresponding node. Of course, you could have multiple view switches, but then you need multiple nodes as well.

Best regards,

Thomas

Former Member
0 Kudos

Hi,

I'll update the documentation about the ViewSwitch properties accordingly, for SPS9.

Regards, Heidi

former_member182048
Active Contributor
0 Kudos

I think i should rephrase the question.

I have a 'ViewSwitch' pattern in my application.

I want to add an ICON that corresponds to the item text for each entry.

see the following for the viewswitch properies

http://help.sap.com/saphelp_nw04s/helpdata/en/7c/1fae42e0fac911e10000000a1550b0/frameset.htm

this document suggests it is possible on the ITEM SOURCE - this seems to require a context node only - what do i have to do to add the ICONS

Former Member
0 Kudos
thomas_szcs
Active Contributor
0 Kudos

Hi Jasper,

There is a property called itemIcon. You can specify the name of the icon here (e.g. ICON_DUMMY) or an URL to an image of your choice. There many different notations possible for icons (and URLs in general). The full list can be found inside of the online help.

Best regards,

Thomas