Get Labels from Static Entities

I have a button group then binds to a Status, static entity. For eg, My Status static entity have the following records: New, InProgress, Completed.

Although I can bind the button group properly and set the ButtonGroupItem, ie, ButtonGroupItem1 to Entity.Status.New, however the ButtonGroupItem1 label is still remains as 'first'. Yes I know I can change the label text manually, BUT can I dynamically called out the Entity.Status.New.Label instead?


Can someone advise?

Hi Ka Wei Tang,

There is a label in the button group section. You can replace the label with expression widget and pass in your label value using something like :

GetStatus(Entities.Status.New).Status.Label

Also make sure that you are using the same Style Class for expression as it was for label for the same CSS implementation.

Please find the sample screen shot in the attachment. 

Happy Coding ..

 

Pranav Pandey wrote:

Hi Ka Wei Tang,

There is a label in the button group section. You can replace the label with expression widget and pass in your label value using something like :

GetStatus(Entities.Status.New).Status.Label

Also make sure that you are using the same Style Class for expression as it was for label for the same CSS implementation.

Please find the sample screen shot in the attachment. 

Happy Coding ..

 

Sorry, but it returns: Unknown Function 'GetStatus' in expression

Am I missing something. I do notice my Core Module does have a GetStatus Function create by default, just that I cannot use it.


Ka Wei Tang wrote:

Pranav Pandey wrote:

Hi Ka Wei Tang,

There is a label in the button group section. You can replace the label with expression widget and pass in your label value using something like :

GetStatus(Entities.Status.New).Status.Label

Also make sure that you are using the same Style Class for expression as it was for label for the same CSS implementation.

Please find the sample screen shot in the attachment. 

Happy Coding ..

 

Sorry, but it returns: Unknown Function 'GetStatus' in expression

Am I missing something. I do notice my Core Module does have a GetStatus Function create by default, just that I cannot use it.


There is a get function within you static entity within that you can pass the value to get the label . For example if you static entity name is ABC then the expression will be 

GetABC(Entities.ABC.New.Label).ABC.Label

If possible you can send me the oml file . I will check it and update you.