Jmix1.5版本问题求助

image
image
请问Jmix1.5版本是否有组件可实现上图功能,如果不能是否有其他更好的实现方式可替代

1.5 里面只有 ValuesPicker 与你要的这个功能类似,但是不会显示后面的 +3 这种。

值选择界面如果需要使用自定义的界面,可以通过自定义操作实现。

你可以先看看效果:https://demo.jmix.io/sampler/#main/12/sample?id=valuespicker-enum
image

如果我要用列生成的方式去使用ValuesPicker,怎么实现,怎么添加到选择的action

例如,我们给order表添加一个选择 isPaid 的valuespicker。

  1. 在页面的xml中的 <actions/>标签内添加操作:
<actions>
    <action id="lookupSelectAction"
            caption="msg:///actions.Select"
            icon="LOOKUP_OK"
            primary="true"
            shortcut="${COMMIT_SHORTCUT}"/>
    <action id="lookupCancelAction"
            caption="msg:///actions.Cancel"
            icon="LOOKUP_CANCEL"/>

    <action id="selectIsPaid" type="values_select">
        <properties>
            <property name="enumClass" value="com.company.leot.entity.YesOrNo" />
        </properties>
    </action>
</actions>
  1. 表格添加列:
<columns>
...
      <column id="isPaid" />
  </columns>
  1. java 添加columnGenerator 代码,这里 YesOrNo 是个枚举:
@Autowired
private Action selectIsPaid;

@Install(to = "ordersTable.isPaid", subject = "columnGenerator")
private Component ordersTableIsPaidColumnGenerator(final Order order) {
    var valuesPicker = uiComponents.create(ValuesPicker.of(YesOrNo.class));
    valuesPicker.addAction(selectIsPaid);
    return valuesPicker;
}

image

image
这里action的property中value是一个entity,那name属性怎么填?,目前我写的值会报错
image

image

image
image
image

前两张是代码片段,第三张图片点击红框三个点能否打开指定的页面?

还是看我上面贴的那个图。用 lookupScreenId 配置选择实体的界面。

非常感谢,第一次用这个组件,不是很熟悉,问题完美解决,谢谢

有没有方法给打开的页面传参数?

目前是没有办法传参的