DBR with Data Validation


#1

Hey,

I wanted to know if there is a way to apply the class of the TM1-validate-message on a string cell,
once its empty.

To be more specific , I have DBR that should be filled with text,
and I want to highlight to DBR frame , when the cell is empty,
so it will appear as a mandatory field to the user when the page is being loaded ?

Is there a way to do it ?

thanks


#2

Hi @tganz,

You can do that, you need to store the value using ng-model and then add a class if the string is empty. An example:

<td colspan="10" ng-class="{'has-error': !line.comment && line.totalExpenses > 0 }">
    <tm1-ui-dbr
        tm1-instance="dev"
        tm1-cube="Expense"
        tm1-elements="Actual,Local,{{page.fy}},{{user.Name}},Expense_Default,{{page.month}},{{line.key}},Comments"
        tm1-default-empty=""
        ng-model="line.comment"
        tm1-placeholder="Enter comments for each expense..."
        tm1-ui-class="left-aligned">
    </tm1-ui-dbr> 
</td>

#3

Thanks Tim !
works perfectly