`

MasterDetailModel

 
阅读更多
    public MasterDetailModel masterDetailModel; 

      masterDetailModel = new MasterDetailModel(this,
                MaintainCardDisplayInfo.class);

        cardInfo = masterDetailModel.getMaster();
        cardInfo.addPropertyChangeListener("selectedValue",
                new PropertyChangeListener() {

                    public void propertyChange(PropertyChangeEvent evt) {
                        if (evt.getNewValue() instanceof MaintainCardDisplayInfo) {
                            if (((MaintainCardDisplayInfo) evt.getNewValue())
                                    .isNew()) {
                                modify.setEnabled(false);
                                save.setEnabled(true);
                            } else {
//                                selfPortQuantity.setEnabled(false);
                                if (((MaintainCardDisplayInfo) evt
                                        .getNewValue()).isModified()) {
                                    save.setEnabled(true);
                                }
                            }
                        }

                    }

                });

        add = masterDetailModel.getAddAction();

        modify = masterDetailModel.getModifyAction();

        delete = masterDetailModel.getRemoveAction();

        save = new ActionModel(this);

        masterDetailModel.registerFieldModel("slotNumberInfo", slotNumber);
        masterDetailModel.registerFieldModel("name", cardName);
        masterDetailModel.registerFieldModel("selfPortQuantity",selfPortQuantity, false);
        masterDetailModel.registerFieldModel("typeInfo", cardType);
        masterDetailModel.registerFieldModel("cardCode", cardCode);
        masterDetailModel.registerFieldModel("remark", remark);




--------------------------------------------------------------------------------

public class MaintainCardSection extends BaseSection {                                //Ssction有所不同
        String[] columnTitles = new String[] { "   槽口序号   ", "   编号   ",
                "  类型  ", "   名称   ", "  自带端口数  ", "  已用端口  ", "   备注   " };

        MasterDetailTableColumnDescription tableColumnDescription = new            MasterDetailTableColumnDescription(columnTitles);
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics