Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

5.3 version of XLite\View\FormField\Textarea\Simple

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-30-2017, 11:44 PM
 
BurtonTech BurtonTech is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 46
 

Default 5.3 version of XLite\View\FormField\Textarea\Simple

Hello,

I would like one of my fields I'm adding to be a simple textarea. In 5.2 I used:

Code:
XLite\View\FormField\Textarea\Simple

I'm having trouble locating the 5.3 equivalent although the advanced text area works fine:

Code:
'type' => 'XLite\View\FormModel\Type\TextareaAdvancedType'

I don't want any of the markup from the WYSIWYG editor. Any guidance is appreciated!

Thank you.
__________________
X-Cart Gold 4.4.5
X-Cart Ultimate 5.2.22
X-Cart Business 5.3.2.13
X-Payments 3
Reply With Quote
  #2  
Old 05-03-2017, 05:05 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: 5.3 version of XLite\View\FormField\Textarea\Simple

I believe you can use older classes via "XLite\View\FormModel\Type\OldType" type.
Here is an example from the source code:
PHP Code:
// ...
                
'images'             => [
                    
'label'        => static::t('Images'),
                    
'type'         => 'XLite\View\FormModel\Type\OldType',
                    
'oldType'      => 'XLite\View\FormField\FileUploader\Image',
                    
'fieldOptions' => ['value' => $images'multiple' => true],
                    
'position'     => 300,
                ],
// ... 

So, you may try something like this with 'oldType' => 'XLite\View\FormField\Textarea\Simple'.
I think this should work.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 05-03-2017, 08:20 AM
 
BurtonTech BurtonTech is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 46
 

Default Re: 5.3 version of XLite\View\FormField\Textarea\Simple

Quote:
Originally Posted by qualiteam
I believe you can use older classes via "XLite\View\FormModel\Type\OldType" type.
Here is an example from the source code:
PHP Code:
// ...
                
'images'             => [
                    
'label'        => static::t('Images'),
                    
'type'         => 'XLite\View\FormModel\Type\OldType',
                    
'oldType'      => 'XLite\View\FormField\FileUploader\Image',
                    
'fieldOptions' => ['value' => $images'multiple' => true],
                    
'position'     => 300,
                ],
// ... 

So, you may try something like this with 'oldType' => 'XLite\View\FormField\Textarea\Simple'.
I think this should work.

I had tried that, and it does produce a simple textarea field, but unfortunately it would not populate or save the data. Do I need to use any particular fieldOptions because I did not include that parameter.
__________________
X-Cart Gold 4.4.5
X-Cart Ultimate 5.2.22
X-Cart Business 5.3.2.13
X-Payments 3
Reply With Quote
  #4  
Old 05-03-2017, 11:31 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: 5.3 version of XLite\View\FormField\Textarea\Simple

I can't find examples in the source code, but it may be that you should specify your "fieldName" in the "fieldOptions" array.

Check the HTML source code of the page when you use TextareaAdvancedType and compare the "name" attribute of the text area with the one that is used when you change the type to OldType.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:40 AM.

   

 
X-Cart forums © 2001-2020