replaceSelectedText not working correctly in RTF area

I have a form for consultants to enter clinical notes about patients into a TEXT AREA.
To make their life easier, I have a related table view to the side of the notes to allow the user to click a button to insert a set phrase into the notes at the current cursor location or over the currently selected text using the ‘replaceSelectedText’ function for the note element.
This works perfectly if the note element is set to a TEXT AREA, but my client wants to be able to format the notes, so I set it to RTF AREA, but then the replaceSelectedText function only inserts the text at the start of the note, not at the cursor or over selected text as it should.
I see in the forums that Marcel from IT2Be had this issue in 2003
http://www.servoy.com/forum/viewtopic.php?f=2&t=587&hilit=replaceSelectedText+rtf
but would have hoped that Servoy might have fixed it by now 8-)

This is happening in Servoy 5.1.0 & 5.1.2.

Anyone had this as well or know the solution, or is it a bug?

Let me know if I need to (complete) a Support Case on this?

Thanks,
Rafi

if i look quickly to the code then for a RTF area is should support replaceSelectedText
please make a case.

Hi

jcompagner:
if i look quickly to the code then for a RTF area is should support replaceSelectedText
please make a case.

will do (as soon as I have time…)
I need to make a quick example solution to demo it, as the existing solution would be too complex to send you with data etc.

Thanks

Rafi

jcompagner:
please make a case.

Case 288480

Thanks

rafig:

jcompagner:
please make a case.

Case 288480

Thanks

Will be fixed in Servoy 5.1.3 .

lvostinar:
Will be fixed in Servoy 5.1.3 .

Great!

Any time frames on 5.1.3, as this bug is in a system that is meant to be going live in a couple of weeks time and I would like to have it working by then?

Thanks

Rafi

rafig:

lvostinar:
Will be fixed in Servoy 5.1.3 .

Great!

Any time frames on 5.1.3, as this bug is in a system that is meant to be going live in a couple of weeks time and I would like to have it working by then?

Thanks

Rafi

There is no time frame set yet, but probably it will be released within a couple of weeks.

lvostinar:
There is no time frame set yet, but probably it will be released within a couple of weeks.

Thanks…

I’m having the same issue in 5.2.8 with a text field.

.replaceSelectedText(myTime);

is not working when I try to hit the field directly or use a variable for field name:

var gElementName = "";

function addTime() {
	var myTime = utils.dateFormat(new Date(), 'hh:mm a');
	application.setClipboardContent(myTime);
	elements[gElementName].replaceSelectedText(myTime);
	//elements.finish_time.replaceSelectedText(myTime);
	databaseManager.saveData();
}

It works when I set a break point!

Providence1:
I’m having the same issue in 5.2.8 with a text field.

.replaceSelectedText(myTime);

is not working when I try to hit the field directly or use a variable for field name:

var gElementName = "";

function addTime() {
var myTime = utils.dateFormat(new Date(), ‘hh:mm a’);
application.setClipboardContent(myTime);
elements[gElementName].replaceSelectedText(myTime);
//elements.finish_time.replaceSelectedText(myTime);
databaseManager.saveData();
}




It works when I set a break point!

Please open a case in our support system: http://www.servoy.com/s

Case # 399750 Fix will be available in Servoy 5.2.10

Thanks guys!