change the value in jsonresponse for particular user - flutter

{
"User": {
"id": "iERl6YK6mEmzpotHBvVBiA",
"lastUpdated": 1643789241,
"userInputWeightInKG": "70",
"hasPhoto": true,
"introDone": true,
"photoTime": 1643621107,
"photofmt": "png",
"firstName": "new user",
"lastName": "new user",
"dateOfBirth": "01/31/1994",
"email": "newuser123#gmail.com",
"gender": "m",
"heightMeters": 1.7,
"fingerPrint": "",
"aadhaarNumber": "",
"mobileNumber": "2159863566",
"higiScore": 200.0,
"user_score": {
"A1": 23,
"A2": 8,
"A3": 13,
"A4": 28,
"A5": 8,
"A6": 28,
"A7": 8,
"A8": 23,
"B1": 28,
"B2": 28,
"B3": 28,
"B4": 28,
"C1": 22,
"C2": 8,
"C3": 8,
"C4": 8,
"C5": 22,
"D1": 19,
"D2": 19,
"D3": 19,
"D4": 19,
"E1": 0,
"E2": 0,
"E3": 0,
"E4": 0,
"T": 408
},
"accountCreated": "/Date(1643621096288+0530)/",
"termsHistory": [
{
"termsAgreedDate": "/Date(1643621116912+0530)/",
"termsFileName": "termsofuse_v9_01122016"
}
],
"terms": {
"termsAgreedDate": "/Date(1643621116912+0530)/",
"termsFileName": "termsofuse_v9_01122016"
},
"privacyAgreed": {
"privacyAgreedDate": "/Date(1643621116912+0530)/",
"privacyFileName": "privacypolicy_v7_08112014"
},
"privacyAgreedHistory": [
{
"privacyAgreedDate": "/Date(1643621116912+0530)/",
"privacyFileName": "privacypolicy_v7_08112014"
}
],
"Notifications": {
"EmailCheckins": "true",
"EmailMonthlyRecap": "true",
"EmailHigisphereNotifications": "true",
"EmailHigiNews": "true",
"EmailMonthlyDigest": "true"
},
"currentHigiScore": 0.0,
"hasPassword": true,
"privacy": {
"leaderBoard": {
"enabled": false
},
"thirdPartySharing": {
"nonIdentifiableSharing": true
}
},
"tags": {
"isEarndItUser": false,
"testTag1": 12345
},
"joint_user_detail_list": {
"joint_user1": {
"ihl_user_id": "17Jf3sYhwkGjNaAPPvZugQ",
"ihl_user_name": "firstuser",
"status": "requested",
"vital_read": true,
"vital_write": true,
"teleconsult_read": true,
"teleconsult_write": true
},
"joint_user2": {
"ihl_user_id": "n9RFAVPnvEitJhESoTnFtg",
"ihl_user_name": "seconduser",
"status": "Active",
"vital_read": true,
"vital_write": true,
"teleconsult_read": true,
"teleconsult_write": true
}
}
}
}
This is my response from api..
i have to change the "joint_user2": status of guest user to from "Active" to "Inactive" if i click on that second user in UI
how can i do that
please help

