add render info and minor fix

This commit is contained in:
Shinsuke Sugaya 2015-11-22 06:03:07 +09:00
parent 134146868a
commit 938a21425c
2 changed files with 12 additions and 6 deletions

View file

@ -43,7 +43,7 @@ import org.lastaflute.web.response.render.RenderData;
import org.lastaflute.web.util.LaRequestUtil;
/**
* @author codelibs
* @author shinsuke
* @author Keiichi Watanabe
*/
public class AdminDataconfigAction extends FessAdminAction {
@ -137,7 +137,6 @@ public class AdminDataconfigAction extends FessAdminAction {
}
@Execute
//(token = TxToken.SAVE)
public HtmlResponse edit(final EditForm form) {
validate(form, messages -> {}, () -> asListHtml());
final String id = form.id;
@ -146,13 +145,20 @@ public class AdminDataconfigAction extends FessAdminAction {
}).orElse(() -> {
throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
});
saveToken();
if (form.crudMode.intValue() == CrudMode.EDIT) {
// back
form.crudMode = CrudMode.DETAILS;
return asDetailsHtml();
return asDetailsHtml().renderWith(data -> {
registerRolesAndLabels(data);
registerHandlerNames(data);
});
} else {
form.crudMode = CrudMode.EDIT;
return asEditHtml();
return asEditHtml().renderWith(data -> {
registerRolesAndLabels(data);
registerHandlerNames(data);
});
}
}

View file

@ -52,8 +52,8 @@
<table class="table table-bordered table-striped">
<thead>
<tr>
<th><la:message key="labels.name" /></th>
<th><la:message key="labels.available" /></th>
<th class="col-md-8"><la:message key="labels.name" /></th>
<th class="col-md-4 text-center"><la:message key="labels.available" /></th>
</tr>
</thead>
<tbody>