2016-10-13 3 views

Antwort

0
 //define style class in skins file 
      .style1 { background-color:green; } 
      .style2 { background-color:red;} 
      .style3 { background-color:yellow; } 
      .style4 { background-color:blue;} 

    public long getCountRows(){ 
    ViewObjectImpl vo = getTourHeaderEOView_hdr(); 
    return vo.getEstimatedRowCount(); 
} 
+0

GetCountrows-Methode in Impl-Klasse – keval

+0

beide Antworten sind beigefügt. Aus Versehen habe ich die Antwort gepostet, die unvollständig war. – keval

0
private String styleForCell; //class variable 

public String getStyleForCell() { 


    OperationBinding ob2 = (OperationBinding)getBindings().get("getCountRows"); 
    int row = (Integer)ob2.execute(); 

    for(int i = 1;i <= row;i=i+4) { 
     return "style1"; 
    } 
    for(int i = 2;i <= row;i=i+4) { 
     return "style2"; 
    } 
    for(int i = 3;i <= row;i=i+4) { 
     return "style3"; 
    } 
    for(int i = 4;i <= row;i=i+4) { 
     return "style4"; 
    } 

    return null; 
} 
public void setStyleForCell(String aStyleForCell) 
{ 
    this.styleForCell = aStyleForCell; 
} 

// jetzt rufen Sie diese Methode durch Frontend-Seite aus der Tabelle mit styleclass-Eigenschaft (styleclass = „# {backinbean.styleforcell } "

Verwandte Themen