How to access value from react-native-cn-richtext-editor - react-native

I have successfully implemented react-native-cn-richtext-editor with limited toolbar functions.
I want to know that, how to get value (text that we have typed) from editor.
I am new in RN, have tried to get value but didn't get success. How can I resolve this issue, as I want to sent this text to server and then do further process.

In given example of this library there is method onValueChange on change the content object is present in value and to extract the value below example is there
onValueChanged = (value) => {
console.log(value[0].content[0].text)
}

Finally I got the solution of above question.
convert the value in HTML with convertToHtmlString write following command,
let html = convertToHtmlString(this.state.value)
for more details refer this github link

Related

Unable to find element when uploading file in TestCafe

enter image description here
I wrote code below
let browseButton = await Selector('input').withAttribute('id', 'card_image_1583116662160_11.707407693474106');
await t
.click(Selector('.fa.fa-image'))
// upload img
.setFilesToUpload(browseButton,'../../artifacts/uploads/boba.jpg')
but the result is
1) The specified selector does not match any element in the DOM tree.
| Selector('input')
> | .withAttribute('id', 'card_image_1583116662160_11.707407693474106')
It looks like you are trying to use a dynamic ID in your Selector. In this case you should create your Selector based on CSS classes or other non-dynamic attributes. Please refer to this documentation section: https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/.
The following example may be also useful: https://github.com/DevExpress/testcafe-examples/blob/master/examples/element-properties/check-element-markup.js. The example shows how to access DOM properties and verify them with assertions (you can "debug" each level of the Selector hierarchy).
Please let me know if anything remains unclear.
UPDATE: Select Elements With Dynamic IDs
UPDATE 2: RegExp example - Selector('input').withAttribute('id', /card_image_\w+/)

Add target blank to a link in a props in Vue.js

I use the ReadMore plugin to crop articles in a page. The plugin provides a props to redirect to a http link when the "read more" is clicked. But I need to display the link in a new tab. The props receives the link in a string.
I tried several ways to add the target blank attribute to this string before passing it to the props. With no success. Like:
http://www.example.com/page-to-see.html target=_"blank"
I used it with or without quotes but in any case, the link works but the attribute is skipped.
Is there a way to intercept this and add a target blank later?
I saw in other questions the use of router-link but I don't know how to manipulate the props content in the first place.
Any clue would be warmly welcomed
Edit: adding more code to give a clearer explanation of the problem I try to solve:
In the template:
<read-more more-str="read more" :text="dwId.texte" :link="dwId.link" less-str="less" :max-chars="540"></read-more>
I get the values from a DB with Axios. The props are specified by the plugin documentation.
The :link must be a string and it's what it gets from the DB. It works. But as I explained, I need to open in a new tab.
Edit: what I tried:
I try to make a computed property that would add the target blank to a string and use it in the read-more props:
computed: {
target: function() {
return this.dwIds.filter((dwId) => {
return dwId.link + target="_blank"
});
},
}
I have two issues here: first , the result is an object and the props requires a string. Furthermore, the way I add the target blank is not correct but I can't find the right syntax yet.
You need to use it as a directive, and override parts of the initial element you're passing. Otherwise there is no way to "intercept" it. Here's the code to the "component" version that won't do the trick for you.

Make Text Field item as Read Only in APEX 5.0

I have some text field page items on my APEX 5.0 page and I want to make the textboxes as read only/non-editable. During the page load I want to use these text boxes for only the data display on the page and should be non-editable.
Can somebody advice on how to do that? What attributes need to set for this?
This answer is a bit late to the party, but I found myself confronted to this problem and I wanted to share the solution I came up with.
In fact you just need to create your item as a text area, let say P1_Text_Area and you give it a readonly attribute using JavaScript. Write thoses 2 lines in the "Function and Global Variable Declaration" of your page:
var disItem = document.getElementById('P1_Text_Area');
disItem.readOnly = true;
Hope this helps someone in need.
in item properties find the
Read Only group
and set Read Only Condition Type as Always
or the option that suits to you
You can use disabled + save session state ==> read only

How to get all input having the same class, id name in Controller - Laravel 5?

I have function which appends new answer inputs when 'Add answer' button is clicked. In Controller, i want to get the value of all answer inputs with id or class.
Here is the code I am currently using:
<script>
var txt1 = '{!! Form::text('answer1',null,['class' => 'answer']) !!}';
$(document).on('click','#btn1',function(){
$(this).before(txt1);
});
</script>
In Controller, I'm using this:
$input['answer_body'] = Input::get('answer1');
I can get one value according to one id in Laravel, but now i need to get all values that have same id and class.
Could anybody help me?
You can't, the ID and class aren't submitted and so aren't available in the PHP. What you can do is get results by the same name by turning them into an array. Change Form::text('answer1', to Form::text('answer1[]' so that you can submit multiple inputs with the same name.
If you then use $input['answer_body'] = Input::get('answer1');, $input['answer_body'] will have an array in it. You can get specific answers by using dot notation to specify which input you want to get, e.g.: Input::get('answer1.0'); will fetch the value in the first input with a name of answer1[].

angularJS dynamic login page

My code is here: http://plnkr.co/edit/2WDK0b
Is it possible that when I enter an existing username, the message in the "help-block" span will change dynamically?
Just wrap your existing checking code in a function in the controller. Like $scope.checkUsername = function() { //your existing code }
Now on your username input put ng-change="checkUsername()" and then it will work.
Before you get too much further make sure to read the validation bits from the Angular Form's guide: http://docs.angularjs.org/guide/forms
Here's a fiddle of your code working: http://plnkr.co/edit/LwMJGq?p=preview Although I think the logic for the name checking needs a bit of work.