I would suggest creating a class which stores your user data. Then, using a fromMap() or fromJSON() method, you can create an object from your API response. You can have a look at the JSON Serialiser on pub.dev (https://pub.dev/packages/json_serializable).
After that, changing any of the values of that object becomes trivial.
onPressed: () {
guestUser.status = 'Inactive' / UserStatus.Inactive ;
}
I would recommend using enums or some other set value type rather than a string, if you need to perform operations on the guest user's status.

Related

How to add user in category by filters flutter?

Here I'm registering users by category from the app but can't register. But when I register a user from postman it can. What is the issue, kindly help me on this. Thanks.
Here is the scenario.
Here are id's for categories
{
"total": 6,
"per_page": 15,
"current_page": 1,
"last_page": 1,
"next_page_url": "",
"prev_page_url": "",
"from": 0,
"to": 6,
"success": true,
"en_message": "",
"ar_message": "",
"data": [
{
"id": 3,
"ar_name": "ستوديو",
"en_name": "Studio",
"photo": "http://newprotectco.com/hello/SD08/msf/Untitled-2-06.webp",
"parent": 0,
"parent_details": null
},
{
"id": 4,
"ar_name": "تطبيقات الموبايل والويب",
"en_name": "Web & App",
"photo": "http://newprotectco.com/hello/SD08/msf/Untitled-2-07.webp",
"parent": 0,
"parent_details": null
},
{
"id": 2,
"ar_name": "طباعة الصحيفه",
"en_name": "Printing Press",
"photo": "http://newprotectco.com/hello/SD08/msf/Untitled-2-05.webp",
"parent": 0,
"parent_details": null
},
{
"id": 5,
"ar_name": "الفعاليات",
"en_name": "Events",
"photo": "http://newprotectco.com/hello/SD08/msf/Untitled-2-08.webp",
"parent": 0,
"parent_details": null
},
{
"id": 1,
"ar_name": "التواصل الاجتماعي",
"en_name": "Social Media",
"photo": "http://newprotectco.com/hello/SD08/msf/Untitled-2-04.webp",
"parent": 0,
"parent_details": null
},
{
"id": 6,
"ar_name": "التصميم الداخلي",
"en_name": "Interior Design",
"photo": "http://newprotectco.com/hello/SD08/msf/Untitled-2-09.webp",
"parent": 0,
"parent_details": null
}
],
"status": 200
}
When I register a user by category from postman It can be.
I'm only adding field for category where I'm facing issues and the rest are working.
Category filed form postman
From the application when I try to register it doesn't show. Why?
Map<String, String> bdy = {
"name": companyName,
"username": email,
"password": password,
"phone": phone,
"trade_license": tradeLicence,
"category_id": categories,
};
Where categories are in drop down like this.
List<String> category = [
'Social Media',
'Printing Press',
'Studio',
'Web & App',
'Events',
'Interior Design',
];
String? selectedCategory;
void _agencyRegistration() {
else if ((selectedCategory ?? "").isEmpty) {
Utils.flushBarErrorMessage(LanguageStringKeys.instance.TypeYourField.tr, context);
}
Provider.of<AgencyRegistrationService>(context, listen: false).doSignUp(
context,
companyName,
email,
password,
phone,
(selectedCategory?? ""),
image,
);
DropdownButtonFormField(
isExpanded: true,
decoration: textFormFieldsDecoration(
LanguageStringKeys.instance.Category.tr,
AppColors.fIconsAndTextColor,
AppColors.fIconsAndTextColor,
),
items: category
.map((item) => DropdownMenuItem(
value: item,
child: Center(child: SmallText(text: item, color: Colors.black)),
))
.toList(),
value: selectedCategory,
onChanged: (item) => setState(() => selectedCategory = item as String?)),
}

Remove empty space from Streamlit Echarts

I am rendering a gauge component in the following way, within my Streamlit app:
option = {
"series": [
{
"type": "gauge",
"startAngle": 180,
"endAngle": 0,
"min": min_range_val,
"max": max_range_val,
"center": ["40%", "40%"],
"splitNumber": 5,
"axisLine": {
"lineStyle": {
"width": 6,
"color": [
[0.25, "#FF403F"],
[0.5, "#ffa500"],
[0.75, "#FDDD60"],
[1, "#64C88A"],
],
}
},
"pointer": {
"icon": "path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",
"length": "12%",
"width": 30,
"offsetCenter": [0, "-60%"],
"itemStyle": {"color": "auto"},
},
"axisTick": {"length": 10, "lineStyle": {"color": "auto", "width": 2}},
"splitLine": {"length": 15, "lineStyle": {"color": "auto", "width": 5}},
"axisLabel": {
"color": "#464646",
"fontSize": 12,
"distance": -60,
},
"title": {"offsetCenter": [0, "-20%"], "fontSize": 20},
"detail": {
"fontSize": 30,
"offsetCenter": [0, "0%"],
"valueAnimation": True,
"color": "auto",
"formatter": "{value}%",
},
"data": [{"value": value, "name": caption}],
}
]
}
st_echarts(option, width="450px", height="350px", key="gauge")
However, it seems like an additional empty extra white space is added at the bottom of the component (as from the following image).
How can I effectively remove that and keep only a tiny margin all around the gauge?
The following parameters must be added:
radius: '120%',
center: ['50%', '80%']
The latter one should be adjusted according to specific use cases.

Alexa fails to send skill request after connecting to MongoDb

I have a strange thing going on in my Alexa skill. My skill requires to connect with MongoDB and save data. Whenever I connect to database, Alexa is giving me this response: "There was a problem with the requested skill's response". It is completely weired because few days ago my database and Alexa skill were perfectly working. Now, suddenly, I don't get any response from Alexa even though my database in connected and creats documents.
Below is my JSON INPUT and code from the Launchrequesthandler :
{
"version": "1.0",
"session": {
"new": true,
"sessionId": "amzn1.echo-api.session.b163d6da-ab3d-483c-ba19-60156810739c",
"application": {
"applicationId": "amzn1.ask.skill.bd7f1ea6-53ab-41af-9a59-4853d4906373"
},
"user": {
"userId": "amzn1.ask.account.AFMYVNKRB3REUKGDDLGIFOYXR53ISFLYHQJXHO2YDRYVQCPCRLYQFIVLBE5HDXH6FNMTMN4YLXHR6ZMSJEFQ3Y2BRI76N2FHSHDXAWUPVFB6JKWSRTPA7EWOH6ZOF24KY5DXUBA3UMUY3TNQZ42AOOFESTFWW6VLTU63AHHQMMPKA74M2WX66TN4IYOZUNLMBXMX3LCUBWPO4FY"
}
},
"context": {
"Viewports": [
{
"type": "APL",
"id": "main",
"shape": "RECTANGLE",
"dpi": 213,
"presentationType": "STANDARD",
"canRotate": false,
"configuration": {
"current": {
"mode": "HUB",
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
},
"size": {
"type": "DISCRETE",
"pixelWidth": 1280,
"pixelHeight": 800
}
}
}
}
],
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 346,
"arcMinuteHeight": 216,
"canRotate": false,
"canResize": false
}
],
"mode": "HUB",
"shape": "RECTANGLE",
"pixelWidth": 1280,
"pixelHeight": 800,
"dpi": 213,
"currentPixelWidth": 1280,
"currentPixelHeight": 800,
"touch": [
"SINGLE"
],
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
}
},
"Extensions": {
"available": {
"aplext:backstack:10": {}
}
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.bd7f1ea6-53ab-41af-9a59-4853d4906373"
},
"user": {
"userId": "amzn1.ask.account.AFMYVNKRB3REUKGDDLGIFOYXR53ISFLYHQJXHO2YDRYVQCPCRLYQFIVLBE5HDXH6FNMTMN4YLXHR6ZMSJEFQ3Y2BRI76N2FHSHDXAWUPVFB6JKWSRTPA7EWOH6ZOF24KY5DXUBA3UMUY3TNQZ42AOOFESTFWW6VLTU63AHHQMMPKA74M2WX66TN4IYOZUNLMBXMX3LCUBWPO4FY"
},
"device": {
"deviceId": "amzn1.ask.device.AHVUJSCJ4KXLFF5SOTIFUCLYUXGBZFLUK3QURQHGX5S7N5E53K7O3ZXEO5V7KFPDR6XPPZECKTX5HEWB3BTLGAM34J7DVPKOALFNNDXCYDUIQWHNH327H3LCV3RNS7XFQLMJ6FXZ36JB5SF3YRUAEULDNIQCBSGZPR7J7KPCGCAHLPJXV5YRA",
"supportedInterfaces": {}
},
"apiEndpoint": "https://api.amazonalexa.com",
"apiAccessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJhdWQiOiJodHRwczovL2FwaS5hbWF6b25hbGV4YS5jb20iLCJpc3MiOiJBbGV4YVNraWxsS2l0Iiwic3ViIjoiYW16bjEuYXNrLnNraWxsLmJkN2YxZWE2LTUzYWItNDFhZi05YTU5LTQ4NTNkNDkwNjM3MyIsImV4cCI6MTYyNjY2MDY3NCwiaWF0Ijo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llEUllWUUNQQ1JMWVFGSVZMQkU1SERYSDZGTk1UTU40WUxYSFI2Wk1TSkVGUTNZMkJSSTc2TjJGSFNIRFhBV1VQVkZCNkpLV1NSVFBBN0VXT0g2Wk9GMjRLWTVEWFVCQTNVTVVZM1ROUVo0MkFPT0ZFU1RGV1c2VkxUVTYzQUhIUU1NUEtBNzRNMldYNjZUTjRJWU9aVU5MTUJYTVgzTENVQldQTzRGWSJ9fQ.MheHasYZKwNcTzwQLjt42C_yujmQJrGGHQ6tvWXt7uNTRzi73-MzzxXMOrztDYaBBCHmHZQS0Qy0-blTfgBT2Yqj5W5gAmcAc_CKKZhh4awlM1xGSAD87kOW8ZiLY2n68IfiKTsUHf6Bp4YiLOMcWWErSTCq91JeYeau0W7B5TvZGTm04OmfK-qkZBVPq6ME8_ulukdZUNxIpVUItkSEuhppcegUcGkzqYdrPRY0BJrsBe-Pytu5xLRiBM3T78nTysnGM288IJSccGJ4rmW4UdzHA_lnH7543QhgU9t71JRncgEDKEsEcVgxs5biFR9il4W8ASfwuDeJhdy8HpiXZw"
}
},
"request": {
"type": "LaunchRequest",
"requestId": "amzn1.echo-api.request.3e29f996-69b2-4e90-bfef-628d74f57307",
"locale": "en-US",
"timestamp": "2021-07-19T02:06:14Z",
"shouldLinkResultBeReturned": false
}
}
//database connection//
const q="mongodb+srv://sumya:sumya123#mydata.acxs0.mongodb.net/Mydata?retryWrites=true&w=majority";
mongoose.connect(q,{ useNewUrlParser: true, useUnifiedTopology: true,useFindAndModify: false })
.then(() => console.log("Database connected!")
)
.catch(err => console.log(err))
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest';
},
async handle(handlerInput) {
const speakOutput = 'Hi, I am Nao. I am here to give you counseling on your anxiety issues. Can I have your name, please? Note: We are not professional therapists or counselors. ';
const useri=handlerInput.requestEnvelope.session.user.userID;
const z=handlerInput.requestEnvelope.session.sessionId;
const g=Alexa.getUserId(handlerInput.requestEnvelope);
const curr_session=new post.session({
alexa_sessionid:z
});
let user=await post.findOne({userID:g});
if(!user){
user=new post({
userID:g
});
}
user.session_list.push(curr_session);
user.save();
return handlerInput.responseBuilder
.speak(speakOutput)
.reprompt(speakOutput)
.getResponse();
}
};
Here is the Log that I got from Cloudwatch.
START RequestId: 6a416b77-5d2c-4ebe-8ac4-dec09f67e9b9 Version: 304
2021-07-19T16:40:00.570Z 6a416b77-5d2c-4ebe-8ac4-dec09f67e9b9 INFO Database connected!
END RequestId: 6a416b77-5d2c-4ebe-8ac4-dec09f67e9b9
REPORT RequestId: 6a416b77-5d2c-4ebe-8ac4-dec09f67e9b9 Duration: 8008.11 ms Billed Duration: 8000 ms Memory Size: 512 MB Max Memory Used: 102 MB Init Duration: 653.49 ms
2021-07-19T16:40:08.023Z 6a416b77-5d2c-4ebe-8ac4-dec09f67e9b9 Task timed out after 8.01 seconds
START RequestId: 4e671447-8207-414e-aaf4-9a807fe3ac01 Version: 304
2021-07-19T16:40:08.894Z 4e671447-8207-414e-aaf4-9a807fe3ac01 INFO ~~~~ Session ended:
{
"version": "1.0",
"session": {
"new": false,
"sessionId": "amzn1.echo-api.session.05ca6843-cdc8-47eb-9a5f-081942cf2674",
"application": {
"applicationId": "amzn1.ask.skill.bd7f1ea6-53ab-41af-9a59-4853d4906373"
},
"user": {
"userId": "amzn1.ask.account.AFMYVNKRB3REUKGDDLGIFOYXR53ISFLYHQJXHO2YDRYVQCPCRLYQFIVLBE5HDXH6FNMTMN4YLXHR6ZMSJEFQ3Y2BRI76N2FHSHDXAWUPVFB6JKWSRTPA7EWOH6ZOF24KY5DXUBA3UMUY3TNQZ42AOOFESTFWW6VLTU63AHHQMMPKA74M2WX66TN4IYOZUNLMBXMX3LCUBWPO4FY"
}
},
"context": {
"Viewports": [
{
"type": "APL",
"id": "main",
"shape": "RECTANGLE",
"dpi": 213,
"presentationType": "STANDARD",
"canRotate": false,
"configuration": {
"current": {
"mode": "HUB",
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
},
"size": {
"type": "DISCRETE",
"pixelWidth": 1280,
"pixelHeight": 800
}
}
}
}
],
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 346,
"arcMinuteHeight": 216,
"canRotate": false,
"canResize": false
}
],
"mode": "HUB",
"shape": "RECTANGLE",
"pixelWidth": 1280,
"pixelHeight": 800,
"dpi": 213,
"currentPixelWidth": 1280,
"currentPixelHeight": 800,
"touch": [
"SINGLE"
],
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
}
},
"Extensions": {
"available": {
"aplext:backstack:10": {}
}
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.bd7f1ea6-53ab-41af-9a59-4853d4906373"
},
"user": {
"userId": "amzn1.ask.account.AFMYVNKRB3REUKGDDLGIFOYXR53ISFLYHQJXHO2YDRYVQCPCRLYQFIVLBE5HDXH6FNMTMN4YLXHR6ZMSJEFQ3Y2BRI76N2FHSHDXAWUPVFB6JKWSRTPA7EWOH6ZOF24KY5DXUBA3UMUY3TNQZ42AOOFESTFWW6VLTU63AHHQMMPKA74M2WX66TN4IYOZUNLMBXMX3LCUBWPO4FY"
},
"device": {
"deviceId": "amzn1.ask.device.AHVUJSCJ4KXLFF5SOTIFUCLYUXGBZFLUK3QURQHGX5S7N5E53K7O3ZXEO5V7KFPDR6XPPZECKTX5HEWB3BTLGAM34J7DVPKOALFNNDXCYDUIQWHNH327H3LCV3RNS7XFQLMJ6FXZ36JB5SF3YRUAEULDNIQCBSGZPR7J7KPCGCAHLPJXV5YRA",
"supportedInterfaces": {}
},
"apiEndpoint": "https://api.amazonalexa.com",
"apiAccessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJhdWQiOiJodHRwczovL2FwaS5hbWF6b25hbGV4YS5jb20iLCJpc3MiOiJBbGV4YVNraWxsS2l0Iiwic3ViIjoiYW16bjEuYXNrLnNraWxsLmJkN2YxZWE2LTUzYWItN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tem4xLmFzay5hY2NvdW50LkFGTVlWTktSQjNSRVVLR0RETEdJRk9ZWFI1M0lTRkxZSFFKWEhPMllEUllWUUNQQ1JMWVFGSVZMQkU1SERYSDZGTk1UTU40WUxYSFI2Wk1TSkVGUTNZMkJSSTc2TjJGSFNIRFhBV1VQVkZCNkpLV1NSVFBBN0VXT0g2Wk9GMjRLWTVEWFVCQTNVTVVZM1ROUVo0MkFPT0ZFU1RGV1c2VkxUVTYzQUhIUU1NUEtBNzRNMldYNjZUTjRJWU9aVU5MTUJYTVgzTENVQldQTzRGWSJ9fQ.d-u2NVM8g_trqjKN_IxpFYy1_Fp-iL6MhTV8uOqScwa-kQF4ax-LzOWKaOE-ZrTW75UGhf6LxNorGxEDDhzNajObdQt9NBGIoM-E-LcLX1rjKvUarDgHvbQFLMt5HzjKNBSJjJ-ZyQodmI-7qDijf5vag3ea6ITEP1jciU5A0iMAtZNhKDNp0hgt7oyfYypRihWklSFrj21KXBjwo0nO0mJyA-Q81jAJU-wjxLDLXm6btsD4z4NWtHYMkjiEcjXfPhE6MyFNEH1_jPU6HbnOl1xRQJkEtTZeb6C44ZmzUkfrKRgWetWqfOr2GnF11vpKGk2_ueoNJZcBoJhzr57DiQ"
}
},
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.bf2b3b37-7260-4813-a43c-b94ae49b45bf",
"timestamp": "2021-07-19T16:40:08Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
}
If you are hosting skill in lambda, there may be a chance for timeout. Database operations may take time, meanwhile lambda closed the session.
I think following log line suggests the same.
**2021-07-19T16:40:08.023Z 6a416b77-5d2c-4ebe-8ac4-dec09f67e9b9 Task timed out after 8.01 seconds**
Also, we have to consider maximum time allowed for Alexa to receive the response from end point. It is good to cap the response by 8 secs. For more information : DeferredResponse

