0

我正在努力通过更改它的颜色来使内容面板的标题看起来像闪烁。但是我尝试的代码不起作用,这里的代码:

public class Reminder extends ContentPanel{
Timer time = new Timer{
public void run(){
rpc.getReminders(new AsyncCallBack<ArrayList<ModelData>>(){
public voidonFailure(Throwable caught)
{ }
public void onSuccess(ArrayList<ModelData> result){
//the next line does not affect any result
getHeader().setStyleAttribute("backgroundColor","red");
//even tried throught css, but both of them gave no result
getHeader().addStyleName("myredpanel");
//But this method is working, but its also overwriting the parents css styles, but i only need to change backgroun color
getHeader().setStyleName("myredpanel");
})

搜索了论坛,但这些例子不适用于我的?还有什么建议?

4

2 回答 2

1

调用时不要使用驼峰式名称setStyleAttribute

getHeader().setStyleAttribute("backgroundColor","red"); // WRONG

getHeader().setStyleAttribute("background-color","red"); // CORRECT
于 2013-09-23T15:45:30.607 回答
0

如果您使用的是 gxt 3.0.X,您应该更改 ContentPanelAppereance,直接设置样式可能没有帮助。如果你愿意,我可以发一个例子。

于 2013-11-25T11:18:45.923 回答