ADF RichTextEditor autosubmit doesn't work in Google Chrome - google-chrome

I'm facing a problem when using the RichTextEditor with autosubmit="true" in JDev 12c. The component is added programmatically on a form.
In Firefox the autosubmit fires correctly for any  kind of action (e.g.: typing, changing text style, etc)
On the other side in Chrome, not every action fires the autosubmit. For example, typing some text would fire the autosubmit, but then selecting the text and changing the color or the font size for example, doesn't fire a value change event / autosubmit.
Has anyone else encountered this type of behavior before?
Thanks in advance!

I had the same problem as well, RichTextEditor's text is very difficult to erase the content or reset programatically too,
I advise to use other text tools like the very known RichTextArea:
// Create a rich text area
final RichTextArea rtArea = new RichTextArea();
rtArea .setCaption("My Rich Text Area");
// Set initial content as HTML
rtArea .setValue("<h1>Hello</h1>\n" +
"<p>This rich text area contains some text.</p>");
Then you could resize it to the size of the RichTextEditor and give it the same visual color by some tricks through js and css as usual.

Related

Autodesk forge viewer set toolbar button text without css

I have a bunch of buttons I am adding to the toolbar in the viewer that I want text for instead of an icon. For the majority of cases I have been able to just add the text by setting content on the .adsk-button-icon:before which has worked perfectly although im not a huge fan of having the text set in the css file but it works.
I am now looking at adding buttons to the toolbar that will get the text when the viewer is loaded so I can not add the text via css beforehand.
Currently the only way I can see of doing this is creating the styles with JS or adding inline styles with JS which if possible I want to avoid. Is there a way to set a text (or better yet html) to the button or is there a control better suited for this.
https://forge.autodesk.com/en/docs/viewer/v2/reference/javascript/control/

How can I get the markup's core extension to automatically close the text area it creates?

The MarkupsCore extension automatically creates a text area when you click that you enter text into. Now, I automatically insert text into this text area, but cannot find out how to close it programatically. After going through the source a little bit, it seemed like the text area was a little bit custom as I saw there were some custom implementations of the backspace button, etc. So, I assumed there was a different event.
It seems to happen when you focus out of the element, but that event didn't seem to do it either. In version 3 (or maybe it was earlier, I can't remember), you used to press the enter key. Now you just focus out.
So, what event needs to be fired in order to tell the extension to close the text area and create the markup?
Try the following...
Using the 'markupscore' object, send a 'mouse down' event with 'target:null' like this...
markupscoreExt = viewer.getExtension("Autodesk.Viewing.MarkupsCore")
markupscoreExt.onMouseDown({target:null})
As you are in the middle of typing some text, you can trigger the mouse down event to complete the text.
Let me know if that helps.
Cheers
Michael

infopath forms textbox word wrap chrome

The textbox in infopath form does not word-wrap the text in Chrome, but does it on IE? I have the multi-line setting checked on the text box. any idea?
Thanks in advance.
Upload a new css file to the “Style Library”.
File should contain the following:
textarea { white-space: pre-wrap !important; word-wrap: break-word
!important; }
Go to Site Settings – Look and Feel – Master Page
Set the Alternate CSS URL to point to the new CSS file that was added to the “Style Library”
Make sure to check “Reset all subsites…..”
Save and issue should be resolved for both Chrome and Firefox
You will have to replace the Text Box Control with a Rich Text Box Control and reconfigure the setting in the new control. You can rename the Rich Text Box control with the same field name after you delete the Text Box Control.
This is just common to Chrome right now, but Edge and Safari, could make the same changes, so might as well make the change to the form. Common to all three is they won't update a form when you make a change to the form.
You can add a "Query a Data Connection Rule" to another control (like a button) and when you use that control it will contact the server and update the form. If you use the same control on different views in the same form it seems to continue working, trial and error on that.
I assume Edge and Safari will make changes similar to Chrome, so you might as well change the Text Box to Rich Text. I have 300 controls to change. Good luck.
I have done it two different ways. I wanted to target only specific forms rather than spend a lot of time on it or do it in master page, I created CSS using Code from solution #1, then dropped it in the site assets library. After that I edited the InfoPath Forms SharePoint Web Part page, added a Content Editor Web Part to the page at bottom after the InfoPath Form Web Part, linked the new Content Editor Web Part to the CSS file, changed the Content Editor Web Part settings to not be seen, etc. and saved the Content Editor Web Part, Then Saved the Web Part Page.
Another way I have done this is added a Rich Text Editor Control to the InfoPath Form, then hide the original Text Box Control and set the Text box control default value to that of the Rich Text Editor Control. Sometimes this is quicker and easier than redoing all the business logic, especially if you are trying to go to PowerApps and get away from InfoPath, don't waste as much time on it. Obviously the drawback is increasing the number of SharePoint fields and fields in the form as well.
Best Regards.
SG.
Add a style.
textarea { white-space: pre-wrap !important; word-wrap: break-word !important; }
using script editor WP

Is it possible to reset the style of content only for copying?

I've been asked to fix a few bugs on a website, and one of them is throwing me for a loop. Due to the style layout of this particular site, when a user selects and copies text from a specified area, they copy rich text data which if pasted into a rich text editor, results in a large black text on black-background blob.
Ideally, I would like to strip all style data, or somehow enable plain text copying on a particular set of data.
Is this possible? Or would I have to resort to something like a a Flash applet like what GitHub uses for Git URLs?
If you're happy with using JavaScript to solve the problem you can capture the "oncopy" events (credit to #FirstZero) on the elements you wish to restyle, and then restyle the element using JavaScript and style it back again after a timeout.
If you are okay using jQuery you can use JavaScript similar to the following:
$('p').bind(
'copy',
function(e) {
var copyElem= $(e.target);
var defaultColor = copyElem.css('color');
copyElem.css('color', 'pink'); // Change the color to pink for copy
window.setTimeout(
function() {copyElem.css('color', defaultColor);}, // Change it back
1
);
}
);
(Try it out in jsFiddle)
Note that this would be neater if there existed an onaftercopy event, but unfortunately there doesn't seem to.
I've only tested the above solution in Chrome, but it should work in Firefox (since 3.0), latest versions of Chrome and Safari, and in Internet Explorer. It will probably not work in Opera.
Many many years ago, I made a custom form that replicated the look of a menu on a video game. At the time, Firefox didn't allow many form UI widgets (Firefox 2.something?) to be styled with CSS. Apparently in the last few years that has changed.
What I wound up doing to resolve this problem was creating a very large input text-box with the content passed in via the value="" attribute. (<input type="text", not <textarea)
Despite the ability to style input boxes and their content, this information is not retained when copying the text itself. So I completely side-stepped the issue, and the fixes are live!
It was quite a bit simpler too, absolutely no-JS required.

HTML and Flex Focus Problem

I have a web page which has a SWF file embeded. I have an issue with the focus.
Click on a HTML Text Field and Click on a Flex Field.
Begin to type a text.
Expected Result is the entered text should go in the Flex TextInput field but the
actual Result is it goes into HTML text field.
to me it sounds like something related to wmode in the embedding code, I would try to play around with that, I have found flash to be very problematic when replacing between wmodes.