2017-03-08 64 views
1

我有如下公式嵌套EL表達式失敗

#{af:formatNamed2(repo['PARAM'],'NUMBER', someScope.CurrentWorkerIndex, 'TOTAL_NUMBER', someScope.TotalNumberOfWorkers)}" 

我需要的值到狀態之間切換的最後PARAM如下:

someScope.TotalNumberOfWorkers < 0 ? 500 : someScope.TotalNumberOfWorkers 

我嘗試了所有這些,但失敗:

測試之一:

#{af:formatNamed2(repo['PARAM'],'NUMBER', someScope.CurrentWorkerIndex, 'TOTAL_NUMBER', [someScope.TotalNumberOfWorkers < 0 ? 500 : someScope.TotalNumberOfWorkers])}" 

測試二:

#{af:formatNamed2(repo['PARAM'],'NUMBER', someScope.CurrentWorkerIndex, 'TOTAL_NUMBER', (someScope.TotalNumberOfWorkers < 0 ? 500 : someScope.TotalNumberOfWorkers))}" 

請建議

回答

0

我爲我的沉默表示歉意,認爲我想通了。

問題是與 '<' 符號:

someScope.TotalNumberOfWorkers < 0 ? 500 : someScope.TotalNumberOfWorkers 

正確:

someScope.TotalNumberOfWorkers lt 0 ? 500 : someScope.TotalNumberOfWorkers 

我們需要使用關於 '<' 'LT' 和 'GT' 爲 '>'