我创建了我的自定义表单组件。我在智能编辑中添加它后,它不会调用控制器来填充表单。我在 *-items.xml 中创建了 itemtype MyComponentModel,在 HAC 部署中检查,它就在那里。我还添加了这个答案中的注释
@Controller("MyComponentController")
@RequestMapping(value = ControllerConstants.Actions.Cms.MyComponent)
public class MyComponentController extends AbstractAcceleratorCMSComponentController<MyComponentModel> {
映射值在我的 ControllerConstants 中,如下所示:
String _Prefix = "/view/"; // NOSONAR
String _Suffix = "Controller"; // NOSONAR
String MyComponent = _Prefix + MyComponentModel._TYPECODE + _Suffix; // NOSONAR
当我在页面上的 smartedit 中添加它时,会加载 .jsp 文件(我可以看到一些文本),但是由于没有调用控制器
根据 Hybris doc,我的控制器中被调用的方法应该是这样的:
@Override
protected void fillModel(HttpServletRequest request, Model model, MyComponentModel component) {
但它没有被调用,所以我无法填写表格。
<div class="span-20 last">
I can see this text
<div class="row item_container_holder">
<c:if test="${not empty MyForm}">
<%--this condition is false, form is empty--%>
请注意,我还在impex中添加了组件,我在HAC中更新了系统,我尝试同步目录。
INSERT_UPDATE MyComponent; $contentCV[unique = true]; uid[unique = true] ; name ; &componentRef
;; MyComponent ; MyComponent ; MyComponent
编辑:
*-items.xml
<itemtype code="MyComponent" autocreate="true" generate="true" extends="SimpleCMSComponent"
jaloclass="mypackage.b2c.core.jalo.components.MyComponent">
<deployment table="MyComponents" typecode="15900"/>
<attributes>
<attribute qualifier="title" type="localized:java.lang.String">
<persistence type="property" />
<modifiers />
<description>Localized title of the component.</description>
</attribute>
</attributes>
</itemtype>
人到中年有点甜
函数式编程
相关分类