Hi Andrea, I took a look at your graph, it's quite complex!  However, the 
js that you originally shared seems very straightforward (probably nothing 
wrong there...) so I think maybe you need to look at your forms.py class 
and html for this form.  It may useful to begin debugging by commenting out 
most of your htm file (maybe leave one node per branch) and then adding 
nodes back in until the problem occurs.  As I mentioned earlier, I've found 
that some apparent error symptoms seem unconnected to the error itself. 
 Also, is there any error print out in your dev tools console when you 
load/update this form?

Another debugging method I've been using for work on reports is to print 
the graph of the current resource to json every time I load the report.  I 
just tested moving this code to the resource manager, and it works great. 
Just open your  and add this code to the end of the __init__ function, 
changing the path as necessary:

1. open your models/resource.py file (which I'm thinking you have migrated 
to your app, and if not, check out this thread 
<https://groups.google.com/forum/#!topic/archesproject/Khj1ddBxAYk>)
2. add import json at the top
3. paste this code to the end of the __init__ function, changing the path 
as necessary:
if self.entityid != '':
    se = SearchEngineFactory().create()
    resource = se.search(index='resource', id=self.entityid)
    resource_graph = resource['_source']['graph']
    with open(r"C:\arches\catchall\current_graph.json","wb") as log:
        print >> log, json.dumps(resource_graph, sort_keys=True,indent=2, 
separators=(',', ': '))

Now the current resource graph will be written every time you load a form. 
 Hopefully that will help you get a clearer handle on what's going on...

Adam

On Friday, May 20, 2016 at 1:41:32 AM UTC-6, [email protected] wrote:
>
> Hi Alexei - did you by any chance have a look at the files I put on 
> github? I am still failing to solve this issue...
>
> Thank you,
>
> Andrea
>
> On Monday, May 16, 2016 at 5:54:50 PM UTC+1, [email protected] wrote:
>>
>> Certainly Alexei - here you go: 
>> https://github.com/azerbini/eamena2/tree/Nodes
>>
>> The nodes  that produce the issue reported above are those linked to the 
>> mergenode THREAT_STATE.E3
>>
>> Thanks for your help.
>>
>> Andrea
>>
>>
>>
>> On Monday, May 16, 2016 at 5:26:55 PM UTC+3, Alexei Peters wrote:
>>>
>>> Hi Andrea,
>>> Can you send the nodes and edges files used to create the graph?
>>> -Alexei
>>>
>>>
>>> Director of Web Development - Farallon Geographics, Inc. - 971.227.3173
>>>
>>> On Fri, May 13, 2016 at 8:20 AM, <[email protected]> wrote:
>>>
>>>> Adam,
>>>>
>>>> No, the two E55s are not contained in those E3 branches, but both E55s 
>>>>  and E3s are all children of the mergenode CONDITION_STATE.E3. Is this 
>>>> perhaps the cause of the problem? But I should note that 
>>>> DISTURBANCE_STATE.E3 does not cause any problems, only THREAT_STATE.E3 
>>>> does.
>>>>
>>>> Best,
>>>>
>>>> andrea
>>>>
>>>>
>>>> On Tuesday, May 10, 2016 at 8:34:01 PM UTC+3, Alexei Peters wrote:
>>>>>
>>>>> Hi All,
>>>>> I just recently came across a Google Chrome extension that can aid in 
>>>>> debugging your knockout based forms.
>>>>>
>>>>>
>>>>> https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof?hl=en
>>>>>
>>>>> The issue you're having Andrea does sound like it might be related to 
>>>>> an improperly formed graph structure like Adam suggested.
>>>>>
>>>>> Hope this helps,
>>>>> Alexei
>>>>>
>>>>>
>>>>> Director of Web Development - Farallon Geographics, Inc. - 
>>>>> 971.227.3173
>>>>>
>>>>> On Mon, May 9, 2016 at 7:06 AM, Adam Cox <[email protected]> wrote:
>>>>>
>>>>>> Hi Andrea,
>>>>>>
>>>>>> I've been doing a lot of work with forms, and definitely agree that 
>>>>>> these issues are hard to debug. Remember that there are three places you 
>>>>>> need to look to fix issues with forms.  In this case, the 
>>>>>> meaurement.htm, 
>>>>>> measurement.js, and forms.py files.  Too often I found that a 
>>>>>> complicated-looking error came down to a misnamed node somewhere along 
>>>>>> the 
>>>>>> way, so keep that in mind.  Also, if you don't already have it open, be 
>>>>>> sure to open dev tools and read any errors that come out in the console. 
>>>>>>  
>>>>>> Usually these are helpful.
>>>>>>
>>>>>> At any rate, the behavior you see may be only tangentially related to 
>>>>>> the real issue.  What you're describing sounds like you may be trying to 
>>>>>> use a branching structure that is problematic.  Are either of the E55 
>>>>>> nodes 
>>>>>> contained in the E3 branches?  You should not have a section that holds 
>>>>>> the 
>>>>>> top part of the branch at the same time as another section has a child 
>>>>>> entity of the same branch...
>>>>>>
>>>>>> Adam
>>>>>>
>>>>>> On Sunday, May 8, 2016 at 1:36:50 PM UTC-6, [email protected] 
>>>>>> wrote:
>>>>>>>
>>>>>>> Hello All,
>>>>>>>
>>>>>>> I am experiencing an issue with branch-list.js that is a bit 
>>>>>>> difficult to pin down. On my measurement form (see attached 
>>>>>>> measurement.js), and only on that one as far as I can see, it would 
>>>>>>> appear 
>>>>>>> that, after creating 4 branches of THREAT_STATE.E3, branch-list.js 
>>>>>>> begins 
>>>>>>> to duplicate some of them. If I attempt to delete one of the duplicated 
>>>>>>> branches, another one gets duplicated. I should add that this problem 
>>>>>>> does 
>>>>>>> not affect the other main mergenode, DISTURBANCE_STATE.E3, which 
>>>>>>> contains 
>>>>>>> many more child nodes than THREAT_STATE.E3. 
>>>>>>>
>>>>>>> I am not too familiar with Knockout JS and find it a bit hard to 
>>>>>>> debug those classes. Can you help?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Andrea
>>>>>>>
>>>>>>>  define(['jquery', 'underscore', 'knockout-mapping', 
>>>>>>> 'views/forms/base', 'views/forms/sections/branch-list'], function ($, 
>>>>>>> _, 
>>>>>>> koMapping, BaseForm, BranchList) {
>>>>>>>     return BaseForm.extend({
>>>>>>>         initialize: function() {
>>>>>>>             BaseForm.prototype.initialize.apply(this);
>>>>>>>                            
>>>>>>>             var date_picker = 
>>>>>>> $('.datetimepicker').datetimepicker({pickTime: false});
>>>>>>>             date_picker.on('dp.change', function(evt){
>>>>>>>                 $(this).find('input').trigger('change');
>>>>>>>             });
>>>>>>>                            
>>>>>>>             this.addBranchList(new BranchList({
>>>>>>>                 el: this.$el.find('#threat-state-section')[0],
>>>>>>>                 data: this.data,
>>>>>>>                 dataKey: 'THREAT_STATE.E3',
>>>>>>>                 validateBranch: function (nodes) {
>>>>>>>                     return true;
>>>>>>>                     return this.validateHasValues(nodes);
>>>>>>>                 }
>>>>>>>             }));
>>>>>>>                            
>>>>>>>             this.addBranchList(new BranchList({
>>>>>>>                 el: this.$el.find('#disturbance-state-section')[0],
>>>>>>>                 data: this.data,
>>>>>>>                 dataKey: 'DISTURBANCE_STATE.E3',
>>>>>>>                 validateBranch: function (nodes) {
>>>>>>>                     return true;                        
>>>>>>>                     return this.validateHasValues(nodes);
>>>>>>>                 }
>>>>>>>             }));
>>>>>>>                            
>>>>>>>                            
>>>>>>>             this.addBranchList(new BranchList({
>>>>>>>                 el: this.$el.find('#condition-type-section')[0],
>>>>>>>                 data: this.data,
>>>>>>>                 dataKey: 'CONDITION_TYPE.E55',
>>>>>>>                 validateBranch: function (nodes) {
>>>>>>>                     return true;                        
>>>>>>>                     return this.validateHasValues(nodes);
>>>>>>>                 }
>>>>>>>             }));
>>>>>>>                            
>>>>>>>             this.addBranchList(new BranchList({
>>>>>>>                 el: this.$el.find('#disturbance-extent-section')[0],
>>>>>>>                 data: this.data,
>>>>>>>                 dataKey: 'DISTURBANCE_EXTENT_TYPE.E55',
>>>>>>>                 validateBranch: function (nodes) {
>>>>>>>                     return true;
>>>>>>>                     return this.validateHasValues(nodes);
>>>>>>>                 }
>>>>>>>             }));
>>>>>>>         }
>>>>>>>     });
>>>>>>> });
>>>>>>>
>>>>>>> -- 
>>>>>> -- To post, send email to [email protected]. To 
>>>>>> unsubscribe, send email to [email protected]. For 
>>>>>> more information, visit 
>>>>>> https://groups.google.com/d/forum/archesproject?hl=en
>>>>>> --- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Arches Project" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to [email protected].
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> -- 
>>>> -- To post, send email to [email protected]. To unsubscribe, 
>>>> send email to [email protected]. For more information, 
>>>> visit https://groups.google.com/d/forum/archesproject?hl=en
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Arches Project" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to