cancel
Showing results for 
Search instead for 
Did you mean: 

CSS For Dynamic Text Box

sluglover
Explorer
0 Kudos

I am populating an empty textbox on a popup when one of my table widgets has new members added to it. The styling I have for the text doesn't seem to apply though. I am attempting this by setting the css class to be a sap-custom-text I have defined named theme1 with the function text.setCssClass("theme1"). This is accomplished after I add the text and before I display the popup, yet the text displays as the default styling. Any help would be appreciated.

Edit: Added video of the issue and code in comment below

JBARLOW
Contributor

Hi Christopher,

Do you have example code you can share ?

happy to take a look and see if we can get it working as expected.

sluglover
Explorer
0 Kudos

Here's the scripting:

This consists of a table filled with whatever data (my actual application has it populated with onResultChanged but that shouldn't matter), a popup with a text box overlaying it, and a timer to close the popup. I apologize for the delay- I am a student

Table_1 - onSelect():

Text_1.applyText("Testing");
Text_1.setCssClass("theme1");
Popup_1.open();
Timer_1.start(5);

css:

.theme1 .sap-custom-text{
	font-size: 30;
}

Timer_1 - onTimeout():

Popup_1.close();

I have a strong feeling that the text size cannot be modified, as this setup doesn't work at all, nor does it work with the text statically in the text box. This is odd, as it seems to be viable in the css dropdown:

View Entire Topic
Marc_Kuipers
Product and Topic Expert
Product and Topic Expert

jbarlowjb sluglover

Are you doing something like this (I am using a button, but that should make no difference)

1. App setup

2. CSS Style

.mytheme .sap-custom-text-area{background-color:red}

3. Result

--> style is applied

Marc

avsalynin
Active Contributor

marc.kuipers

try in app css smth like this

.mytheme .sap-custom-text-area{
	background-color:green;
}
sluglover
Explorer
0 Kudos

Sorry for the late reply, and thanks for the quick answer! The fact that yours is working is really odd, my setup is very similar, but isn't working. Granted, I am trying to alter the text size and added text through the function applyText on a textbox, but that's pretty much it. I'll provide a video of the issue when I get the chance tonight/tomorrow morning, thanks!