Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Apr 17, 2019
2 parents 01cadb8 + cef707d commit f2931de
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
Expand Up @@ -84,7 +84,7 @@ <h3><wicket:message key="pageTask.scheduleTitle"/><br />
<td><input class="input-sm" type="checkbox" wicket:id="recurring"/></td>
</tr>
</tbody>
<tbody wicket:id="container">
<tbody class="tbody-nth-of-type-even" wicket:id="container">
<tr wicket:id="boundContainer">
<td>
<wicket:message key="pageTask.bound"/>
Expand All @@ -111,7 +111,7 @@ <h3><wicket:message key="pageTask.scheduleTitle"/><br />
</td>
</tr>
</tbody>
<tbody>
<tbody class="tbody-nth-of-type-even" wicket:id="timeContainer">
<tr>
<td><wicket:message key="pageTask.notStartBefore"/></td>
<td><span wicket:id="notStartBeforeField" /></td>
Expand Down
Expand Up @@ -27,6 +27,7 @@
import com.evolveum.midpoint.prism.delta.DeltaFactory;
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
import org.apache.commons.lang.StringUtils;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
Expand Down Expand Up @@ -129,6 +130,7 @@ public class PageTaskAdd extends PageAdminTasks {
private static final String ID_MISFIRE_ACTION = "misfireAction";
private static final String ID_RECURRING = "recurring";
private static final String ID_CONTAINER = "container";
private static final String ID_TIME_CONTAINER = "timeContainer";
private static final String ID_BOUND_CONTAINER = "boundContainer";
private static final String ID_BOUND_HELP = "boundHelp";
private static final String ID_BOUND = "bound";
Expand Down Expand Up @@ -455,11 +457,21 @@ public boolean isVisible() {
cronContainer.setOutputMarkupId(true);
container.add(cronContainer);

final WebMarkupContainer timeContainer = new WebMarkupContainer(ID_TIME_CONTAINER);
timeContainer.setOutputMarkupId(true);
mainForm.add(timeContainer);

AjaxCheckBox recurring = new AjaxCheckBox(ID_RECURRING, recurringCheck) {

@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(container);
if(recurringCheck.getObject()) {
timeContainer.add(new AttributeModifier("class", ""));
} else {
timeContainer.add(new AttributeModifier("class", "tbody-nth-of-type-even"));
}
target.add(timeContainer);
}
};
mainForm.add(recurring);
Expand Down Expand Up @@ -502,7 +514,7 @@ protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel
}
};
notStartBefore.setOutputMarkupId(true);
mainForm.add(notStartBefore);
timeContainer.add(notStartBefore);

final DateTimeField notStartAfter = new DateTimeField(ID_NO_START_AFTER_FIELD, new PropertyModel<>(
model, TaskAddDto.F_NOT_START_AFTER)) {
Expand All @@ -512,7 +524,7 @@ protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel
}
};
notStartAfter.setOutputMarkupId(true);
mainForm.add(notStartAfter);
timeContainer.add(notStartAfter);

mainForm.add(new StartEndDateValidator(notStartBefore, notStartAfter));
mainForm.add(new ScheduleValidator(getTaskManager(), recurring, bound, interval, cron));
Expand Down
Expand Up @@ -1486,4 +1486,12 @@ th.countLabel{

.small-box h3{
white-space: normal;
}
}


.tbody-nth-of-type-even>tr:nth-of-type(even) {
background-color: #f9f9f9 !important;
}
.tbody-nth-of-type-even>tr:nth-of-type(odd) {
background-color: inherit !important;
}

0 comments on commit f2931de

Please sign in to comment.