Maximo custom control (Part II) – Control properties


In my last post, I created a super simple control with just a “Hello World” label. The goal of the exercise is for us to identify the core components of a control. In this post, I’ll continue to expand the exercise so we can better understand Maximo’s controls.

One common requirement the need modify the size of the multipart textbox control, usually to increase the size of the first textbox to fully display long ID of item or asset.


Application Designer doesn’t provide us with an option to modify this.
If we export the application design XML file, and add: size=”40”, we will end up increase the size of both parts to 40 as shown in the image below:



In our previous tutorial, we now know that this multipart textbox is just a control which has two “textbox” components. Therefore, we can definitely control the size of each component. To do that, let’s edit the “control-registry.xml”:

Find the multipart textbox control by searching keyword: “multiparttextbox". In the <property-list>…</property-list> element, add two more properties: 
   <property name="part1size" />
   <property name="part2size" />

In the <component-list>… </component-list> element, you will find two <textbox> components. For the first <textbox> component, pass the first size property: <textbox size="@{part1size}" id="tb" … /> . For the second <textbox> component, pass the second property: <textbox size="@{part2size}" id="tb2" … />

Now open Application Designer, export the application we want to edit the size of a multipart textbox. Edit the application XML file to specify the size of each part to meet requirement. For example, export Item application, and edit the multipart control of the ITEMNUM field to add two properties: <multiparttextbox dataattribute="ITEMNUM" part1size="16" part2size="34" … />

Import the XML file back to Maximo, we will see our control having the size of each part modified accordingly:




In the next post, I’ll discuss on how we can leverage this capability to address more complex requirements by dynamically update properties in run time to change control's appearance.


No comments:

Post a Comment