cakephp highchart fatal error while rendering - highcharts

Here I am, again. With another question concerning cakephp-2.5 and the plugin 'highcharts'.
I've been looking at the demo's an all the different things I could find were the extendings from the controllers. But... that isn't required because it's a plug, am I right?
So, I have included th plugin to my loadings inside the bootstrap file, and when I'm trying to render my HighChart I'm receiving the following error;
Error: Chart: "1" could not be found. Ensure that Chart Name is the same string that is passed to $this->HighCharts->render() in your view.
But the demos are working fine! Any idea what I f*cked up? The names are the same, I even renamed them to 'asd' ( both! ) and it still doesn't work. ^^"

I know this is an incredibly late response but for the benefit of those still experiencing problems with this, the CakePHP 2.* Highcharts plugin has been updated and is compatible up to CakePHP version 2.5.7.
Do note however that in order to maintain product name consistency throughout the repo, all previous references to "HighCharts" have been changed to "Highcharts" and "high_charts" is now simply "highcharts" . So for eg. you now have to call $this->Highcharts->render() where before you would have used $this->HighCharts->render().

The plugin was not yet compatible with CakePHP 2.5. Right now as we speak the developer is working on a new release for 2.5. :)

In CakePHP 2.5, you can avoid the error above and render your chart by calling it.
For example from within index() within your controller, use:
$this->bar();
In this example, bar() is the name of the function containing your chart.

Related

Grails 5 how can I install the fields-templates

