Related
While using input.choice with confirmation message in adaptive card rest at that time dropdown of choice list is not showing up, we started facing this problem recently before it was working properly.
This was the code we were using at first when it was having proper behaviour
TeamsAdaptiveCardRest adaptiveCardRest = new TeamsAdaptiveCardRest();
List<TeamsItemsChoiceRest> choiceList =
createTeamsItemChoiceRestList((MapUserMessageRest) chatUserResponse.getOptions());
TeamsTextBlockRest textBlock = new TeamsTextBlockRest();
textBlock.setText(chatUserResponse.getMessage());
TeamsStaticItemListRest staticItemListRest = new TeamsStaticItemListRest();
staticItemListRest.setChoices(choiceList);
staticItemListRest.setPlaceholder("select");
staticItemListRest.setId(String.valueOf(chatUserResponse.getChatBrainId()));
TeamsToggleElementsRest enableConfirmationMessage = createToggleElements("confirmationToggle", true);
TeamsToggleElementsRest enableActionButton = createToggleElements("actionButton", true);
TeamsToggleActionRest toggleSelectAction = new TeamsToggleActionRest();
toggleSelectAction
.setTargetElements(Lists.newArrayList(enableConfirmationMessage, enableActionButton));
TeamsContainerRest inputChoiceContainer = new TeamsContainerRest();
inputChoiceContainer.setVisible(true);
inputChoiceContainer.setItems(Lists.newArrayList(textBlock, staticItemListRest));
inputChoiceContainer.setSelectAction(toggleSelectAction);
adaptiveCardRest.addInBody(inputChoiceContainer);
TeamsContainerRest confirmationMessageContainer = new TeamsContainerRest();
confirmationMessageContainer.setItems(
Lists.newArrayList(new TeamsTextBlockRest(chatUserResponse.getConfirmationMessage())));
confirmationMessageContainer.setId("confirmationToggle");
confirmationMessageContainer.setVisible(false);
adaptiveCardRest.addInBody(confirmationMessageContainer);
TeamsActionSubmitRest submitAction = new TeamsActionSubmitRest("Yes");
TeamsToggleElementsRest disableConfirmationMessage =
createToggleElements("confirmationToggle", false);
TeamsToggleElementsRest disableActionButton = createToggleElements("actionButton", false);
TeamsToggleActionRest toggleDisabledAction = new TeamsToggleActionRest();
toggleDisabledAction
.setTargetElements(Lists.newArrayList(disableConfirmationMessage, disableActionButton));
toggleDisabledAction.setTitle("Cancel");
TeamsActionSetRest actionButtionSetRest = new TeamsActionSetRest();
actionButtionSetRest.setVisible(false);
actionButtionSetRest.setId("actionButton");
actionButtionSetRest.setActions(Lists.newArrayList(submitAction, toggleDisabledAction));
adaptiveCardRest.addInBody(actionButtionSetRest);
return adaptiveCardRest;
Json for the above code:
{
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "Container",
"id": null,
"items": [
{
"type": "TextBlock",
"text": "Input.choice",
"wrap": true
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "a",
"value": "aa",
"id": "aa"
}
],
"id": "39",
"value": null,
"placeholder": "select"
}
],
"selectAction": {
"type": "Action.ToggleVisibility",
"title": null,
"id": null,
"targetElements": [
{
"elementId": "confirmationToggle",
"visible": true,
"isVisible": true
},
{
"elementId": "actionButton",
"visible": true,
"isVisible": true
}
]
},
"visible": true,
"isVisible": true
},
{
"type": "Container",
"id": "confirmationToggle",
"items": [
{
"type": "TextBlock",
"text": "Are you sure?",
"wrap": true
}
],
"selectAction": null,
"visible": false,
"isVisible": false
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Yes",
"associatedInputs": "auto",
"data": null
},
{
"type": "Action.ToggleVisibility",
"title": "Cancel",
"id": null,
"targetElements": [
{
"elementId": "confirmationToggle",
"visible": false,
"isVisible": false
},
{
"elementId": "actionButton",
"visible": false,
"isVisible": false
}
]
}
],
"id": "actionButton",
"visible": false,
"isVisible": false
}
],
"selectAction": null,
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
We are facing same issue in input.date with confirmation message in that dropdown of datepicker doesn't show up
Due to the change in behaviour the dropdown of input.choice and input.date Doesn't show with confirmation message so It was working properly before but recently behaviour changed, So want to know the reason behind the change in behaviour.
enter image description here
There are three data series, two of them are bar type series (Insolation Duration and Power Duration).
When I import data (from Striped Table) to the Highcharts, the bar chart height doesn't display properly.
It doesn't fit the scale of the chart's value, like this:
e.g. 2018/05/01
The Insolation value is less than the Power value, but the height of Power Duration bar chart is higher than Insolation Duration.
Here are the chart options I use:
var ChartObj =
{
type: "chart",
value:
{
"chart": { "alignTicks": false, "zoomType": "xy" },
"title": { "text": " ", "floating": false, "align": "center" },
"xAxis":
[
{
"categories": [], //PUT LABEL IN HERE
"crosshair": true, "index": 0, "isX": true
}
],
"tooltip": { "shared": true },
"legend":
{
"layout": "horizontal",
"align": "right",
"x": 0,
"verticalAlign": "top",
"y": 0,
"floating": false,
"backgroundColor": "#FFFFFF"
},
"yAxis":
[
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#7cb5ec" },
"enabled": false
},
"title": { "text": null, "style": { "color": "#7cb5ec" } },
"opposite": false,
"index": 0,
},
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#90ed7d" },
"enabled": false
},
"title":
{
"text": null,
"style": { "color": "#90ed7d" }
},
"opposite": true,
"index": 1,
},
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#f7a35c" },
"enabled": false
},
"title": { "text": null,
"style": { "color": "#f7a35c" } },
"opposite": true,
"index": 2,
}
],
"series":
[
{
// Insolation
"name": " ",
"color": "#90ed7d",
"tooltip":
{
"valueSuffix": "",
"pointFormat": "<span style=\"color:{point.color}\">●</span> {series.name}: <b>{point.y:,.2f}</sup></b><br/>"
},
"yAxis": 0,
"type": "column",
"data": [],
"_symbolIndex": 0
},
{
// Power
"name": " ",
"color": "#f7a35c",
"tooltip":
{
"valueSuffix": "",
"pointFormat": "<span style=\"color:{point.color}\">●</span> {series.name}: <b>{point.y:,.2f}</b><br/>"
},
"yAxis": 1,
"type": "column",
"data": [],
"_symbolIndex": 1
},
{
// PR
"name": " ",
"color": "#7cb5ec",
"tooltip":
{
"valueSuffix": "",
"pointFormat": "<span style=\"color:{point.color}\">●</span> {series.name}: <b>{point.y:,.2f}</b><br/>"
},
"yAxis": 2,
"type": "line",
"data": []
}
]
}
};
You will need to set a max to the 2 first column axis like this
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#7cb5ec" },
"enabled": false
},
"title": { "text": null, "style": { "color": "#7cb5ec" } },
"opposite": false,
"index": 0,
max:12 // The value to set
},
Or change the index of your series to use the same yAxis
Demo Fiddle
It sounds super simple, but I can't get how can I use geojson, not topojson, for my polygons.
that's my current attempt:
"data": [
{
"name": "nabs",
"url": "both_boundaries.geojson",
"format": {"type": "json"},
"transform": [
{
"type": "geopath", "projection": "mercator",
"scale": 74, "center": [-73.99,40.72]
}
]
}
]
You have to parse the features using property within your format:
"format": {"type": "json", "property":"features"},
Full example spec:
{"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"width": 500,
"height": 600,
"autosize": "none",
"signals": [
{
"name": "translate0",
"update": "width / 2"
},
{
"name": "translate1",
"update": "height / 2"
}
],
"projections": [
{
"name": "projection",
"size": {"signal": "[width, height]"},
"fit": {"signal": "data('netherlands')"}
}
],
"data": [
{
"name": "netherlands",
"url": "https://raw.githubusercontent.com/mattijn/datasets/master/NL_outline_geo.json",
"format": {
"type": "json",
"property": "features"
}
}
],
"marks": [
{
"type": "shape",
"from": {
"data": "netherlands"
},
"encode": {
"update": {
"strokeWidth": {
"value": 0.5
},
"stroke": {
"value": "darkblue"
},
"fill": {
"value": "lightblue"
},
"fillOpacity": {
"value": 0.5
}
},
"hover": {
"fill": {
"value": "#66C2A5"
},
"strokeWidth": {
"value": 2
},
"stroke": {
"value": "#FC8D62"
}
}
},
"transform": [
{
"type": "geoshape",
"projection": "projection"
}
]
}
]
}
I am new to swagger. Following is the error generated:
✖ Swagger Error
A deterministic version of a JSON Schema object.
Jump to line 7
Details
Object
{
"swagger": "2.0",
"info": {"description": "Fast Healthcare Interoperability Resources (FHIR, pronounced \"Fire\") defines a set of \"Resources\" that represent granular clinical concepts. The resources can be managed in isolation, or aggregated into complex documents. Technically, FHIR is designed for the web; the resources are based on simple XML or JSON structures, with an http-based RESTful protocol where each resource has predictable URL. Where possible, open internet standards are used for data representation. \n",
"version":"1.1.1",
"title": "FhirServer"
},
"definitions": {
"Account": {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "",
"type": "object",
"properties": {
"resourceType": {
"type": "string",
"minLength": 1
},
"id": {
"type": "string",
"minLength": 1
},
"text": {
"type": "object",
"properties": {
"status": {
"type": "string",
"minLength": 1
},
"div": {
"type": "string",
"minLength": 1
}
},
"required": [
"status",
"div"
]
}
},
"required": [
"resourceType",
"id",
"text"
]
}
},
"paths": {
},
"schemes": [
"http"
],
"basePath": "/open",
"tags": [
{
"name": "Account"
},
{
"name": "AllergyIntolerance"
},
{
"name": "Appointment"
},
{
"name": "AppointmentResponse"
},
{
"name": "AuditEvent"
},
{
"name": "Basic"
},
{
"name": "Binary"
},
{
"name": "BodySite"
},
{
"name": "Bundle"
},
{
"name": "CarePlan"
},
{
"name": "Claim"
},
{
"name": "ClaimResponse"
},
{
"name": "ClinicalImpression"
},
{
"name": "Communication"
},
{
"name": "CommunicationRequest"
},
{
"name": "Composition"
},
{
"name": "ConceptMap"
},
{
"name": "Condition"
},
{
"name": "Conformance"
},
{
"name": "Contract"
},
{
"name": "Coverage"
},
{
"name": "DataElement"
},
{
"name": "DetectedIssue"
},
{
"name": "Device"
},
{
"name": "DeviceComponent"
},
{
"name": "DeviceMetric"
},
{
"name": "DeviceUseRequest"
},
{
"name": "DeviceUseStatement"
},
{
"name": "DiagnosticOrder"
},
{
"name": "DiagnosticReport"
},
{
"name": "DocumentManifest"
},
{
"name": "DocumentReference"
},
{
"name": "EligibilityRequest"
},
{
"name": "EligibilityResponse"
},
{
"name": "Encounter"
},
{
"name": "EnrollmentRequest"
},
{
"name": "EnrollmentResponse"
},
{
"name": "EpisodeOfCare"
},
{
"name": "ExplanationOfBenefit"
},
{
"name": "FamilyMemberHistory"
},
{
"name": "Flag"
},
{
"name": "Goal"
},
{
"name": "Group"
},
{
"name": "HealthcareService"
},
{
"name": "ImagingObjectSelection"
},
{
"name": "ImagingStudy"
},
{
"name": "Immunization"
},
{
"name": "ImmunizationRecommendation"
},
{
"name": "ImplementationGuide"
},
{
"name": "List"
},
{
"name": "Location"
},
{
"name": "Media"
},
{
"name": "Medication"
},
{
"name": "MedicationAdministration"
},
{
"name": "MedicationDispense"
},
{
"name": "MedicationOrder"
},
{
"name": "MedicationStatement"
},
{
"name": "NamingSystem"
},
{
"name": "NutritionOrder"
},
{
"name": "Observation"
},
{
"name": "OperationDefinition"
},
{
"name": "OperationOutcome"
},
{
"name": "Order"
},
{
"name": "OrderResponse"
},
{
"name": "Organization"
},
{
"name": "Parameters"
},
{
"name": "Patient"
},
{
"name": "PaymentNotice"
},
{
"name": "PaymentReconciliation"
},
{
"name": "Person"
},
{
"name": "Practitioner"
},
{
"name": "Procedure"
},
{
"name": "ProcedureRequest"
},
{
"name": "ProcessRequest"
},
{
"name": "ProcessResponse"
},
{
"name": "Provenance"
},
{
"name": "Questionnaire"
},
{
"name": "QuestionnaireResponse"
},
{
"name": "ReferralRequest"
},
{
"name": "RelatedPerson"
},
{
"name": "RiskAssessment"
},
{
"name": "Schedule"
},
{
"name": "SearchParameter"
},
{
"name": "Slot"
},
{
"name": "Specimen"
},
{
"name": "StructureDefinition"
},
{
"name": "Subscription"
},
{
"name": "Substance"
},
{
"name": "SupplyDelivery"
},
{
"name": "SupplyRequest"
},
{
"name": "TestScript"
},
{
"name": "ValueSet"
},
{
"name": "VisionPrescription"
}
]
}
Remove the $schema attribute in your definition. It's not allowed by the OAI Specification
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How to parse JSON data in BlackBerry? Need help to parse following data.
{
"menu": {
"id": "Home",
"menuitem": [
{
"type": "form",
"name": "Order",
"url": "http://domain/oredr.aspx",
"Row": [
{
"Index": "1",
"Control": [
{
"type": "LB",
"align": "Left",
"send": "No",
"value": "User Name"
},
{
"type": "TB",
"align": "Right",
"send": "Yes",
"param": "username",
"maxlength": "25",
"ctype": "Alpha"
}
]
},
{
"Index": "2",
"Control": [
{
"type": "LB",
"align": "Left",
"send": "No",
"value": "Mobile No"
},
{
"type": "TB",
"align": "Right",
"send": "Yes",
"param": "MobileNo",
"maxlength": "10",
"ctype": "Numeric"
}
]
},
{
"Index": "3",
"Control": [
{
"type": "LB",
"align": "Left",
"send": "No",
"value": "Email ID"
},
{
"type": "TB",
"align": "Right",
"send": "Yes",
"param": "email",
"maxlength": "50",
"ctype": "Email"
}
]
},
{
"Index": "4",
"Control": [
{
"type": "None",
"align": "Left",
"send": "No"
},
{
"type": "BT",
"align": "Center",
"send": "No",
"value": "Submit",
"ctype": "Submit"
}
]
}
]
},
{
"type": "form",
"value": "Stock",
"url": "http://domain/stock.aspx",
"Row": [
{
"Index": "1",
"Control": [
{
"type": "LB",
"align": "Left",
"send": "No",
"value": "Select Medium"
},
{
"type": "CB",
"align": "Right",
"send": "Yes",
"param": "medium",
"Item": [
{
"name": "Yes"
},
{
"name": "No"
}
]
}
]
},
{
"Index": "2",
"Control": [
{
"type": "None",
"align": "Left",
"send": "No"
},
{
"type": "BT",
"align": "Center",
"send": "No",
"value": "Submit",
"ctype": "Submit"
}
]
}
]
},
{
"type": "form",
"value": "Custom",
"url": "http://domain/custom.aspx",
"Row": [
{
"Index": "1",
"Control": [
{
"type": "LB",
"align": "Left",
"send": "No",
"value": "Offer Type"
},
{
"type": "DD",
"align": "Right",
"send": "Yes",
"param": "offertype",
"Item": [
{
"name": "Marketing"
},
{
"name": "Promotional"
}
]
}
]
},
{
"Index": "2",
"Control": [
{
"type": "None",
"align": "Left",
"send": "No"
},
{
"type": "BT",
"align": "Center",
"send": "No",
"value": "Submit",
"ctype": "Submit"
}
]
}
]
}
]
}
}
Refer this link first - json
Try this - First download json parser .jar file and import it into your project.
JSONObject data = new JSONObject(data);
JSONObject menu = data.getJSONObject("menu");
For getting a String value of a field, use the following code -
String id = menu.getString("id");
JSONObject menuitem = json.getJSONObject("menuitem");
and so on.