No line break when change text of textbox

  • Question
  • Updated 4 years ago
  • Answered
The text label ignore the line break when during simulating text is changed.

instead of line break the textbox is expanded during simulation.

what can i do?

there was earlier a Bug_0062
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
  • frustrated

Posted 4 years ago

  • 1
Photo of Xavier Young

Xavier Young, Official Rep

  • 1343 Posts
  • 151 Reply Likes
Hello,

The text in simulation should be in HTML format. So you will need to use <br> to wrap the line. Like this:

Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
i take the text from a tablecell. that make it more difficult.

what if would like to place the text in two different textboxes with different width.

with out line break this all will be lot of manuel work.
Photo of Xavier Young

Xavier Young, Official Rep

  • 1343 Posts
  • 151 Reply Likes
If you want to place multiple element properties in one expression, it's better to cache their values in a temporary global property, like this:

Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
thanks for the tip. but i have a wall of text for a quest. on start of the simulation i fill all the windows with the text from the table.

the table i use as an import from external database. so to edit the text in any form will cause a lot of manuel. every time the external text will change.

so i need to find a way for auto line break.

or who i could bring the
into a singel cell. cause my text should be complet in one cell.
Photo of Xavier Young

Xavier Young, Official Rep

  • 1343 Posts
  • 151 Reply Likes
The solution I suggested above should work for you. It "automatically" adds <br> between two table cell values, and put them into the same TextBox.
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
i have only one tablecell. but wish to fill the text into different TextBoxes. For that case i would need the line break at different points of the text.

to set line breaks in one tablecell i can use \n that works fine so far.
Photo of Xavier Young

Xavier Young, Official Rep

  • 1343 Posts
  • 151 Reply Likes
I don't think it is possible to smartly split the text from one table cell, and place the parts to multiple TextBoxes.

Why do you need to do so? If you just want to put the text from table cell to an "auto wrap" TextBox, you can try using a TextEditBox with "Multirow" option checked, it will wrap the text automatically according to the element width.
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
Sorry, i should try to explain my self better. I haven't planed any text splitting.

the TextEditBox was exactly what i looked for. But i have now this " " instead of spaces. How do i fix this?

how can i hide this element to sclae in the down right corner?

what does "Encrypt" and "caret" do?
and is it normal that "Paint Border" does not scale if TextEditBox is scaled in simulation? (or is this a chrome problem)
Photo of Xavier Young

Xavier Young, Official Rep

  • 1343 Posts
  • 151 Reply Likes
I guess you mean the &nbsp; instead of space. The TextEditBox is an input element and it accept pure text instead of HTML, so &nbsp; will not be recognized as space.

In some web browsers (such as Chrome), the TextEditBox element has a resizer on bottom right corner, which allowing to resize manually. We have no way to remove that resizer. You can use other web browsers to avoid it.

Encrypt option can simulate the password input box.

Caret option can show an caret, telling people that it is accepting input. This is useful for static prototype.

The TextEditBox should not be scaled in simulation, this is just a Chrome stuff.
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
yes i meant nbsp. i have spaces in my tablecell but after set TextEditBox value und tablecell there are the nbsp in.

ah ok thanks for the info.
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
After long time, i am back to this problem.

I can block with and Rectangle Element to funktion (type text, borderlines) of the TextEditBox.
Is there a better solution?

But i have no Idea way all my Spaces in the text were transformed to "nbsp;" when i get the value of the cell direkt.
If i first but the cell to a TextBox and then put the TextBox.text to the TextEditBox it works perfekt.

I also tried to put the cell.value first in to a String but this also didn't worked. What do i to wrong? Or is the step over the TextBox the only way?

Sample:

Text in the Table Cell:
"GnRaiser\, \nnew Linie"

Tabel -> TextEditBox:
"GnRaiser,& n b s p;< b r >new& n b s p;Linie"

Tabel -> TextBox -> TextEditBox:
"GnRaiser,
new Linie"
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
how to i post here text like "& n b s p ;"?
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
Sorry have missed that there the option "Paint Border". Still i think the rectangle is needed so that the text can't be edited.
Photo of ViVi

ViVi, Official Rep

  • 829 Posts
  • 57 Reply Likes
how to i post here text like "& n b s p ;"?
-- You will need to convert your "&" to "&amp;".

Yes the text box with border painted does what you need.
Photo of Yasofies Urason

Yasofies Urason

  • 115 Posts
  • 0 Reply Likes
&amp;nbsp; wow thats a lot of work.

so you think a TextBox would be better then a rectangle? to block the edit funktion of the TextEditBox?