diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2011-10-10 13:34:15 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-10-18 16:19:06 -0200 |
commit | 27ea90792fb06e7e62f81c352936232ee10894ff (patch) | |
tree | 0418f94667ba4fd675cea680b3e72d744ed9c27e /install/ui/search.js | |
parent | 1e5391422143c17a94008a0703099c5f877e46fd (diff) | |
download | freeipa.git-27ea90792fb06e7e62f81c352936232ee10894ff.tar.gz freeipa.git-27ea90792fb06e7e62f81c352936232ee10894ff.tar.xz freeipa.git-27ea90792fb06e7e62f81c352936232ee10894ff.zip |
Circular entity dependency
https://fedorahosted.org/freeipa/ticket/1531
Each entity is created together with its dependent objects (e.g. facets and dialog boxes). This causes a circular dependency problem because some of the objects need to obtain a reference to another entity that has not been created.
Currently this is handled by storing only the other entity name and resolve it when needed (e.g. during rendering stage). In IPA.search_facet this delays the creation of the table widget, making it more difficult to customize.
One solution is to do the object creation in 2 steps:
* create all entity objects only
* create the dependent objects in each entity
Implemented solution:
* all entities are created on application start
* dependant objects (facets and dialogs) are created at once on their first use in entity.
Diffstat (limited to 'install/ui/search.js')
-rw-r--r-- | install/ui/search.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/install/ui/search.js b/install/ui/search.js index c469debc..83b91051 100644 --- a/install/ui/search.js +++ b/install/ui/search.js @@ -100,9 +100,6 @@ IPA.search_facet = function(spec) { } that.create_content = function(container) { - /*should be in the initialize section, but can not, due to - get_entity circular references.*/ - initialize_table_columns(); that.table.create(container); }; @@ -268,11 +265,11 @@ IPA.search_facet = function(spec) { var filter = []; var current_entity = entity; filter.unshift(IPA.nav.get_state(current_entity.name+'-filter')); - current_entity = current_entity.containing_entity; + current_entity = current_entity.get_containing_entity(); while(current_entity !== null){ filter.unshift( IPA.nav.get_state(current_entity.name+'-pkey')); - current_entity = current_entity.containing_entity; + current_entity = current_entity.get_containing_entity(); } var command = IPA.command({ @@ -292,6 +289,9 @@ IPA.search_facet = function(spec) { // methods that should be invoked by subclasses that.search_facet_create_content = that.create_content; + //initialization + initialize_table_columns(); + return that; }; |