Abram Darnutzer – Sr. Application Consultant
When working with CM WebClient and CM WebClient Mobile, there are times where you have to enter custom parameters into the Control Name for a CA Plex Panel Object.
For normal WebClient, you could be setting a CSS class for a button like this:
myPushButton:MainArea:class=CustomCSSClass:default
Or for CM WebClient Mobile, you could be setting a Label for an Edit control:
TestFld:MainArea:label=MyTestLabel
Or an icon class for a Push Button:
TestBtn:MainArea:iconCls=more
There are times where hard-coding these values can bring maintenance problems, and doesn’t take advantage of the powers of CA Plex. So, there must be another (sometimes better) way. By using CA Plex objects in your Control Names, you can affect larger portions of your application with a single change.
Let’s look at the three examples from before. But this time we will use CA Plex objects to set the values.
myPushButton:MainArea:class= <VAL:Classes.MyButtons>:default
TestFld:MainArea:label= <LBL:CompanyID>
TestBtn:MainArea:iconCls= <VAL:Icons.TestIcons>
Here, you can see we are using CA Plex Value and Label objects in the Control Name. These can be entered by hand, or dragged and dropped from the Object Browser.
Now, if I wanted to change the label for every field that uses the CompanyID label, all I need to do is change the literal for that label object and regenerate my function. It’s a great way to avoid hard-coding and the maintenance issues it brings.