I have an array of primitive values which I'm binding to a set of inputs. (see link below), I'm facing two main issues.
First issue:
The view does not sync with the model whenever I edit the input, instead it throws the following error:
Uncaught TypeError: source.set is not a function
at init.set (kendo.binder.js:278)
Second issue:
When I bind an event to a span within the inputs template it throws another error.
JQuery.Deferred exception: source.get is not a function TypeError:
source.get is not a function at subclass.get
(webpack:///./node_modules/#progress/kendo-ui/js/kendo.binder.js?:301:31)
Here is a link to a DOJO exemple where you can replicate those issues: https://dojo.telerik.com/#houtheyfa/ohIdOlEs
Related
I would like to know how to access to a function of a controller from inside another controller in Symfony2. In fact I have two controllers: "EventgroupeController" and "GroupeController". In the code of the controller "EventgroupeController" I put the instruction below:
return GroupeController::AfficheGroupeAction();
But when I run the code (or let's say the project I am developing), it displays this error message in Symfony2:
ContextErrorException: Runtime Notice: Non-static method Ikproj\GroupeBundle\Controller\GroupeController::AfficheGroupeAction() should not be called statically, assuming $this from incompatible context in C:\wamp\www\Wkayet_project\PFESymfony2\src\Ikproj\GroupeBundle\Controller\EventgroupeController.php line 104
After having a look at this link: How to access a different controller from inside a controller Symfony2 in order to know how to access a different controller from inside a controller in Symfony2, I modified the content of the file services.yml as below:
parameters:
# ikproj_groupe.example.class: Ikproj\GroupeBundle\Example
services:
# ikproj_groupe.example:
# class: %ikproj_groupe.example.class%
# arguments: [#service_id, "plain_value", %parameter%]
controllerservice:
class: Ikproj\GroupeBundle\Controller\GroupeController
Then, I replaced the instruction: return GroupeController::AfficheGroupeAction(); by the lines below:
$yourController = $this->get('controllerservice');
$yourController1 = $yourController::AfficheGroupeAction();
return $yourController1;
But I still see this error message:
ContextErrorException: Runtime Notice: Non-static method Ikproj\GroupeBundle\Controller\GroupeController::AfficheGroupeAction() should not be called statically, assuming $this from incompatible context in C:\wamp\www\Wkayet_project\PFESymfony2\src\Ikproj\GroupeBundle\Controller\EventgroupeController.php line 106
So, my question is: how can I resolve this problem and how can I access to the function AfficheGroupeAction() of the controller "GroupeController" from inside the controller "EventgroupeController"?
An action method must not be static.
$this->get('controllerservice')->youMethod();
Should work !
But with a good "application design", you should not have this need except if you want to forward a request from a controller to another ( example : backward compatibility ). In this case you can use the forward method provided by symfony2 base controller. ( http://symfony.com/doc/current/book/controller.html )
Suppose I am binding using
bs.Bind(y)
.For(v => v.Visibility)
.To("Failures['TaxPercent'].Length")
.WithConversion("Visibility")
.WithFallback(false);
Where Failures is a dictionary which would contain the property name (e.g. TaxPercent) if, and only if, the property fails validation.
Therefore Failure['TaxPercent'] returns the validation failure message (e.g value missing).
I want to have an expandable textview in Android which is visible only when the error is detected. I used the above code and it is not working. The fallback value does not trigger when Failure['TaxPercent'] does not exist in the dictionary.
How do I get an expandable/collapsible textview based on the validation result using a dictionary in the viewmodel??? I would really like to use a dictionary because that would save me from creating IsErrorVisible for each property.
Oddly enough, using a dictionary works for retrieving the error message though, but not for visibility! In other words, this is working great
bs.Bind(y)
.For(v => v.Text)
.To("Failures['TaxPercent']");
Also, any reason why I cannot concatenate the binding, meaning can I do this???
bs.Bind(y)
.For(v => v.Text)
.To("Failures['TaxPercent']")
.For(v => v.Visibility)
.To("Failures['TaxPercent'].Length")
.WithConversion("Visibility")
.WithFallback(false);
EDIT
The error msg in the log is
MvxBind:Error:168.86 Problem seen during binding execution for binding Visibility for Failures['TaxPercent'].Length - problem ArgumentException: The value passed in must be an enum base or an underlying type for an enum, such as an Int32.
If the dictionary doesn't contain an entry for 'TaxPercent' then the expression Failures['TaxPercent'].Length will not evaluate (an exception will be throw) so UnsetValue will be used.
In the case of UnsetValue, the ValueConverter will not be called, and the Fallback will be used. This is the same pattern as in Wpf - http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.unsetvalue(v=vs.110).aspx
For your particular situation, it looks like you could either:
change the Fallback to the correct value for the platform instead of to a boolean value (the question didn't specify which platform(s) you are using)
create a new Visibility ValueConverter that takes Failures as its binding source and 'TaxPercent' as its parameter
remove the .Length from your binding expression - just test on the existence of the entry.
you could switch to free text binding expressions - then you could do more complicated binding statements, including nested bindings, multiple value converters, multiple fallback values, ...
For this particular case, I would just drop the .Length
For "any reason why I cannot concatenate", that won't work as the return type of Bind is a single Fluent binding entry - not a Fluent binding set.
I have to create a a new exception (MultipleErrorException) which extends MySuperException class. I have another exception (SingleErrorException) which also extends MySuperException.
Looking at the pseudo code below:
for (a number of times)
try
call myMethod(myObject) that throws SingleErrorException
catch(SingleErrorException e)
add the caught SingleErrorException object to a
MultipleErrorException object where a mapping should
be created mapping myObject to SingleErrorException
I need to throw a single "MultipleErrorException" which holds a map (myObject-->SingleErrorExceptions).
Is there any other way to this rather than creating an initial MultipleErrorException object before the for loop, an then adding the mappings as the exceptions are caught?
Thanks
java.lang.Exception as such does not have any method to support your requirement.
If you need it, then one way is to add the Map variable in MultipleErrorException and setting the value of it, but again, editing the exception object is not good.
Instead, you can add the error messages to Map and return the map instead of throwing the exception from the method.
I'm getting the following error when creating a new record/model:
Uncaught Error: Attempted to handle event `willSetProperty` on <App.NewsItem:ember361:null> while in state rootState.loaded.created.inFlight. Called with {reference: [object Object], store: <App.Store:ember299>, name: bodyHTML}
What does it mean?
Seems to be caused by the application updating a property (called 'bodyHTML') on an instance of a model of type App.NewsItem while it is being saved (rootState.loaded.created.inFlight). I have no idea why I'm receiving the error on creation though.
Seems like either you are modifying an existing dirty object , or you are trying setting some property to undefined
see
http://coryforsyth.com/2013/06/10/the-willsetproperty-gotcha-in-ember-data-understanding-the-state-machine/
I encountered an error in Flash CS5.5 ( ActionScript 3 ) :
ArgumentError: Error #1063: Argument count mismatch on
MethodInfo-185(). Expected 1, got 0. at MethodInfo-186()
But I have no MethodInfo-185() and MethodInfo-186() . What's wrong with the Flash ?
Somehow Flash CS5.5 / AS3 compiler cannot identify nested functions. The compiler will refer nested functions ( myInnerFunction as example below ) as MethodInfo-123() ( or something similar ).
function myFunction() {
function myInnerFunction() {
}
}
This means yes, you have there an unnamed function. Make sure you have all event listeners enumerated, and check if you have a listener added like this:
addEventListener(Event.ENTER_FRAME,function():void {...});
Any event can be in place of an enter frame event I wrote. If so, this is the line with an error. An event listener function should always accept 1 parameter of corresponding Event type. In this case, the correct line should be:
addEventListener(Event.ENTER_FRAME,function(e:Event):void {...});
Note the parameter type. If you, for example, listen for a "click" mouse event, it should be of MouseEvent type instead.