behavior

Can I use a specific model from within a behavior in CakePHP?

I'm trying to write a behavior that will give my models access to a simple workflow engine I've devised. The workflow engine itself works as a CakePHP model, with workflow data stored in the database just as any other model data is stored. Basically what I want to do is have the behavior use the workflow model whenever an action is call...

Behaviors for Blend (Silverlight 4)

I'm wondering if anybody knows any good (free) behaviors for Blend/Silverlight 4 Specifically I'm looking for a behavior that I can drop on a TextBlock to make it scroll horizontally or a behavior that will "flash" text in a TextBlock (blinking text). But I'd love to hear about any behaviors you've been using or know about. As an examp...

Erlang Supervisor Strategy For Restarting Connections to Downed Hosts

I'm using erlang as a bridge between services and I was wondering what advice people had for handling downed connections? I'm taking input from local files and piping them out to AMQP and it's conceivable that the AMQP broker could go down. For that case I would want to keep retrying to connect to the AMQP server but I don't want to pe...

Chrome and Safari strange behaviour in Javascript

Hi, i've written this peace of code: var a=function(){ }; a.name="test"; a.prop="test2"; Now if i debug the code with the console: console.log(a.name); console.log(a.prop); In Firefox i get a.name="test" and a.prop="test2", while in Safari and Chrome i get a.prop="test2" but a.name="". It seems that there's no way to assign a "na...

Blend Interaction Behaviour gives "points to immutable instance" error

I have a UserControl that is a base class for other user controls, that are shown in "modal view". I want to have all user controls fading in, when shown and fading out when closed. I also want a behavior, so that the user can move the controls around.My contructor looks like this: var tg = new TransformGroup(); tg.Children.Add(new Scal...

DataStateBehavior for Enum instead of bool? String?

Is there an easy way in WPF to bind VisualStates to enum values? Kinda like DataStateBehavior, but for an Enum? ...

3.1.3 and 3.2 different behaviour

I'm using a custom cell in tableView with a UITextField - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell =...

Cakephp problem with translation behavior

I use cakphp version 1.3. The documentation says, that if I want to use the translation behavior for my dynamic content no changes in my view are necessarily. The problem is, that the translated fields are there but empty. The translation only appears in the ['I18n'] array like this Array ( [0] => Array ( [Cat...

Change EditableObject behaviour on WPF Datagrid

I have a WPF Datagrid (.NET 4.0) with a list of viewmodel bind to ItemsSource. The viewmodel exposes the model entity that is builded from a base ancestor class that implements IEditableObject interface. Every time I edit a cell of a datagrid row the beginedit method of entity is called; I would a different behaviour: call the BeginEdi...

WPF - What to do when a Dependency Property is another Control in the XAML

I'm hoping this will be my last question today. I'm in a hurry and google is not helping much (that or I'm searching the wrong places). I created some custom properties and behaviors so my RadioButtons can alter my labels Content and the mask of my TextBoxes. I could pass a String as a property, but how do I pass another control as a p...

PHP strange behavior in function nl2br.

I was dealing with refactoring of my small web app. all night. Today when I started testing, first bug what I found was problem with system PHP function nl2br(). On my localhost I have PHP version 5.2.9 and as I see on PHP site from version 4.0.5 nl2br() is XHTML compliant. Then I absolutely don't understand why does my nl2br() return ...

WPF - Static Binding - Error shows up but everything works fine

Hello Ok, I have a specific custom behavior for my MenuItems. So I bind the windows from my static class FormsResource and it works perfectly. But, very often, I get an exception "Exception has been thrown by the target of an invocation" in the 3 lines where I have "{Binding Source={x:Static local:foo}}" I can't see the inner exception, ...

Multiple HTTP Requests due to img behavior tag

Hi All, We have couple of portlets deployed on Websphere Portal Server. In the css file we have included a behavior attribute for img tag. img { position:relative; border:none; outline:none; behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLower...

Why does using document.write to create an iframe "cancel out" all remaining Javascript?

This happens in all browsers, so there must be a reason. Example: <html> <body> <script>var a="support/"; var aa='<iframe src="http://google.com/' + a + '" />'; document.write(aa)</script> <script>alert('test')</script> </body> </html> The code after the iframe write (in this case alert('test')) doesn't execute. Why? ...

CakePHP TranslateBehavior is driving me crazy!

Hi everyone. I use CakePHP 1.3.2 with the integrated Translate Behavior. The translations I save my several models in each table. Example: class Page extends AppModel { var $name = 'Page'; var $actsAs = array( 'Translate' => array('title', 'subtitle', 'menu') ); var $translateModel = 'PageI18n'; ... } Now... a...

CakePHP: MeioUpload Behavior

Hello. I would like to use the [MeioUpload Behavior][1] for uploading documents like PDF, DOC, XLS etc. but I get an Invalid file type error. My Upload Model looks like this: class Upload extends AppModel { var $name = 'Upload'; var $actsAs = array( 'MeioUpload.MeioUpload' => array( 'upload_file' => array( 'd...

Firefox strange behaviour when working with javascript on an iframe

Hi, i've met a strange behaviour in Firefox with this simple script: <html> <head> <script type="text/javascript"> window.setTimeout(function(){ var ifr=document.createElement("iframe"); ifr.src="about:blank"; document.body.appendChild(ifr); va...

VS2008/2010 debugger changes application behavior

I have a very simple Delphi 2010 dll that I load from a Visiual Studio 2008 C ATL console application (MVF GUI app does not work either). When I debug the console app from the IDE directly - no break points - the output from the application is not correct but when I run the app directly or if I attach to the process with the debugger the...

Getting controller's name inside behavior

Im writing ClearCache behavior. It's purpose is to delete some of custom cache files on every afterSave and afterDelete event of the model. In order to delete right files i need to know name of controller and the name of action that called ModelWithClearCacheBehavior->save() or ModelWithClearCacheBehavior->delete() My question is: How...

How to get the number of exception the service has encountered in WCF?

How will I be able to count the number of exceptions thrown during the execution of a service? Right now I'm using behaviors to hook with the dispatchers using IOperationInvoker and IParameterInspector. But I need to know how can i count the faults and exceptions that occurs in a particular operation or the total occurrence in the whole ...