내가 여러 가지 개찰구 구성 요소에서 IsVisible() 예를 들어FormComponents 일반적인에서 IsVisible 방법이
같은 구현을 가질 수 있습니다 어떻게든지해서 거기에 내가 같은에서 IsVisible 방법을 가지고 있지만 내가 그나마 레이블, TextField의, DropdownChoices 등이 코드 변경을 유지하기가 어렵 기 때문에 모든 사용자 정의 클래스를 구현하지 않아도됩니다.
btw 페이지 디자인으로 인해 웹 마크 업 컨테이너에 넣을 수 없습니다.
나는이 모든 것을 상속 받기를 바랍니다.
public class DepositoryFormComponent extends Component
{
public DepositoryFormComponent(String id) {
super(id);
}
public DepositoryFormComponent(String id, IModel model) {
super(id, model);
}
public boolean isVisible() {
return isFormDepositoryType();
}
protected boolean isFormDepositoryType() {
return getCurrentSelections().getSelectedOwnedAccount().getAssetType() == AssetType.DEPOSITORY;
}
protected CurrentSelections getCurrentSelections() {
return (CurrentSelections) getSession().getAttribute(CurrentSelections.ATTRIBUTE_NAME);
}
public void onRender(){};
}