Skip to main content
Inspiring
June 15, 2020
Answered

Getting [object EditText] and not variable value

  • June 15, 2020
  • 3 replies
  • 478 views

After some great help I am getting there but I now have a text input fiels but the value is not being passed and I get [object EditText] instead of the text that was input

 

	var win = new Window('dialog','Text Options');
	win.orientation='column';
	
	win.alignChildren = 'left';
		
	win.pnl3 = win.add('panel',[0,0,400,50],'Details', {borderStyle: 'black'} );
	win.pnl3.alignChildren = 'left';
	var Detail = win.pnl3.add('edittext', [10,10,380,30], 'enter details');
//	var Detail = 'enter details';
	
	win.pnl1 = win.add('panel',undefined,'Text Colour', {borderStyle: 'black'} );
	win.pnl1.alignChildren = 'left';
	win.pnl1.rb1 = win.pnl1.add('radiobutton',undefined,'White');
	win.pnl1.rb1.value=true;
	win.pnl1.rb2 = win.pnl1.add('radiobutton',undefined,'Black');
	win.grp1 = win.add('group');

	win.pnl2 = win.add('panel',undefined,'Text Stroke', {borderStyle: 'black'} );
	win.pnl2.alignChildren = 'left';
	win.pnl2.rb1 = win.pnl2.add('radiobutton',undefined,'On');
	win.pnl2.rb1.value=true;
	win.pnl2.rb2 = win.pnl2.add('radiobutton',undefined,'Off');
	win.grp2 = win.add('group');
	win.select = win.grp2.add('button',undefined,'Ok');
	win.can = win.grp2.add('button',undefined,'Cancel');
	win.select.preferredSize = win.can.preferredSize=[70,20];

	var myReturn = win.show();
	if (myReturn == true) {
	if(win.pnl1.rb1.value == true){
	//Radio button 1
	var textColor = new SolidColor();  
	textColor.rgb.red = 255;
	textColor.rgb.green = 255;
	textColor.rgb.blue = 255;   
	}
	else if(win.pnl1.rb2.value == true){
	//Radio button 2
	var textColor = new SolidColor();  
	textColor.rgb.red = 0;
	textColor.rgb.green = 0;
	textColor.rgb.blue = 0; 
	}

	if(win.pnl2.rb1.value == true){
	var strokeOn =  1; 
	}
	else if(win.pnl2.rb2.value == true){
	var strokeOn = 0; 
	}
	
	};

 

This topic has been closed for replies.
Correct answer Manan Joshi

Use the following

FlashDetail.text

 

-Manan

3 replies

Kukurykus
Legend
June 15, 2020

It could be asked in Pass variable to script as its continuation.

c.pfaffenbichler
Community Expert
Community Expert
June 15, 2020

I don’t see where you collect or otherwise use the text from 

 

win.pnl3.

 

in the code, something like

 

var theString = dlg.pnl3.text;

 

?  (edited)

Inspiring
June 15, 2020

apologies I missed out where and how it was being used in my problem description

Manan JoshiCommunity ExpertCorrect answer
Community Expert
June 15, 2020

Use the following

FlashDetail.text

 

-Manan

-Manan
Inspiring
June 15, 2020

It was use of .text after the variable that I was missing, many thanks