简体   繁体   English

将操作分配给自定义按钮和 UI 布局问题

[英]Assigning Action to a custom Button and UI layout issue

I ran into two issues while working on the UI of the form:我在处理表单的 UI 时遇到了两个问题:

  1. I created an Action but I can't seem to assign it to the new button that I've created.我创建了一个动作,但我似乎无法将它分配给我创建的新按钮。 It appeared on toolbar instead as highlighted in red box here .它出现在工具栏上,而不是在此处以红色框突出显示。 The code on the Action and Button:动作和按钮上的代码:

     public PXAction<CashAccount> RefreshAvailability; [PXButton(CommitChanges = true)] [PXUIField(MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = true)] protected virtual void refreshLCAvailability() { //logic here }
  2. I inserted two Column controls to separate the fields into two columns as shown here but the output is not like what I wanted it to be as shown in the image in point 1.我插入了两个列控件以将字段分成两列,如此处所示但 output 不像我想要的那样,如第 1 点中的图像所示。

I feel like I'm missing something very simple but can't seem to figure what.我觉得我错过了一些非常简单的东西,但似乎无法弄清楚是什么。

Edit:编辑:

The first issue has been solved by assigning the Command as well as the Target as shown here .第一个问题已通过分配命令和目标来解决,如下所示

I managed to solve the second issue by trial and error.我设法通过反复试验解决了第二个问题。 So basically, you need to:所以基本上,你需要:

  1. Insert an Empty Layout control after Merge control在合并控件后插入一个空布局控件
  2. Specify the Merge property as False将 Merge 属性指定为 False

Image for point 1 & 2第 1 点和第 2 点的图像

  1. Insert another Column in between the two在两者之间插入另一列
  2. Insert a Label control in the newly created Column在新建的Column中插入一个Label控件
  3. Leave the Label Text as blank将 Label 文本留空

Image for point 3, 4 & 5第 3、4 和 5 点的图像

It is mind boggling that I have to do it in this roundabout way.令人难以置信的是,我必须以这种迂回的方式来做。 If there is any better way of doing this, please do share it in this thread.如果有更好的方法,请在此线程中分享。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM