문제

I use GWT 2.1.1

In package resources i have png images and one css file.

In css file i wrote:

.finishedTask {
    background: white url("tick64.png") center center;
    padding: 0.5em;
    border: 0;
}

.unFinishedTask {
    background-color: white;
    padding: 0.5em;
    border: 0;
}

Than i create ClientBundle interface extension. With this CSS and images.

Than in UiBunder view i try to change css style:

    textArea.setStyleName(isFinished() ? res.style().finishedTask() : 
res.style().unFinishedTask());

When this code executed css layout of textArea are broken but i see that class changed (FireBug). Seems bug in css.

Maybe somebody already tried do the same thing.

도움이 되었습니까?

해결책

Probably you should use addStyleName or addStyleDependentName instead of setStyleName which remove existing styles.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top