How to get the GitHub data from various URLs and stored in the single mongoDB

I'm trying to get the GitHub data using Talend big data. The thing is, i have multiple URLs,because used each URL to take some values & stored into single mongoDB. The below order only i'm going to try & get the informations,
https://api.github.com/users/sample/repos
https://api.github.com/repos/sample/awesome-ciandcd/commits
https://api.github.com/repos/sample/awesome-ciandcd/contributors
Each URLs are giving the single JSONArray with multiple data format.Please give some suggestion to do this. I've already tried with sub-jobs component. But not get clear job.
My Output Should be like,
{
"gitname": "sample",
"gitType" : "User",
"password": "password",
"repoCount": 3,
"repositoryDetails": [
{
"repoName": "MergeCheckRepository",
"fileCount": 10,
"branchCount": 6,
"releaseCount": 2,
"commitsCount": 10,
"contributorsCount": 3,
"totalPulls": 1,
"mergeCount": 1,
"totalIssues": 12,
"closedIssueCount": 3,
"watchersCount": 1,
"stargazersCount": 4,
"contributorsDetails": [
{
"login": "sample",
"avatarURL": "https://avatars2.githubusercontent.com/u/30261572?v=4",
"contributions": 3
}
],
"commitDetails": [
{
"name": "sample",
"email": "sampletest#test.com",
"date": "2017-07-20T09:09:09Z"
}
]
},
{
"repoName": "Dashboard",
"filecount": 19,
"branchCount": 4,
"releasecount": 2,
"commitsCount": 5,
"contributorsCount": 3,
"totalPulls": 1,
"totalIssues": 2,
"closedIssueCount": 3,
"watchersCount": 1,
"stargazersCount": 4,
"contributorsDetails": [
{
"login": "sample",
"avatarURL": "https://avatars2.githubusercontent.com/u/30261572?v=4",
"contributions": 3
},
{
"login": "Dashboard",
"avatarURL": "https://avatars2.githubusercontent.com/u/30261572?v=4",
"contributions": 3
}
],
"commitDetails": [
{
"name": "sample",
"email": "sampletest#test.com",
"date": "2017-07-14T09:09:09Z"
},
{
"name": "Dashboard",
"email": "prakash.thangasamy#test.com",
"date": "2017-07-19T09:09:09Z"
},
{
"name": "testrepo",
"email": "test.dashboard#test.com",
"date": "2017-07-20T09:09:09Z"
}
]
}
]
}
How to achieve this one with sub-job? Is there any other way to do this?

