‎2008 May 19 12:22 PM
How to give a color to a text box.
Can anyone give a sample code
‎2008 May 19 12:30 PM
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.
‎2008 May 19 12:30 PM
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.
‎2008 May 20 11:04 AM