首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将渲染转换成Zul?

将渲染转换成Zul?
EN

Stack Overflow用户
提问于 2013-11-12 06:23:07
回答 1查看 501关注 0票数 1

我有一个问题,删除呈现并将呈现转换为zul .I拥有呈现方法这里这个呈现方法删除和渲染代码写在zul中。

我的祖尔:-

代码语言:javascript
复制
<listbox id="caseInfoCodesViewList" sizedByContent="true"
            sclass="vertical-scroll" vflex="1" model="@bind(vm.folderInfoList)"
            emptyMessage="${a:resource('LABEL_NOROWS')}"
            itemRenderer="@load(vm.itemRenderer)"
            selectedItems="@bind(vm.selectedCodes)" checkmark="@load(vm.data)"
                     multiple="true">
            <listhead >
                <listheader label="@load(vm.getText('FolderInfoDetail:LABEL_DESCRIPTION'))" width="25%"></listheader>
                <listheader label="@load(vm.getText('FolderInfoDetail:LABEL_CODES'))" width="10%"></listheader>
                <listheader label="@load(vm.getText('FolderInfoDetail:LABEL_ORDER'))" width="15%"></listheader>
                <listheader label="@load(vm.getText('FolderInfoDetail:LABEL_PRINT'))" width="15%"></listheader>
                <listheader label="@load(vm.getText('FolderInfoDetail:LABEL_REQUIRED'))" width="20%"></listheader>
                <listheader label="@load(vm.getText('FolderInfoDetail:MANDATORY'))" width="15%"></listheader>
            </listhead>         
                </listbox>

视图模型:-

代码语言:javascript
复制
   @NotifyChange("*")
        public ListitemRenderer getItemRenderer() {

            ListitemRenderer _rowRenderer = null;
            if (_rowRenderer == null) {
                _rowRenderer = new ListitemRenderer() {
                    public void render(Listitem row, Object data, int index) throws Exception {
                        if (row instanceof Listgroup) {
                            Listcell group = new Listcell(data.toString());

                            row.appendChild(group);
                        } else {
                            final FolderInfoData info = (FolderInfoData) data;
                            row.setAttribute("data", info);
                            Listcell descCell = new Listcell();
                            descCell.setValue(info.infoDesc);
                            Label label = new Label();
                            if (StringUtils.isNotBlank(info.infoDesc)) {
                                label.setValue(info.infoDesc);
                            }
                            label.setMaxlength(15);
                            descCell.appendChild(label);

                            row.setValue(String.valueOf(info.infoCode));
                            row.appendChild(descCell);

                            row.setValue(String.valueOf(info.infoCode));
                            row.appendChild(new Listcell(String.valueOf(info.infoCode)));

                            Listcell orderCell = new Listcell();
                            orderCell.setValue(String.valueOf(info.infoDisplayOrder));

                            Intbox tbox = new Intbox();
                            tbox.setValue(info.infoDisplayOrder);
                            tbox.setMaxlength(10);
                            orderCell.appendChild(tbox);
                            row.appendChild(orderCell);

                            Listcell printFlagCell = new Listcell();
                            Radiogroup groupPrintCell = new Radiogroup();
                            Radio yesPrintFlag = new Radio("Yes");
                            yesPrintFlag.setValue("Y");
                            groupPrintCell.appendChild(yesPrintFlag);
                            Radio noPrintFlag = new Radio("No");
                            noPrintFlag.setValue("N");
                            groupPrintCell.appendChild(noPrintFlag);
                            if (abcd.toBoolean(info.infoPrintFlag)) {
                                groupPrintCell.setSelectedItem(yesPrintFlag);
                            } else {
                                groupPrintCell.setSelectedItem(noPrintFlag);
                            }
                            printFlagCell.appendChild(groupPrintCell);
                            row.appendChild(printFlagCell);

                            Listcell setUpCell = new Listcell();
                            Radiogroup groupSetUP = new Radiogroup();
                            Radio yesSetUP = new Radio("Yes");
                            yesSetUP.setValue("Y");
                            groupSetUP.appendChild(yesSetUP);
                            Radio noSetUP = new Radio("No");
                            noSetUP.setValue("N");
                            groupSetUP.appendChild(noSetUP);
                            if (abcd.toBoolean(info.valueRequired)) {
                                groupSetUP.setSelectedItem(yesSetUP);
                            } else {
                                groupSetUP.setSelectedItem(noSetUP);
                            }
                            setUpCell.appendChild(groupSetUP);
                            row.appendChild(setUpCell);

                            Listcell mandatoryCell = new Listcell();
                            Radiogroup groupMandatory = new Radiogroup();
                            Radio yesMandatory = new Radio("Yes");
                            yesMandatory.setValue("Y");
                            groupMandatory.appendChild(yesMandatory);
                            Radio noMandatory = new Radio("No");
                            noMandatory.setValue("N");
                            groupMandatory.appendChild(noMandatory);
                            if (abcd.toBoolean(info.getMandatory())) {
                                groupMandatory.setSelectedItem(yesMandatory);
                            } else {
                                groupMandatory.setSelectedItem(noMandatory);
                            }
                            mandatoryCell.appendChild(groupMandatory);
                            row.appendChild(mandatoryCell);

                        }
                    }

                };
            }
            return _rowRenderer;
        }

有人能告诉我如何把这个渲染变成zul吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-12 07:38:50

正如我所看到的,您使用了MVVM、.Use、ZUl端的简单Listbox,因为您现在没有在ZUL页面中添加ListItemListCell,所以您使用了呈现,所以我建议您使用Listbox、其他子组件ListItemListCell,对于检查zul端的值,您可以在ZUL以及${"Some Expression"}中使用表达式,这将解决您的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19922330

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档