question on returns in text fields/areas

Hello,

I have the following situation:

In table view I have a text field where the user clicks into, hits return and (onAction) a dialog shows up with the same field displayed as a text area. When I enter text with carriage returns in the text area, everything is fine until I hit save and return to the table view. Then, the carriage returns are gone.

The problem seems to be the different display types. Since I would like that onAction to work in table view, I need a text field. On the other side I have to be able to store carriage returns.

Any ideas?

Yes, that is because you use text-field and text-area on the same provider!
text-field ignores every return or enter!

what we are doing is this:

we are reading a text file that contains “\n” (exported returns). Then we are substituting these by CharCode(10), which, for Servoy in a text area, is a return. So far, so good. On most forms the field is a text area except for table view.

It seems that once Servoy shows the field in a text field, the returns are removed. Is that expected behaviour?

as far as I know: Yes, this is expected behaviour.
Why don’t you use, text-area in table-view?

because I would like to use onAction :?

not so serious, this one. The only thing that worries me a little is that if you don’t watch out and use the wrong field type on one of your forms (for example in a table view), your carriage returns are gone…

why don’t you use a label/button for that? With the dataprovider of the thing you want to display.
Then you will see the value and you have an onAction
in 2.1 you can have button like behaviour on labels so it looks like a label but the action still works.

jcompagner:
in 2.1 you can have button like behaviour on labels so it looks like a label but the action still works.

Johan, does that mean, that if you use the Windows L&F that there is’nt an ugly white button inside the label?

white button?
never seen that. All my buttons are gray.

but if you have a label/button and you have showClick and showFocus off you will have a label that acts like a button.