cancel
Showing results for 
Search instead for 
Did you mean: 

How to change InputField background color using Java Code

Former Member
0 Kudos

Hi,

In my application use will enter some set of Cost Centers in a table and submits request.

In return i will get a list of invalid cost centers which i need to display in a table with input field

In that table all cost centers will displayed, but invalid cost centers should be highlighted or background color should some other color. like red or yellow.

Is it possible using java code to change a input field color.

Please help me.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you want user to edit the invalid data in input field then there is no possiblity.

Or else you can use the textview and you can change the sematicColour property to change the colour.

Regards,

Charan

Answers (1)

Answers (1)

former_member201361
Active Contributor
0 Kudos

Hi,

declare a error message in message pool and declare a method say "checkCostCenters " and in this method, u can check whether it is a valid cost center .. if it is invalid cost center , then throw the erro message using the below code :

wdComponentAPI.getMessageManager().reportContextAttributeMessage(

inputfieldattibutePointer, IMessageProgramPlanComp.ur error message,

new Object[] );

for getting pointer and label use the below code:

IWDAttributePointer inputfieldPointer = URNODEELEMENTElement

.getAttributePointer(URNODEELEMENT.ATTRIBUTENAME);

String inputfieldLabel = wdContext.nodeURVALUENODE.getNodeInfo()

.getAttribute(URNODELEMENT.ATTRIBUTE).getSimpleType()

.getFieldLabel();

hope it helps..

Thanks and Regards

Former Member
0 Kudos

Thanks for your concern

I will try out with your code.