how to code sap.m.sample.ListGrouping by using js view in openui5

hi i need List grouping control by using js view.but openui5 provides code by using xml view.
https://openui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.ListGrouping/preview
how to convert this code into js view and how to make ListGrouping able to selection for both element level and group level and change this as dropdown box
List.view.xml
<mvc:View
controllerName="sap.m.sample.ListGrouping.List"
xmlns:l="sap.ui.layout"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<List
items="{
path: '/ProductCollection',
sorter: {
path: 'SupplierName',
descending: false,
group: true
},
groupHeaderFactory: '.getGroupHeader'
}"
headerText="Products" >
<StandardListItem
title="{Name}"
description="{ProductId}"
icon="{ProductPicUrl}"
iconDensityAware="false"
iconInset="false" />
</List>
</mvc:View>
List.controller.js
sap.ui.define([
'jquery.sap.global',
'sap/m/GroupHeaderListItem',
'sap/ui/core/mvc/Controller',
'sap/ui/model/json/JSONModel'
], function(jQuery, GroupHeaderListItem, Controller, JSONModel) {
"use strict";
var ListController = Controller.extend("sap.m.sample.ListGrouping.List", {
onInit : function (evt) {
// set explored app's demo model on this sample
var oModel = new JSONModel(jQuery.sap.getModulePath("sap.ui.demo.mock", "/products.json"));
this.getView().setModel(oModel);
},
getGroupHeader: function (oGroup){
return new GroupHeaderListItem( {
title: oGroup.key,
upperCase: false
} );
}
});
return ListController;
});
how to write the same code by using js view
I have tried like as follows, but i am getting Error: Missing template or factory function for aggregation items of Element sap.m.List#__list0 !
List.view.js
sap.ui.jsview("oui5mvc.List", {
getControllerName : function() {
return "oui5mvc.List";
},
createContent : function(oController) {
odbbshiftGlobalId = this.getId();
var oMyFlexbox = new sap.m.FlexBox({
items: [
oList = new sap.m.List({
width: '500px',
group: true,
groupHeaderFactory: '.getGroupHeader',
items: [
]
}),
]
});
oMyFlexbox.placeAt(this.getId()).addStyleClass("tes");
}
});
List.controller.js
sap.ui.controller("oui5mvc.List", {
onInit: function() {
var data = {
"ProductCollection": [
{
"ProductId": "1239102",
"Name": "Power Projector 4713",
"Category": "Projector",
"SupplierName": "Titanium",
"Description": "A very powerful projector with special features for Internet usability, USB",
"WeightMeasure": 1467,
"WeightUnit": "g",
"Price": 856.49,
"CurrencyCode": "EUR",
"Status": "Available",
"Quantity": 3,
"UoM": "PC",
"Width": 51,
"Depth": 42,
"Height": 18,
"DimUnit": "cm",
"ProductPicUrl": "https://openui5.hana.ondemand.com/test-resources/sap/ui/demokit/explored/img/HT-6100.jpg"
},
{
"ProductId": "2212-121-828",
"Name": "Gladiator MX",
"Category": "Graphics Card",
"SupplierName": "Technocom",
"Description": "Gladiator MX: DDR2 RoHS 128MB Supporting 512MB Clock rate: 350 MHz Memory Clock: 533 MHz, Bus Type: PCI-Express, Memory Type: DDR2 Memory Bus: 32-bit Highlighted Features: DVI Out, TV Out , HDTV",
"WeightMeasure": 321,
"WeightUnit": "g",
"Price": 81.7,
"CurrencyCode": "EUR",
"Status": "Discontinued",
"Quantity": 10,
"UoM": "PC",
"Width": 34,
"Depth": 14,
"Height": 2,
"DimUnit": "cm",
"ProductPicUrl": "https://openui5.hana.ondemand.com/test-resources/sap/ui/demokit/explored/img/HT-1071.jpg"
},
{
"ProductId": "K47322.1",
"Name": "Hurricane GX",
"Category": "Graphics Card",
"SupplierName": "Red Point Stores",
"Description": "Hurricane GX: DDR2 RoHS 512MB Supporting 1024MB Clock rate: 550 MHz Memory Clock: 933 MHz, Bus Type: PCI-Express, Memory Type: DDR2 Memory Bus: 64-bit Highlighted Features: DVI Out, TV-In, TV-Out, HDTV",
"WeightMeasure": 588,
"WeightUnit": "g",
"Price": 219,
"CurrencyCode": "EUR",
"Status": "Out of Stock",
"Quantity": 25,
"UoM": "PC",
"Width": 34,
"Depth": 14,
"Height": 2,
"DimUnit": "cm",
"ProductPicUrl": "https://openui5.hana.ondemand.com/test-resources/sap/ui/demokit/explored/img/HT-1072.jpg"
},
],
"ProductCollectionStats": {
"Counts": {
"Total": 14,
"Weight": {
"Ok": 7,
"Heavy": 5,
"Overweight": 2
}
},
"Groups": {
"Category": {
"Projector": 1,
"Graphics Card": 2,
"Accessory": 4,
"Printer": 2,
"Monitor": 3,
"Laptop": 1,
"Keyboard": 1
},
"SupplierName": {
"Titanium": 3,
"Technocom": 3,
"Red Point Stores": 5,
"Very Best Screens": 3
}
},
"Filters": [
{
"type": "Category",
"values": [
{
"text": "Projector",
"data": 1
},
{
"text": "Graphics Card",
"data": 2
},
{
"text": "Accessory",
"data": 4
},
{
"text": "Printer",
"data": 2
},
{
"text": "Monitor",
"data": 3
},
{
"text": "Laptop",
"data": 1
},
{
"text": "Keyboard",
"data": 1
}
]
},
{
"type": "SupplierName",
"values": [
{
"text": "Titanium",
"data": 3
},
{
"text": "Technocom",
"data": 3
},
{
"text": "Red Point Stores",
"data": 5
},
{
"text": "Very Best Screens",
"data": 3
}
]
}
]
}
};
var oTemplate11 = new sap.m.StandardListItem({title : "{Name}"});
oList.setModel(new sap.ui.model.json.JSONModel(data));
oList.bindItems("/ProductCollection");
oList.placeAt('content');
},
getGroupHeader: function (oGroup){
return new sap.m.GroupHeaderListItem( {
title: oGroup.key,
upperCase: false
});
},
});
Your call to bind items to the list is not entirely correct.
The method takes an object with binding information as parameter instead of just the path to the model property. See the documentation for bindItems and bindAggregation in general.
In your case it should look like
oList.bindItems({
path: "/ProductCollection",
template: new sap.m.StandardListItem({
title: "{Name}",
description: "{ProductId}",
icon: "{ProductPicUrl}"
})
});