Dynamic ZK Chart Type & Model: Unsupported model type Error - zk

I'm creating a dashboard application which requires me to allow user to change the chart type to any other available chart type and reload the org.zkoss.chart.Charts .
Charts charts = (Charts) dashboardBuilderCanvas.getFellow(chartsId);
I can get the Charts, but when I want to change the type or the model from Column chart to Pie Chart:
charts.setType(Charts.PIE);
I get the following error:
Unsupported model type [org.zkoss.chart.model.DefaultCategoryModel#5665ad96] on that line.
I tried to do this:
PieModel model = new
DefaultPieModel();
charts.setModel(model);
charts.setType(Charts.PIE);
But I get the same error:
java.lang.IllegalArgumentException: Unsupported model type [org.zkoss.chart.model.DefaultCategoryModel#5e92429a]
at org.zkoss.chart.impl.PiePlotImpl.drawPlot(PiePlotImpl.java:33)
at org.zkoss.chart.Charts.doSmartDraw(Charts.java:2197)
at org.zkoss.chart.Charts.smartDrawChart(Charts.java:1702)
at org.zkoss.chart.Charts.setType(Charts.java:662)
How can I resolve this?
Thanks.

Call setType before setModel
PieModel model = new DefaultPieModel();
charts.setType(Charts.PIE);
charts.setModel(model);

Related

TYPO3 9.5 Extension Builder throws Exception

I try to create a new TYPO3 extension with the Extension Builder and get the following error:
Extension could not be saved: Could not generate action controller, error: PHP Warning: First parameter must either be an object or the name of an existing class in /var/www/html/public/typo3conf/ext/extension_builder/Classes/Parser/Utility/NodeConverter.php line 240
TYPO3 9.5.23
extension_builder 9.10.3
I tried two different installations (one is a plain installation with introduction_package).
Just very simple extension with
1 FE-Plugin
As soon as I add a model with a default action or a second table with a relation I get this error.

SAPUI5 Annotation structure cannot read property 'IndexOf' undefined

I've created a local annotation file based on an OData service.
And even without adding any annotations to the new annotation file, when I open Annotation modeler it says
Annotation structure cannot read property 'IndexOf' undefined
And I have not defined any annotations from the service level.
And Even I add some annotaions using the Code view they also not display when I run the application
When I check the console it displays following error
2018-08-09 12:18:45.755000 TypeError: Cannot read property 'indexOf' of undefined
at Object.getAbsolutePath (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/plugins/pluginrepository/annotationmodeler/client/v1.33.1_1526463231420/config-preload.js:1:136)
at Object.<anonymous> (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/plugins/pluginrepository/annotationmodeler/client/v1.33.1_1526463231420/config-preload.js:9:17064)
at r (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:43:4628)
at r._settlePromiseFromHandler (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:42:23011)
at r._settlePromise (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:42:23814)
at r._settlePromise0 (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:42:24515)
at r._settlePromises (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:42:25845)
at r._drainQueue (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:41:12469)
at r._drainQueues (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:41:12530)
at drainQueues (https://webide-hf01c42be.dispatcher.us3.hana.ondemand.com/resources/~3502d451b8b72165ef3cf2fa0789ca9b3430f76e~/sap/watt/core/Core-preload.js:41:10559) -

Value of type 'UIImageView' has no member 'agCKImageAsset'

I'm using AGCKImage to download images from cloud kit
self.img_ProfilePic.agCKImageAsset(record.recordID, assetKey: "profilePic")
self.img_Cover.agCKImageAsset(record.recordID, assetKey: "coverPic")
However I am getting the following error, Value of type UIImageView has no member 'agCKImageAsset'

Can I use FLP without default model ?

My json model url is '/destinations/XXX/Collection?time=' + (+new Date) I don't know how to configure it in minifest of Component.js , so I delete the sap.app.dataSources and sap.ui.models."" (the defalut model? ) , and the flp app gave me this error:
Failed to load U5 component for navigation intent
TypeError: Cannot read property 'metadataLoaded' of undefined
sap.ushell.renderers.fiori2.Shell.controller
What should I do ?
i have a couple of links that should get you up and running (I am assuming you are developping on webIDE in SAP HCP (is that correct?)):
How to setup destinations, you need extra properties: WebIDEUsage = odata_gen and WebIDEEnabled = true.
You should then go into your manifest.json and choose Descriptor Editor and choose Data Sources and under OData Services choose the + to add your service.
More information on manifest.json you can find here: Documentation on Manifest

Validation / Error Messages in ASP.Net MVC 2 View Unrelated to a Property

What pattern can I use to display errors on an MVC 2 view that are not related to a single property?
For example, when I call a web service to process form data, the web service may return an error or throw an exception. I would like to display a user-friendly version of that error, but have no logical means to relate the error to any given property of the model.
UPDATE:
Trying to use this code as suggested, but no summary message is displayed:
MyPage.spark:
Html.ValidationSummary(false, "Oopps it didn't work.");
Controller:
ViewData.ModelState.AddModelError("_FORM", "My custom error message.");
// Also tried this: ViewData.ModelState.AddModelError(string.Empty, "My custom error message.");
return View();
UPDATE 2
What does this mean?
next to each field.
Instead of always displaying all
validation errors, the
Html.ValidationSummary helper method
has a new option to display only
model-level errors. This enables
model-level errors to be displayed in
the validation summary and
field-specific errors to be displayed
next to each field.
Source: http://www.asp.net/learn/whitepapers/what-is-new-in-aspnet-mvc#_TOC3_14
Specifically, how does one add a model level error (as opposed to a field-specific error) to the model?
UPDATE 3:
I noticed this morning that Html.ValidationSummary is not displaying any errors at all, not even property errors. Trying to sort out why.
Simply adding a custom error to the ModelState object in conjunction with the ValidationSummary() extension method should do the trick. I use something like "_FORM" for the key... just so it won't conflict with any fields.
As far as patterns go, I have it setup so that my Business Logic Layer (called via services from the controller) will throw a custom exception if anything expected goes wrong that I want to display on the view. This custom exception contains a Dictionary<string, string> property that has any errors that I should add to ModelState.
HTHs,
Charles