Dojo ItemFileWriteStore issue with IE7 - internet-explorer-7

I have a grid that is embedded within a ContentPane which is in a tabContainer. When loading the itemfilewritestore IE7 pops an error.
Code:
var theData = {identifies : id , items[]};
var theStore = new dojo.data.ItemFileWriteStore({data: theData});
console.debug(theStore); // this throws some weird error
error:
{close:function(_81)if(!this.isDirty)........There are unsaved changes present in the store Please save or revert the changes before invoking close.
This error only shows itself in IE7. FF has no problem and renders the data properly. And yes I know there is no data in this code but in the real code the data is added later.

This issue was not as described. The error was not the store in any way. After digging around more, I found out that the real problem was a parsing on a javascript that was being imported. Going step by step through it the problem was because a JSON object was using the term "class" as an attribute. This seems to be against the IE "standards".

Related

How to send an image using Discord.js

I am using puppeteer, and I want to send a screenshot of the webpage if there is an error. The screenshot is taken correctly, but I cannot send the screenshot. I keep getting [object Object] in the channel instead of the image.
let message = new Discord.MessageAttachment(await page.screenshot({
quality:10,
type:'jpeg'
}),"ERRORIMAGE.png")
mainChannel.send({files:[message]});
I have also tried .send(message), .send('error image',message), and .send({attachments:[message]}).
I also tried saving the image as a file then giving the path but that also just gave [object Object].
Your best option is sending it through a Discord.messageEmbed using the setImage method on it .
const embed = new Discord.MessageEmbed().setImage('insert the url of the image here')
mainChannel.send(embed)
If it is an image you will be using frequently you might need to host it somewhere for better response times.
here is a link for a guide on Discord.MessageEmbed
it also includes stuff related to Discord.MessageAttachments which you can check out
you are looking for a slightly different syntax
//I will not include the screenshot code, since you said that was working fine, and I will therefore assume you do not need help with that
let message = new Discord.MessageAttachment(await page.screenshot({quality:10,type:'jpeg'}),"ERRORIMAGE.png");
message.channel.send('Message that goes above image - can be removed for no message', {
files: [message.path] //can attach multiple files, simply add more commma delimited filepaths
});
This should work - make sure to add the filepath of the image, not just its name
Edit: the [object, Object] error occurs when you try to use an object without specifying what part you are using. This means that most likely you need to do message.path or something similar, since message is an object.

Creating a responsive barchart in amchart v4

So I read on the docs that responsiveness for amchart 4 is still currently under development, and so perhaps that explains my difficulties here.
I'm trying to create a barchart that will shrink properly without distorting how the data is displayed. I've tried shrinking the parent container with an #media rule, but that distorted the data.
What's happening: When I shrink the view (i.e. open up inspector or run the web app on a smaller machine) half the category labels on the X-axis are disappearing for some strange reason. It seems to be every other label exactly is gone.
I've tried setting:
categoryAxis.minWidth = 0;
As an approximation of v3's minHorizontalGap property but of course they aren't the same.
I've tried setting the column width in hoped that that would influence the labels.
series.columns.template.width = am4core.percent(50);
And finally I've tried setting both the whole chart to responsive, and the categoryAxis:
categoryAxis.responsive.enabled = true;
But doing this gives me the following error which I can't find support for online:
bootstrap:114 Uncaught (in promise) Error: Loading chunk vendors~responsivedefaults failed.
I'm not sure what the problem is or how to resolve it, I can't believe they'd release a version of amcharts that didn't have responsivity in this age, and so I think it has to be something I'm doing wrong.
So I found the v4 equivalent to minHorizontalGap and that has solved the problem for me.
categoryAxis.renderer.minGridDistance = 60;
It's as simple as that. I still don't know why responsive.enabled doesn't work, but this is a satisfactory solution.

URLFOR misbehaving with Image attachment?

Trying to do something which is very simple but am getting strange results.
I have an image stored as an attachment which I want to display in a VF Page.
If I do this it works fine
<apex:image url="{!URLFOR($Action.Attachment.Download,'00PR0000008Q3YmMAK')}"/>
However that was for testing purposes that I hardcoded the id. If I try reference the Id in the object then it fails. Even though the value contained in the object is exactly the same as above.
<apex:image url="{!URLFOR($Action.Attachment.Download,model.PreviewImageAttachId)}"/>
When I load the page I get an error in URLFOR param!!!
I thought my problem was because model.PreviewImageAttachId was a String and not an Id so I created a wrapper to return it as an Id - same error.
I then decided Salesforce must have some strange requirement that you can only pass in the REAL object so I did that and passed in model.Attach.Id and it still fails!!
Please can someone explain this to me and more importantly suggest a solution??!?
Once again if I output to the page
{!model.PreviewImageAttachId} i get 00PR0000008Q3YmMAK
So I just cant explain this!
Thanks!
My bad...
Was using apex:repeat and turns out SOME of the id values were null.
Hence the error

Dojo : FilteringSelect : problems with coming back to valid state

I've came across this issue today and I think I might need some help. We are using 1.6.1 version of Dojo, but this is cross version issue.
Steps to reproduce the following issue are pretty simple:
click the dojo doc link for Filtering Select dijit.form.FilteringSelect
On the documentation page, click the first FilteringSelect sample
In the Codeglass window sample, click the filteringselect and add "x" to "California", thus bringing it to invalid state
While focused, delete the "x" letter.
and here comes the problem. Technically the value is correct, but the dijit is still like in error state (unless it loses focus).
I'd like to get the dijit react and render correctly straightaway I delete the character causing the invalid state without losing focus.
Any ideas for the workaround?
Thank you.
ok. for eveyryone else interested the solution was 'quite' simple, just use the dijit.form.FilteringSelect._refreshState() .The underscore prefix is might not be someone's cup of tea but that was the only way to get it in correct state.
in our case it was a bit tricky as we are using the dojox.data.QueryReadStore wrapped in our own object and I needed the proper trigger which I've found in connecting to onComplete event of the inherited fetch() method.

Why is an error not produced when following the Recess 'Controlling the Controller' doc?

According to the section 'The Controller-View Relationship' located in http://www.recessframework.org/page/controlling-the-controller :
Try removing the body of the printIt method and refresh to get an error indicating no view template at 'helloWorld/views/printIt.php' can be found.
I tried this and upon refreshing the page, saw []. I checked the response header and it was of type application/json. Could this have something to do with it? I've tried installing Recess on another machine and it resulted in the same behavior.
Can someone tell me how to get an error???

Resources