I have data grid and table.In data grid ,I have command buttons for every location. In(mysql) table I have id,date,location attributes. The button should get coloured based on the id present in the table. how can I get this? please do some favour..Thanks in advance..
This is my command Button ..
<h:commandButton id="login" value="Reason"
style="#{home.rest()},height: 20px;left: 200px;font-size: 50%;bottom: 1px;font-family: bold;position: relative" />
I have used Java method..here it is...
public String rest(){
String a;
String table_id;
List user=new ArrayList();
DBQuery db=new DBQuery();
user=db.table(getDate());
String id="";
List off=new ArrayList();
off = db.entire_location(toDate(),getDate());
for(int j=0;j<user.size();j++){
for(int i=0;i<off.size();i++){
home_bean hello = (home_bean)user.get(j);
table_id=hello.getable_id();
home_bean hi = (home_bean)off.get(i);
id= hi.getentire_id();
if(id.equals(table_id)){
System.out.println("True");
a="red";
// return "background-color: red;width:100%";
} else
a="";
System.out.println("Fallse");
}}return "a";
}