Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

module pool text box

Former Member
0 Likes
450

How to give a color to a text box.

Can anyone give a sample code

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
417

Hi,

There are several possibiliets:

You define another two page attributes:

wa_msg_ok type string

wa_msg_nok type string

Depending on the situation, you fill either one of them.

Alternatively, you work with a flag variable:

wa_msg type string

msg_ok type flag

and fille the first with the msg and the second with 'X' depending if it's ok or not.

In the layout you check

<%if wa_msg_ok is not initial.%>

code for colouring ok <%=wa_msg_ok%>

<%else.%>

code for colouring nok <%=wa_msg_nok%>

<%endif.%>

The alternative is

<%if msg_ok is not inital.%>

code for colouring ok <%=wa_msg%>

<%else.%>

code for colouring nok <%=wa_msg%>

<%endif.%>

The code for colouring can be via font color or via CSS.

See http://htmlcodetutorial.com/character_famsupp_213.html for more info.

Another alternative is that you specify the colouring in the onInputprocessing and put all in 1 variable and show only that one in the layout without testing logic.

you can also try something like below.

<% if error = 'X' . %>

<htmlb:textView text = "<span style='background-color: #FF0000'><%= wa_message %></span>"

design = "EMPHASIZED" />

<% elseif success eq 'X' . %>

<htmlb:textView text = "<span style='background-color: #008000'><%= wa_message %></span>"

design = "EMPHASIZED" />

<% endif . %>

Reward for useful answers.

Regards,

Raj.

2 REPLIES 2
Read only

Former Member
0 Likes
418

Hi,

There are several possibiliets:

You define another two page attributes:

wa_msg_ok type string

wa_msg_nok type string

Depending on the situation, you fill either one of them.

Alternatively, you work with a flag variable:

wa_msg type string

msg_ok type flag

and fille the first with the msg and the second with 'X' depending if it's ok or not.

In the layout you check

<%if wa_msg_ok is not initial.%>

code for colouring ok <%=wa_msg_ok%>

<%else.%>

code for colouring nok <%=wa_msg_nok%>

<%endif.%>

The alternative is

<%if msg_ok is not inital.%>

code for colouring ok <%=wa_msg%>

<%else.%>

code for colouring nok <%=wa_msg%>

<%endif.%>

The code for colouring can be via font color or via CSS.

See http://htmlcodetutorial.com/character_famsupp_213.html for more info.

Another alternative is that you specify the colouring in the onInputprocessing and put all in 1 variable and show only that one in the layout without testing logic.

you can also try something like below.

<% if error = 'X' . %>

<htmlb:textView text = "<span style='background-color: #FF0000'><%= wa_message %></span>"

design = "EMPHASIZED" />

<% elseif success eq 'X' . %>

<htmlb:textView text = "<span style='background-color: #008000'><%= wa_message %></span>"

design = "EMPHASIZED" />

<% endif . %>

Reward for useful answers.

Regards,

Raj.

Read only

Former Member
0 Likes
417

thanks for ur help