Categories
Mastering Development

React: why the newtasks ( in the checkbox) is undefined?

i’m new in react so i try it doing a tasks application but for some reason when i try to “check” the task i gave an error with the const newTasks ,did i try to give an initial values, and show it by console but just appears that values, can be form the filter metod???? […]

Categories
Mastering Development

Cities data didn’t show in picker

I want to display the cities data in the picker kota/kabupaten but the data does not appear after selecting the province from the picker propinsi. Please help solve this problem here is the code always return null after selecting province: getCitiesData = (currentProvince) => { const cities = {} if (currentProvince) { this.props.cities.forEach(city => { […]

Categories
Mastering Development

Vue router created by API result and reuse of components

I’m fetching an array from an API and adding components to it based on the type. From this I will create the routes for Vue later. Example of the array after I have added components and children to it: [ { id: 1, uri: ‘/’, title: ‘title’, component: require(‘../components/views/type1.vue).default, children: [] }, { id: 2, […]

Categories
Development

Nodejs Express : Cannot read property ‘image’ of null and unhandled error event

I have tried to find out where the wrong is. can anyone please help for this one . if I try to submit the post without an image, this error comes up instead of a flash message: and source code link: https://github.com/rizvi770/cart.git TypeError: Cannot read property ‘image’ of null at /Users/rizvi/Desktop/cart/routes/admin_products.js:115:37 at Layer.handle [as handle_request] […]

Categories
Development

Getting Null Pointer exception and Can’t understand why

My program seems to work fine when scrolling up and down in the main ListView. The problem happens when I open a TitledPane and scroll down or up fast using the mouse scroll-wheel. I also noticed that if I use the mouse to drag the scrollbar after opening a TitledPane, everything works fine. I would […]

Categories
Development

How to get/return total number of items with same id/key in a map?

I’m really confused. I’m able to get the total number of items I have in my list (shopping cart) and the total price of those items added to that list. However, I’m struggling to get the sum of items with the same id key. e.g. id: t1, price: 1, quantity: 0 id: t2, price: 2, […]

Categories
Development

Handling null value inside Map

I’m learning to use BLOC pattern for consume API from newsapi.org. I have result JSON and Model like this from https://newsapi.org/v2/everythingq=flutter&apiKey=7f8eef4261bc4c29b26c4d5e93e8b5d6: Json { “status”: “ok”, “totalResults”: 533, “articles”: [ { “source”: { “id”: “cnn”, “name”: “CNN” }, “author”: “Sandee LaMotte, CNN”, “title”: “Burnout linked to potentially deadly irregular heartbeat, study says”, “description”: “If you’re feeling […]

Categories
Development

How to view and share a pdf from an URL in a react native app?

I have a use-case in my react native app wherein I have to load and display a pdf from an endpoint and also share the same as an attachment(to Gmail app or WhatsApp or even download it) using the native share options (both ios and Android). I’m currently using the react-native-pdf library to load and […]

Categories
CMS Development Wordpress

Adding Amchart Interface to WordPress API

I’m using the amchart wordpress plugin and want to add support for it via the wp rest API. Here’s what I’ve done so far: in ../includes/setup.php (To $args array I’ve added: This will create the /wp/v2/charts route) ‘show_in_rest’ => true, ‘rest_base’ => ‘charts’ There are 4 fields in the plugin, and they are all stored […]

Categories
Development

How to do a Mongo aggregation query in Spring Data?

It’s the first time I am using Mongo in Java and I am having some problems with this aggregation query. I can do some simple queries in Mongo for Spring with @Query annotation in my Repository interface which extends the MongoRepository<T, ID>. It would be helpful to know which approach to take when you do […]