cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Dropdownbox class?

Former Member
0 Kudos

Hello everybody,

I'm currently trying to set up a language switcher in SAPUI5 (http://scn.sap.com/thread/3271483), but have a problem with the apperance of my Dropdownbox.

The code looks like this:

 

 
  1. // Create a ListBox  
  2. var oListBox1 = new sap.ui.commons.ListBox("Languages", {  
  3.     items: [new sap.ui.core.ListItem("Lang1", {  
  4.         text: "German" 
  5.     }), new sap.ui.core.ListItem("Lang2", {  
  6.         text: "English" 
  7.     })]  
  8. });  
  9. // Create a DropdownBox  
  10. var oDropdownBox2 = new sap.ui.commons.DropdownBox("DropdownBox2", {  
  11.     tooltip: "Language",  
  12.         "association:listBox": oListBox1,  
  13.     value: "German" 
  14. });  

and my CSS looks like this:

.

sapUiTfComboIcon {  

position : absolute;  

display : inline;  

font-size : 15px;  

overflow : visible;  

margin-left : -15px;  

}  

.sapUiLbxI {  

list-style : none;  

}  

.sapUiLbx {  

box-sizing : border-box;  

border-bottom : #bfbfbf 1px solid;  

border-left : #bfbfbf 1px solid;  

padding-bottom : 0px;  

overflow-x : auto;  

overflow-y : auto;  

background-color : #FFFFFF;  

padding-left : 0px;  

padding-right : 0px;  

display : inline-block;  

white-space : nowrap;  

color : #000000;  

border-top : #bfbfbf 1px solid;  

cursor : default;  

border-right : #bfbfbf 1px solid;  

padding-top : 0px;  

border-radius : 0;  

Unfortunately now I have a white border around my text in the Dropdownbox.

When I add a global modifier in the CSS that sets margin : 0 and left-padding : 0, it looks good, however I'd rather like to address the Dropdownbox directly, but I haven't found a solution or this yet.

Does anyone of you know the right solution for this?

Also here are two screenshots that show the problem visually.

Thanks in advance for any ideas!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Problem solved.

I now used the standard gold_reflection theme and just overwrote the properties that I wanted to change, now it works great.

Former Member
0 Kudos

Hello, sorry to post my question here I couldn't find where can I add new thread.

I am using SAP B1 8.82.

In Business Partner Master Data (BPMS)  under "Contact Persons". I added new  "User defined fields" which shows for each contact person, it's drop down with values yes/no.

Q) Right now its default set to NO. Can I set that default to YES?

If its set to "Yes" I am default setting some accesses to users.

Thanks in advance.

Former Member
0 Kudos

Hello Rajani,

you can go here: http://scn.sap.com/community/bpm/business-workflow/content (should be the right section but I'm not 100% sure) and click on the "Create a discussion" link (only visible when you're logged in) to create a new discussion.

sid_sunny
Contributor
0 Kudos

Hi,

I am trying to achieve the same thing you have mentioned in the solution but not really able to see any difference in the UI. I have created a CSS in my root folder and I am including it in the index.html. I can see that the style class for the UI element does get change to something like <mystyle> <sap style> but the look and feel is still from the SAP Gold only.

Can you please suggest what I could be doing wrong.

Thanks

Sid

AndreasKunz
Advisor
Advisor
0 Kudos

Hi Sid,

please check

https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/ThemingFAQ.html

in particular the sections:

     "How can I provide additional CSS which is not overwritten by the UI5 CSS?"

and

     "I am adding a style class, but it does not work! Why?"

- usually this type of issues comes from CSS precedence rules: your style is there but some other style is considered more important by the browser.

Regards

Andreas

Answers (1)

Answers (1)

Former Member
0 Kudos

I found out that when I replace the global CSS with the the following lines, it works:

#Languages-list {

margin : 0;
padding-left : 0;
}

However this way I'm using an id selector as far as I know, which might not be the most flexible solutions to build up on, so if anyone can give me a hint about the class name, that'd be even better!