Questions tagged [expando]

An expando is an custom property attached to a document object.

An expando property is an attribute of a DOM element which is not part of the specification or IDL. Some legacy expandos, such as onclick, are natively mapped to an internal event handler for backward compatibility with the DOM level 0 model.

References

80 questions
5
votes
1 answer

Is it possible to add attributes to the generated members of an ExpandoObject instance?

I'm trying to use an ExpandoObject as the SelectedObject of a PropertyGrid. I know how to add the properties I want to the ExpandoObject: public dynamic MakePropertyObject() { dynamic expando = new ExpandoObject(); var dictionary = expando…
5
votes
1 answer

How do I add an expando attribute to a user control?

I am building in some custom javascript functionality in an existing ASP.NET usercontrol. The usercontrol needs to know about a property of the control it is nested in. So, I ended up opting for using an expando attribute rather than a global…
NightOwl888
  • 51,095
  • 20
  • 122
  • 194
4
votes
2 answers

AppEngine: using Expando class in Django NonRel?

I have an app using using Django Nonrel on AppEngine. I'd like to use a dynamic model similar to WebApp's db.Expando class - is this possible? Is the Expando class exposed to the DNR layer?
mikemaccana
  • 81,787
  • 73
  • 317
  • 396
4
votes
2 answers

App engine - check to see if a property exists within Expando class

What is a good way to check to see if a property is populated in an expando class (Python for App Engine) Can I do: if Expando_class_name.property_name_to_check: do = someStuff Or is that going to give me an error? Thanks!
Chris Dutrow
  • 42,732
  • 59
  • 174
  • 243
4
votes
2 answers

Creating an Expando object in Ruby

Is there a better way to write this Expando class? The way it is written does not work. I'm using Ruby 1.8.7 starting code quoted from https://gist.github.com/300462/3fdf51800768f2c7089a53726384350c890bc7c3 class Expando def…
BuddyJoe
  • 64,613
  • 107
  • 281
  • 451
4
votes
2 answers

How to create dynamic fields in Google App Engine expando class?

I have a db expando class called widget. I'm passing in a json string and converting it to a dict and then adding it to the datastore. My question is how can I loop through my dict to create dynamic fields. widget =…
4
votes
2 answers

Tuples vs. Anonymous Types vs. Expando object. (in regards to LINQ queries)

I am a beginner who finally started understanding anonymous types. (see old post What is the return type for a anonymous linq query select? What is the best way to send this data back?) So in LINQ queries you form the type of return value you want…
punkouter
  • 4,690
  • 12
  • 57
  • 99
4
votes
1 answer

Why do I get a StackoverflowError on when Groovy JsonBuilder tries to serialize an Expando?

I am getting a StackoverflowError (not traced back to my code) when I try to serialize an Expando. Reproduced with groovy shell: ... groovy-2.0.6/bin/groovysh new groovy.json.JsonBuilder(new Expando(name:'hello')).toString() FATAL:…
Andy Hebert
  • 383
  • 3
  • 12
3
votes
1 answer

Automatic indexes for expando properties in the google app engine for python

The google app engine python sdk offers an Expando type object which can be used for adding dynamic properties to an object that can be persisted to the datastore. The app engine also requires that for any property on which the objects need to be…
Yasser
  • 1,808
  • 12
  • 18
3
votes
1 answer

In Groovy, When Does It Makes Sense To Use An Expando vs the 'as' operator and Closures?

Groovy is a wonderful language that offers lots of different choices. In thinking about unit tests, when does it make sense to use an Expando object vs. the "as" operator with…
finneycanhelp
  • 8,436
  • 12
  • 46
  • 70
3
votes
2 answers

NHibernate XML Document in Database to Expando Object in entity

I have a SQL Server database that contains an xml column. I need to map that xml column to an expando object within my domain entity. I am using NHibernate. How do I extend NHibernate to accommodate this? I am assuming (I am new to NHibernate)…
AlexGad
  • 6,325
  • 5
  • 31
  • 44
3
votes
1 answer

Iterating through Expando's Dynamic properties in Django Templates

I'm trying to iterate through an Expando-Model's dynamic properties in order to output them all. Is there a way of doing this other than creating your own method like such: class Event(db.Expando): platform = db.ReferenceProperty(Platform) …
Wex
  • 3,420
  • 2
  • 24
  • 44
3
votes
1 answer

Expando Model in Django

Is it possible to implement 'expando' model in Django, much like Google App Engine has? I found a django app named django-expando on github but it's still in early phase.
koko
  • 265
  • 3
  • 6
3
votes
1 answer

How can I add extra properties to document metadata field types in Liferay 6.1?

I'm new to Liferay and I have the following situation: I would like to add extra properties to document metadata field types in Liferay 6.1.20. For example, I would like to add property 'readonly' to select boxes (see image), as it is a user…
Maria Ioannidou
  • 1,524
  • 1
  • 15
  • 35
2
votes
1 answer

Groovy Expando Serializable

is there any way to serialize an expando subclass which can be retrieved with dynamically added properties. with the example; class Sexpando extends Expando implements Serializable{ //String testProp static final long serialVersionUID =…
hgoz
  • 623
  • 6
  • 18