Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Framework » Multi-Line Text Box
Multi-Line Text Box [message #5834] Wed, 17 August 2016 05:13 Go to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Did you something change with the multi-line text box? In the detail view I only see one line. In the dictionary configuration I set it to 3 lines, 1 row.

Here the dict.inc entry:

$fieldspec['text']= array('type' => 'string',
'size' => 65535,
'required' => 'y',
'control' => 'multiline',
'cols' => 1,
'rows' => 3);
  • Attachment: multiline.jpg
    (Size: 12.11KB, Downloaded 1468 times)
Re: Multi-Line Text Box [message #5835 is a reply to message #5834] Wed, 17 August 2016 11:29 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
It works fine on my PC, and also in the demo system at http://www.radicore.org/demo.php. Logon, go to the MENU => Pattern, select an entry and press "Read" and you will see that the "Long Description" field has multiple lines.

I would suggest that the change the value of 'cols' to a reasonable width, such as 70 or 80.


Re: Multi-Line Text Box [message #5841 is a reply to message #5835] Thu, 18 August 2016 05:49 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Thank you. The change to 80 cols was successful.
Re: Multi-Line Text Box [message #7487 is a reply to message #5835] Tue, 16 June 2020 15:41 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Can I change the height of a multi-line Text Box in a list view (list1 or list2) to the height of 1 line? At the moment the height is as big as the number of rows I inserted in the Data Dictionary.
And can I change the color of the field into grey as in the other columns?
See attached picture.

[Updated on: Tue, 16 June 2020 15:42]

Report message to a moderator

Re: Multi-Line Text Box [message #7488 is a reply to message #7487] Wed, 17 June 2020 04:29 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
You can change the height of a multi-line text box by changing the value for 'rows' in the $fieldspec array for that field. You can do this in the _cm_formatData() method.

If you want to change a field's colour then you have to do this with CSS. See FAQ73 for details.


Re: Multi-Line Text Box [message #7489 is a reply to message #7488] Fri, 19 June 2020 07:07 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Thank you for the information. The field height could I generate with the _cm_formatData() method.

Up to now I haven't worked with CSS. I have to learn about this instrument. Is it right that there is a main css file where you inserted all the settings? If yes, what's the name of this file?

And is there an example of a style_custom.css file?
Re: Multi-Line Text Box [message #7490 is a reply to message #7489] Sat, 20 June 2020 04:20 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
In each subdirectory there is a file called style_custom.css (which is derived from style_custom.default.css) into which you can insert any css directives in order to override the standard framework values. You will need to learn CSS before you know what changes to make.

Re: Multi-Line Text Box [message #7491 is a reply to message #7490] Sun, 21 June 2020 07:47 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Thank you. I will do so.
Re: Multi-Line Text Box [message #7492 is a reply to message #7490] Fri, 26 June 2020 06:30 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Do you have an example of _cm_formatData() where you call the $css_array()?

I created the above entry in style_custom.css and want to call this in _cm_formatData() with the line: $css_array['bewertung_text'] = 'textarea.mltb'; But nothing happens.
Only changes in css\default.css change the look of the textarea. What is wrong with my code?

textarea.mltb {
background-color: green;
color: black;
border: #000000 0px solid;
font-size: 100%;
overflow: auto;
}
Re: Multi-Line Text Box [message #7493 is a reply to message #7492] Sat, 27 June 2020 04:36 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
You do not "call" the $css_array, you simply insert an entry as described in FAQ73. If the field is called 'bewertung_text' and the class name is 'mltb' then the code you need is
$css_array['bewertung_text'] = 'mltb';
Note that the class name is not 'textarea.mltb' as 'textarea' is the element name and 'mltb' is the class.


Re: Multi-Line Text Box [message #7494 is a reply to message #7493] Mon, 29 June 2020 06:26 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Thank you. It works now. I always inserted the element name and the class name.
Re: Multi-Line Text Box [message #7495 is a reply to message #7494] Tue, 30 June 2020 04:33 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
It took me some while to learn the intricacies of CSS myself. For example, textarea.mltb defines the class mltb which applies only to element textarea, but if you defined it only as .mltb this could be applied to any element.

Re: Multi-Line Text Box [message #7496 is a reply to message #7495] Tue, 30 June 2020 06:29 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Thank you for the hint. I changed it. If you read the documentation you don't always understand what the differences are, unfortunately ....
Re: Multi-Line Text Box [message #7497 is a reply to message #7495] Tue, 30 June 2020 09:08 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Is there a possibility to format some words or lines in a textarea in a different color or font size?
Re: Multi-Line Text Box [message #7498 is a reply to message #7497] Wed, 01 July 2020 04:40 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
This can be done, but not easily. Simply inserting HTML tags into the text will not work as '<' and '>' characters will be translated into '&lt;' and '&gt;'. You can, however, use a javascript editor such as fckeditor or tinymce. If you visit the demo app and go into the 'Example Subsystem', then choose 'List Person' followed by 'Update (js)' you will see two additional navigation buttons called 'Update (fckeditor)' and 'Update (tinymce)' which provide working examples.

Re: Multi-Line Text Box [message #7499 is a reply to message #7498] Thu, 02 July 2020 06:56 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Great! Thank you. I will try to insert it in my application, too.
Re: Multi-Line Text Box [message #7504 is a reply to message #7498] Thu, 30 July 2020 03:37 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
I copied the code of your working example ('Update (fckeditor)' - x_person_s03.class.inc) into my task and changed the field name from 'fckeditor_text' to 'bericht_text' in $code. But the Javascript toolbar and the textarea aren't shown in the screen.

In the html source code is only the line: <div class="main"><table></table></div> without the <colgroup> specifications and the table rows as in your example.

I copied the javascript directory from xample to my subdirectory (htm).

Do I have to change somewhere a configuration setting? Or do I have to build the javascript directory from scratch?
Re: Multi-Line Text Box [message #7505 is a reply to message #7504] Thu, 30 July 2020 05:14 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
Did you install and run the EXAMPLE application that was supplied in the download? This works in my RADICORE website, so it should work in your local installation.

Re: Multi-Line Text Box [message #7506 is a reply to message #7505] Fri, 31 July 2020 06:54 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Yes. The EXAMPLE application works fine in my local installation. I can change the field fckeditor_test as I want. I see the toolbars (fck and tinymce) and I can change color, style and size of the characters/words.
If I type in the path of the ckeditor.js file in the browser I can see the text of this file in the browser in my application as well as in the xample application.
If you say install: I extracted the files coming with the download. Do I have to sign in my application somewhere? Maybe the path in the config file or something else?
Re: Multi-Line Text Box [message #7507 is a reply to message #7506] Sat, 01 August 2020 04:49 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
The XAMPLE subsystem has its own javascript directory in which there are separate subdirectories for tiny_mce and ckeditor. The class file 'x_person_s03.class.inc' uses the ckeditor library while 'x_person_s05.class.inc' uses the tiny_mce library. You can see the relevant code in the '_cm_setJavaScript()' method. If you want you can move these two subdirectories from 'radicore/xample/javascript' to 'radicore/javascript', but you will have to amend the path in your code.

Re: Multi-Line Text Box [message #7508 is a reply to message #7507] Sun, 02 August 2020 08:05 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
I copied these two directories into my htm application directory and amended the path in my code. The source code of the site is:

<script src=" HTTP://localhost/radicore/htm/../javascript/jquery-3.3.1.sli m.min.js"> </script><script src=" HTTP://localhost/radicore/htm/../javascript/jquery.cookie.mi n.js"> </script><script src=" HTTP://localhost/radicore/htm/javascript/ckeditor/ckeditor.j s"> </script><script>window.onload = function()
{
CKEDITOR.replace( 'bericht_text',
{
toolbar : 'Basic',
uiColor : '#9AB8F3'
});
}
</script>

If I press the links to javascript files like ckeditor.js I see the the content of these files in the browser. Exact the same as in the XAMPLE source code. Is there an additional file or directory which I have to copy?
Re: Multi-Line Text Box [message #7509 is a reply to message #7508] Sun, 02 August 2020 13:37 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
If you can run the javascript editor in the XAMPLE subdirectory without problems, but you have problems when running the same code in your own subdirectory then there is something different. You need to obtain the HTML source from both subsystems and look for differences.

Re: Multi-Line Text Box [message #7510 is a reply to message #7509] Tue, 04 August 2020 06:58 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
I found my fault. I used the wrong table in the screen file. Now I can see the toolbar and change the words, characters etc.

But if I output the text as a pdf I see the html tags like <p> and <color> and so on. What can I do to see the formatted text in the pdf output?
Re: Multi-Line Text Box [message #7511 is a reply to message #7510] Tue, 04 August 2020 13:07 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
Unfortunately when text is written out to a PDF file it cannot understand any HTML tags or CSS classes, so cannot reproduce the formatting you can see in a web page. The only thing you can do is use strip_tags() to remove the tags and display just plain text.

Re: Multi-Line Text Box [message #7512 is a reply to message #7511] Tue, 04 August 2020 16:16 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Okay. Thank you. That's very pity. Do you know a work-around to achieve this? Maybe export and then import in OpenOffice or somewhere else?
Re: Multi-Line Text Box [message #7513 is a reply to message #7512] Wed, 05 August 2020 04:22 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
I'm afraid that I do not know of any software that can take text with HTML/CSS tags and convert it so that it looks the same when rendered in something other than a web browser.

Re: Multi-Line Text Box [message #7514 is a reply to message #7513] Wed, 05 August 2020 17:01 Go to previous message
htManager is currently offline  htManager
Messages: 434
Registered: May 2014
Senior Member
Okay. Thank you for the information. Then I have to use the multi-line-textbox only with html without Javascript because I have to output it as a pdf. Maybe sometimes this will be possible....
Previous Topic: Frameworkd Update
Next Topic: Key value / special characters /add4
Goto Forum:
  


Current Time: Sat Nov 23 07:13:31 EST 2024

Total time taken to generate the page: 0.01835 seconds