Link Combo Box
incoming…
Wow, okay, so yeah. This was something.
Allows a user to select from a list of predefined formulers and populate values within them.
* I did not set events to do anything with the formula in this example:
Make sure to view the bottom Event configurations to make this thing work!!!
Property Group | Property | Description |
---|---|---|
Basic | Id | Unique identifier for the control |
Basic | Label Text | Sets the label text within the control. (Fig. A) |
Behavior | On Blur | Click this to create an OnBlur event for the control. On Blur is triggered when the control loses focus. |
Behavior | On Create | Click this to create an OnCreate event for the control On Create is triggered when the control is painted to the GUI. |
Comments | Comments | Add some developer notes to the control. These are not customer-facing and are only visible in App Studio (Fig. B) |
Data | Key Field | Indicates that a bound component is a key field. If true, the field is enabled if there is no current record, allowing the user to select an existing record or create a new one. |
Data | EpBinding | Bind the button to a DataView.Column. |
Layout | Alignment | Set the alignment for the control. Valid options are Left, Center, Right. (Fig. C) |
Layout | Width | Sets the specific width (pixels) for the control. (Fig. D) |
Misc | EpBinding for Phrase Items | Optional binding to a dataview that has the definitions for the items and phrase items. Honestly–I didn’t bother with this optional binding… 'cause optional. Yeah. |
State | Personalizable | If true, a user can personalize this component(hide/show) |
State | Customizable | If true, a user can customize this component in child layers |
State | Hidden | Hides the control from view. |
State | Disabled | Disables the control. The control will not allow editing or focus. |
State | Read Only | Makes the control read only so that it will not allow editing. The control can still be focused. |
State | Auto Focus | When enabled, the control is automatically focused on creation. |
Advanced > Items | ID | Set an ID of the first collection of items–the row if you will. |
Advanced > Items > Phrase Items (Type: Text) | ID | The ID for the item. (Fig. E) |
Advanced > Items > Phrase Items (Type: Text) | Type | Type is Text or Link. Link will be clickable. (Fig. E) |
Advanced > Items > Phrase Items (Type: Text) | Text | The, well… the text! (Fig. E) |
Advanced > Items > Phrase Items (Type: Text) | Max Width | If the maximum width of the phrase item in the combo is exceeded, ellipses are used. (Fig. E) |
Advanced > Items > Phrase Items (Type: Text) | AlwaysClickable | The phrase item is clickable even if read only or within an inactive grid row when type is link. (Fig. E) |
Advanced > Items > Phrase Items (Type: Link) | ID | The ID for the item. (Fig. F) |
Advanced > Items > Phrase Items (Type: Link) | Type | Type is Text or Link. Link will be clickable. (Fig. F) |
Advanced > Items > Phrase Items (Type: Link) | EpBinding | Set the data binding the link reads from/to. Format Dataview.Column. (Fig. F) |
Advanced > Items > Phrase Items (Type: Link) | Default Text | The text shown first before being replaced by the text in the binding. (Fig. F) |
Advanced > Items > Phrase Items (Type: Link) | Max Width | If the maximum width of the phrase item in the combo is exceeded, ellipses are used. (Fig. F) |
Advanced > Items > Phrase Items (Type: Link) | AlwaysClickable | AlwaysClickable |
Figure A: Label Text
Figure B: Comments
Figure C: Alignment
Figure D: Width
Figure E: Phrase Type Text
Figure F: Phrase Type Text
Events and Views
Create a dataview:
Get the ID of your Link Combo
Create a new event
The trigger is going to be:
Type Control
Hook onLinkClick (This is not in the dropdown… you just have to magically know this!! )
Target The ID you just copied.
Put in a Switch. The value for the switch will be %value%
to get whatever was just clicked. These values will correspond to the IDs you set for each Phrase item. The action off of that case statement will be row-update
.
In the row update, set the Binding to DynamicPanel.Text1. This will be used in the next widget.
Set the value to the binding of your Phrase item. For the operator, bind it to TransView.ExOper. Or don’t. I dunno. That’s just what I found Epicor doing when I reverse engineered it.
The switch fails without this. Make sure to do an OnSuccess on your row-update
widget. Throw a console-write
after so that if you need to rearrange downstream widgets, you don’t have to start over. Initialize DyanmicPanel.Text1 and TransView.ExOper with what’s in our bindings presently.
Now attach some dynamic-panel-open
widgets.
Give it a title.
Here’s the code for a textbox component. Note that it’s using the DynamicPanel.Text1. If you bound that to something else, change it here too.
[
{
"controlTypeId": "ErpTextBox",
"controlModel": {
"labelText": "Enter Text",
"epBinding": "DynamicPanel.Text1"
}
}
]
You can technically do the same for the operator (Make sure to change the binding, though), but Epicor got fancy with theirs. Here’s the code for that:
[
{
"controlTypeId": "ErpSelectionList",
"controlModel": {
"epBinding": "TransView.ExOper",
"items": [
{
"id": "+",
"text": "+ Addition",
"selected": true
},
{
"id": "-",
"text": "- Subtraction"
},
{
"id": "*",
"text": "* Multiplication"
},
{
"id": "/",
"text": "/ Division"
}
],
"uiMode": "singleSelect",
"valuePrimitive": true,
"mode": "SingleSelect",
"draggable": true
}
}
]
On the panel’s OnOK response, set up more row-updates
to send that info back to the page bindings.
Now you have the values. Or something. Create a button to do something with that formula. I don’t know. This control was stupid.