문제

I was trying to make my model strings to be always uppercase, so I tried to use converter and reverseConverter to do this job. Using the mutual option I got hitted by this topic.

Witch leads to my question. Is this the right use case to converter? Without the mutual the value was converted only in the model, and didn't update the view.

Can I use the DocumentFilter approach?

Example

 textField(columns: 3, text: bind("score", target: m, 
            converter: { it.isEmpty()? 0: Integer.parseInt(it) },
            reverseConverter: { String.valueOf(it) },
            mutual: true))
도움이 되었습니까?

해결책

I'm afraid converter: and reverseConverter: only work with unidirectional bindings at the moment.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top