Grails 5 is using the fields-plugin (as stated in the scaffolding plugin and I see it in the Intellij-IDEA Grails-View of my project under plugins).
But how can I install the fields-plugin templates?
Even in the GitHub-sources I could only find the templates for _embedded, _list and _table.
what am I missing?
(The reason for all that is, that I want to know, how the inList constraint is handled in a g:select. I know it's working, but if I try it the "old-fashioned" way with
from=${MyDomain.constraints.myField.inList}
grails throws errors Cannot get property 'myField' on null object
Please correct me if I'm wrong, but the delivered plugin has no other template files as the mentioned ones, the base "template" is done through the taglib and you can override with "self-made" tag-gsps in views.
But I would like to see some documentation, which variables you could use in own template-files... or did I miss it?
The constraints attribute has changed to constrainedProperties.

Localization Behavior simply not working

I'm trying to test the localization feature in Polymer.
I've created a new App using the new CLI.
It gives you a nice scaffolding of an app. In there I've added the code from the app-localize-behavior docs to enable it but it simply doesn't work. By doesn't work I mean that the {{localize(...)}} line doesn't show anything.
You can find my sample code in the link below:
https://gist.github.com/dallarosa/daaac2d8959026a05c1eef1d65493d6b
This is really just the scaffolding plus the entries related to app-localize-behavior, so in the gist I've only added the related code. Let me know if you actually wanna see the whole contents.
I just very quickly looked at the issue, and it looks ok to me at first glance... except for possibly requiring to 'type' your language property:
language: {type: String, value: 'en'}

How to access a struts taglib id in scriptlet

I am new to struts so this could be a basic concept I am facing problem with.
I have a code which access the ID of util:copyTag inside scriptlet:
<%# taglib uri="/WEB-INF/tlds/copytag.tld" prefix="util" %>
...
...
<util:copyTag id="tablebuffer" >
....
</util:copyTag>
<%
Hashtable h=new Hashtable();
String Key = "key1";
h.put(Key,tablebuffer);
%>
When using this code in eclipse, line h.put(Key,tablebuffer); gives a red marker with popup text:
Multiple annotations found at this line:
- tablebuffer cannot be resolved to a
variable
- tablebuffer cannot be resolved to a
variable
Is it possible to use the ID as a variable, or is there some other way to do this. Actually I was given this code and told that code works fine. However when I configured the code in Eclipse I am facing the mentioned issue.
Kindly help me with this issue.
The only possible answer is:
Never use Scriptlets anymore: they're a bad practice.
Never use Struts1 anymore: it is EOL.
Apache Struts 1 End-Of-Life (EOL) Announcement
The Apache Struts Project Team would like to inform you that the Struts 1.x web framework has reached its end of life and is no longer officially supported.
[...]
We plan to start a new project based on Struts 1. Can we still do so?
Basically yes, but we would not recommend doing so. As long as no code line is written it is very easy to conceptually select an alternative web framework such as Struts 2.
Also, Struts 2 is easier and more powerful... really, if you are starting something new (and not maintaining a huge S1 project), switch to it, or to the alternatives (JSF 2, Spring MVC, and so on)

ZF2 BBCode Parser

Hiho,
I use the ckeditor on my website for special textareas like forum
or signatures.
But I have a problem with the output. I use ZF2 and would like to
use ZendMarkup to render the output bbcode back in html.
But at every time I call
$bbcode->render(...)
I got the error
There is no Zend_Markup_Root markup.
The ZendMarkup is an extension inspired by the Zend_Markup from ZF1.
But I can't find any thing on API or other guides.
Does someone has any idea what as the problem is?
The ZendMarkup library is very old (last update is 10 months ago!) so I wouldn't use such library. If you would like, I think I traced the error down.
On this line there is a reference to Zend_Markup_Root while that should be ZendMarkup\Renderer\Markup\Html\Root. Try to change that line and see what happens.
Another way is to replace the ZendMarkup library with another library which does work and is updated regularly. An example is Decoda. If you load mjohnson/decoda in your composer.json, you can use Decoda in your Zend Framework 2 application:
<?php
use Decoda\Decoda;
$parser = new Decoda($bbcode);
$html = $parser->parse();
With tools like composer, there is no need to use solely Zend* components when there are better alternatives.

ASP.NET MVC ViewData (using indices)

I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a Preview 2 solution) that uses an untyped ViewMasterPage like so:
public partial class Home : ViewMasterPage
On Home.Master there is a display statement like this:
<%= ((GenericViewData)ViewData["Generic"]).Skin %>
However, a developer on the team just changed the assembly references to Preview 4.
Following this, the code will no longer populate ViewData with indexed values like the above.
Instead, ViewData["Generic"] is null.
As per this question, ViewData.Eval("Generic") works, and ViewData.Model is also populated correctly.
However, the reason this solution isn't using typed pages etc. is because it is kind of a legacy solution. As such, it is impractical to go through this fairly large solution and update all .aspx pages (especially as the compiler doesn't detect this sort of stuff).
I have tried reverting the assemblies by removing the reference and then adding a reference to the Preview 3 assembly in the 'bin' folder of the project. This did not change anything. I have even tried reverting the Project file to an earlier version and that still did not seem to fix the problem.
I have other solutions using the same technique that continue to work.
Is there anything you can suggest as to why this has suddenly stopped working and how I might go about fixing it (any hint in the right direction would be appreciated)?
We made that change because we wanted a bit of symmetry with the [] indexer. The Eval() method uses reflection and looks into the model to retrieve values. The indexer only looks at items directly added to the dictionary.
I've decided to replace all instances of ViewData["blah"] with ViewData.Eval("blah").
However, I'd like to know the cause of this change if possible because:
If it happens on my other projects it'd be nice to be able to fix.
It would be nice to leave the deployed working code and not overwrite with these changes.
It would be nice to know that nothing else has changed that I haven't noticed.
How are you setting the viewdata? This works for me:
Controller:
ViewData["CategoryName"] = a.Name;
View:
<%= ViewData["CategoryName"] %>
BTW, I am on Preview 5 now. But this has worked on 3 and 4...
Re: Ricky
I am just passing an object when I call the View() method from the Controller.
I've also noticed that on my deployed server where nothing has been updated, ViewData.Eval fails and ViewData["index"] works.
On my development server ViewData["index"] fails and ViewData.Eval works...
Yeah, so whatever you pass into the View is accessible in the View as ViewData.Model. But that will be just a good old object if you don't do the strongly typed Views...

Resources