我有以下代码需要将其更改为wicket 6.6,但isTransparentResolver()已删除,我正在尝试根据此链接
https://www.mail-archive.com/commits@wicket.apache.org/msg17546.html 但没有用,任何人都有下面代码的解决方案吗?
add(new WebMarkupContainer("bodyElement") {
@Override
public boolean isTransparentResolver() {
return true;
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if ((usrLoginHstryList == null || usrLoginHstryList.isEmpty()) &&
(usrChangeHstryList == null || usrChangeHstryList.isEmpty())) {
tag.put("onload", "hideHistoryButtons();");
} else if (usrLoginHstryList == null || usrLoginHstryList.isEmpty()) {
tag.put("onload", "hideUserLoginHstryBtn();");
} else if (usrChangeHstryList == null || usrChangeHstryList.isEmpty()) {
tag.put("onload", "hideUserChngHstryBtn();");
}
}
});
答案 0 :(得分:1)
最后我使用TransparentWebMarkupContainer
编写了这个import PropTypes from 'prop-types'; // for React version React >=v15.5
class Greeting extends React.Component {
render() {
return (
<h1>Hello, {this.props.name}</h1>
);
}
}
Greeting.propTypes = {
// This indicates name should be passed as props from parent.
name: PropTypes.string.required
};