What is the proper way to append view/component to existing view - ember.js

I have been trying to add a component within a view, I could do it but I am getting some warning message as well like "DEPRECATION: Using the defaultContainer is no longer supported". There is a related post here : emberjs append works but raises Assertion Failed error but not sure what I am doing wrong. Here is my jsbin link : http://jsbin.com/tuwanava/1/
Your help will be very much appreciated. Thanks.

Use
sticky.pushObject(App.ConfirmDeleteComponent.create());

Related

ember-bootstrap errors when rendering a form

I have a problem using ember-bootstrap to render a form. When the route is visited nothing is rendered and in the console the message
appears.
The project is a Bootstrap 3 project and I have just installed ember-boostrap. To do that I did the following :
ember install ember-bootstrap
ember generate ember-bootstrap --preprocessor=sass
ember generate ember-bootstrap --bootstrap-version=3
From reading the doco I believe that was the correct sequence of commands ?
I then created a new route and in the template I put the following :
{{#bs-form formLayout=formLayout model=this onSubmit=(action "submit") as |form|}}
{{form.element controlType="email" label="Email" placeholder="Email" property="email" required=true}}
{{form.element controlType="password" label="Password" placeholder="Password" property="password" required=true helpText="Minimum 6 characters"}}
{{form.element controlType="radio" label="Radio" property="radio" options=radioOptions optionLabelPath="label"}}
{{form.element controlType="checkbox" label="Checkbox" property="checkbox"}}
{{form.element controlType="textarea" label="Textarea" property="textarea"}}
{{bs-button defaultText="Submit" type="primary" buttonType="submit"}}
{{/bs-form}}
{{outlet}}
Which is the sample template from the form component in the ember-bootstrap doco .
As I said when I go to visit the the new route I get nothing rendered and the error message shown above.
I feel like I must have overlooked some part of the directions ... is there something obviously missing ?
EDIT IN RESPONSE TO ANSWER FROM REAL_ATE
So to respond to the points raised by by Chris (real_ate) below. I'm using Ember 3.8 .
Now I was really pleased to feature on the excellent "May I Ask A Question" and I hadn't yet watched this weeks so I went off to watch. It seemed really odd that you were getting a different error than I was so I decided to start a new project and attempt my own reconstruction.
What I found was that I got exactly the error you saw (others can view that segment of the vid here) and not the one I had shown the screen shot of.
So I'm pretty puzzled about this but it does confirm your finding.
My best guess is this ... at about the same time I had been working through some issues with another addon and to document the process I had taken some screen dumps of those errors. I believe I may have picked the wrong screen dump and pasted it into the question. Oddly enough Chris mentioned something at the start of the segment about me not having actually copied the stacktrace but instead having used a screen shot of the stacktrace - perhaps if I'd actually copied the stacktrace I would have been less likely to do what, it seems likely, I did.
So ... for the sake of posterity the initial error was ...
Uncaught Error: Assertion Failed: An action named 'submit' was not found in <est#controller:login::ember231>
at assert (index.js:163)
at makeClosureAction (glimmer.js:6069)
at action (glimmer.js:5995)
at Object.evaluate (runtime.js:266)
at AppendOpcodes.evaluate (runtime.js:72)
at LowLevelVM.evaluateSyscall (runtime.js:3471)
at LowLevelVM.evaluateInner (runtime.js:3417)
at LowLevelVM.evaluateOuter (runtime.js:3409)
at VM.next (runtime.js:5530)
at TemplateIteratorImpl.next (runtime.js:5632)
Which was resolved by providing a 'submit' action on a controller created for the purpose and that then revealed a different issue with the example .hbs from ember-bootstrap including formLayout=formLayout which doesn't exist unless you've defined it and the error for that looks like this ...
Uncaught Error: Assertion Failed: must provide a valid `formLayout` attribute.
at Object.assert (index.js:163)
at Class.<anonymous> (bs-form.js:11)
at ComputedProperty.get (metal.js:2966)
at _get (metal.js:1591)
at RootPropertyReference.compute (glimmer.js:535)
at RootPropertyReference.value (glimmer.js:384)
at SimpleClassNameBindingReference.compute (glimmer.js:4002)
at SimpleClassNameBindingReference.value (reference.js:367)
at ClassListReference.value (runtime.js:1283)
at ComponentElementOperations.flush (runtime.js:1645)
... that was resolved as I described in my answer below .
So thanks to Chris and Jen and sorry for the misleading question .
Well I'm going to answer this myself for the sake of others who might have the same issue. I got some help from the add-on maintainer via the Emberjs discord and to quote him ...
The examples on ember-bootstrap.com are unfortunately not very smart,
in that they show bounded properties as such and not with the actual
value. For example that formLayout=formLayout only makes sense if
you also have a formLayout property on your controller. If that's
not the case (which I assume), formLayout will be undefined. Can you
try removing that and see if it helps? (or replace with a constant
value like formLayout="horizontal")
I did what he suggested and it resolved the problem.
thanks for the question and for giving such a complete example of how to recreate the problem.
I spent some time trying to recreate the problem that you have but I couldn't find the same issue and I wasn't able to get it to error in the same way as you described. I even tried this in an older version of Ember to see if it was something to do with that and it didn't help.
One thing that I did learn when I was trying this out was that the initialisation that you're doing as 3 different steps can actually be done on all one line:
ember install ember-bootstrap --preprocessor=sass --bootstrap-version=3
It shows an error that --preprocessor is not a known parameter for ember-cli but it still works as expected 😂
We also hit into the same issue where we needed to define formLayout for the form to get it to work, but the error we saw wasn't the same as the one you had 🤔 Could you tell us what version of Ember you're working on?
I can see that you have answered your own question already but I would still be interested in getting to the bottom of the error that you saw (if you're interested)
This question was answered as part of "May I Ask a Question" Season 2 Episode 3. If you would like to see us discuss this answer in full you can check out the video here: https://youtu.be/nQsG1zjl8H4

OpenCart 2.2 error undefined when viewing order info

When I click the view button next to an order (whether from the dashboard or orders page) I get an "error undefined" alert as the page is loading.
I also get the same error when I try and change the order status from the same page and it yields no results.
It also produces no errors in the error log.
I can however change the order status from the edit order page but this is very inconvenient.
If anyone knows a common solution or maybe pointers as to how to start diagnosing the issue please post them here. I've been hunting for answers most of the day and have had no luck with any solutions.
ty in advance.
if you are using SSL Tyr this at upload/admin/controller/sale/order.php
After
$data['store_name'] = $order_info['store_name'];
Remove
$data['store_url'] = $this->request->server['HTTPS'] ? preg_replace("/^http:\/\//", "https://", $order_info['store_url']) : $order_info['store_url'];
Add
$data['store_url'] = $this->request->server['HTTPS'] ? HTTPS_CATALOG : HTTP_CATALOG;
Unfortunately OpenCart 2.2.0.0 is known to be a bit buggy.
Best thing would be to start using 2.3.0.2 (avoid 2.3.0.0 and 2.3.0.1) if possible.

Why is my Ember.Router giving this TypeError?

I'm using Ember built from git master. My RouteManager is not complex, but when I try to start my app, I get this error:
Uncaught TypeError: Property '1' of object , is not a function
Following the trace indicates that this is happening on the app's initialization.
This jsfiddle shows the problem, although you'll have to look in the javascript console to see the error message. My actual router will be more complex than this, but I've pared it down to the bones to try to eliminate potential error sources.
You need to update your version of Ember Data to the latest version from master, as the injection API changed.
Here is a fiddle which "works".
http://fiddle.jshell.net/Sly7/ZySzK/
I pick up an ember-data resource from another fiddle I found on stackoverflow.
The way of populating the arraycontroller is weird. Usually you pass the context in the connectOutlet method of the controller, by specifying a context (in your case, it should be Sylvius.Section.find() )
I don't know why, but doing this, I have the error 'Sylvius.Section has no method find'... perhaps an other mess due to ember-data/emberjs bad version.

emberjs data refresh already loaded data

i can't seem to be able to refresh data that has already been loaded into the store.
i found a possible solution here but it doesn't work for me.
How to refresh entity using ember data
when i tried to do this App.store.loadMany(data) i get this error
"Uncaught Error: DS.StateManager:ember563 could not respond to event setData in state rootState.loaded."
when i tried to use this App.store.findQuery(App.Model, {}) i get findQuery is not defined.
i'd prefer to use this approach App.store.loadMany(data) if possible.
i appreciate any help. thank you!!!
i ended up modifying ember-data.js using this solution here
https://github.com/emberjs/data/pull/106
it works for now.

System.UnexpectedException: error ID: 1502628612-2761 (-677061709)

When I try to invoke a Java service from an apex class with the wsdl2 apex class I get this error. Can anyone help me please?
System.UnexpectedException: Got an unexpected error in callout : null. Contact support with error ID: 1502628612-2761 (-677061709)
Any time you see the text to contact support and an error ID, it was actually a bug in Salefsorce's code and there's nothing you can really do to make it work as you are trying to use it.
The best you can do is contact their support team and log a ticket. A lot of times they can find a suitable workaround that'll work in the meantime.