I have a table with af:inputColor as one of the columns and the use case is to save the color to the db and show it back to the user.
Can someone post the working solution with code snippets plz ? I have searched for a working solution on many forums but couldn't find something really helpful.
have a look here: http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12419/tagdoc/af_inputColor.html
This tells me that the color's RGB value is returned as a String (component value property). Just bind the value property e.g. to
"atributeName" is a attribute binding you create in the Pagedef file for a view, pointing to a View Object (iterator) attribute
Let me know if there still is a problem getting this to work. Should be straight forward though
Thanks for the response. May be I am doing something wrong on my page. Can you plz review the following and let me know what else should be done to make it work ?
- DB COLUMN for the saving the color is of VARCHAR2(50)
- Code snippet of the table column is :
<af:column sortProperty="DisplayColor" sortable="false"
<af:convertColor patterns="RRGGBB #RRGGBB"/>
- Value that is being upon selecting a color from af:inputColor is of the format *java.awt.Color[r=210,g=180,b=140]*
- After committing the changes, the saved color doesnt show up.
- I also need to show the saved color in another place inside af:iterator
You can update ViewObject source and create a transient attribute with name AwtColor and then follow Steve code, it shoudl work.
Here is the sample code to add transient attribute of type java.awt.Color from view object source: