// @ShowCode:showCompleteEnd
// @ShowCode:showInputEnd
// @ShowCode:showInputStart
public Renderer setInitValue(String name, String age, String bloodtype, String nameErrMsg, String ageErrMsg) {
Renderer renderer = new GoThroughRenderer();
if (!StringUtils.isEmpty(name)) {
renderer.add("input${symbol_pound}name", "value", name);
}
if (!StringUtils.isEmpty(age)) {
renderer.add("input${symbol_pound}age", "value", age);
}
if (!StringUtils.isEmpty(nameErrMsg)) {
renderer.add("span${symbol_pound}nameErrMsg", nameErrMsg);
}
if (!StringUtils.isEmpty(ageErrMsg)) {
renderer.add("span${symbol_pound}ageErrMsg", ageErrMsg);
}
List<Renderer> options = new ArrayList<>();
for (BloodType bloodTypeEnum : BloodType.values()) {
Renderer type = Renderer.create("option", "value", bloodTypeEnum.name());
type.add("option", bloodTypeEnum.name());
if (bloodTypeEnum.name().equals(bloodtype)) {
type.add("option", "selected", "selected");
}
options.add(type);
}
renderer.add("select${symbol_pound}bloodtype > option", options);
return renderer;