Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with setContentsURL inside of a form.

    Greetings,

    I'm using 70rc2_Pro. I'm not sure if I'm even going about this the right way, but it seems like it should work. But I get errors when I try it.

    Code:
    isc.DynamicForm.create({
        ID:"downloadSelectForm",
        top:30,
        left:213,
        fields: [{
        name: "download", type: "select", showTitle:false, defaultValue:"Select",width:150,
            valueMap: {
                "addinV32" : "Version 3.2",
                "addinV3122" : "Version 3.1.2.2",
                "addinV21c" : "Version 2.1c"
            }
        }],
    	itemChanged: function() {
    	   //contentPane.setContentsURL('/iap/pages/modules/downloads/downloads.jsp');
           //var anchorUrl = '/iap/pages/modules/downloads/downloads.jsp#' + downloadSelectForm.getItem('download').getValue();
             var anchorUrl = '/iap/pages/modules/downloads/downloads.jsp';
             contentPane.setContentsURL(anchorUrl)
      }
    });
    The error I get is:

    Code:
    Webpage error details
    
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
    Timestamp: Fri, 17 Sep 2010 19:41:21 UTC
    
    
    Message: 'this.form' is null or not an object
    Line: 1203
    Char: 71
    Code: 0
    URI: http://svonmiller.highlinedata.com:81/iap/include/isomorphic/system/modules/ISC_Forms.js
    This may also be of use:
    Code:
    15:00:31.372:XRP1:WARN:Log:ClassFactory.addGlobalID: ID:'quickSearchForm' for object '[DynamicForm ID:quickSearchForm]' collides with ID of existing object '[DynamicForm ID:quickSearchForm]'. The pre-existing widget will be destroyed.
    15:00:31.435:XRP1:WARN:Log:ClassFactory.addGlobalID: ID:'quickSearchContainer' for object '[VLayout ID:quickSearchContainer]' collides with ID of existing object '[VLayout ID:quickSearchContainer]'. The pre-existing widget will be destroyed.
    15:00:31.544:XRP1:WARN:Log:ClassFactory.addGlobalID: ID:'downloadSelectForm' for object '[DynamicForm ID:downloadSelectForm]' collides with ID of existing object '[DynamicForm ID:downloadSelectForm]'. The pre-existing widget will be destroyed.
    15:00:31.576:XRP1:WARN:Log:Error:
    	''this.form' is null or not an object'
    	in http://svonmiller.highlinedata.com:81/iap/include/isomorphic/system/modules/ISC_Forms.js
    	at line 1203
        FormItem.isDisabled()
        FormItem.$54o(_1=>Obj, _2=>true)
        FormItem.updateIconsForFocus(_1=>Array[1], _2=>false)
        FormItem.elementBlur()
        FormItem.$166()
        FormItem.blurItem()
        DynamicForm.$11r(_1=>[SelectItem ID:isc_SelectItem_18 name:download])
            "if(_1!=null)_1.blurItem()"
        DynamicForm.$lf(_1=>false)
        EventHandler.$le(_1=>[DynamicForm ID:downloadSelectForm], _2=>undef)
            "if(this.$ke){var _3=this.$ke;if(_1!=null&&_3!=_1)return;this.$ke=null;_3.$lf(false)}"
        EventHandler.blurFocusCanvas(_1=>[DynamicForm ID:downloadSelectForm], _2=>undef)
        Canvas.setFocus(_1=>false)
        Class.invokeSuper(_1=>null, _2=>"setFocus", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
        Class.Super(_1=>"setFocus", _2=>Obj{length:1}, _3=>undef)
        DynamicForm.setFocus(_1=>false)
        Canvas.blur()
            "if(isc.$cv)arguments.$cw=this;this.setFocus(false)"
        Canvas.$rk()
        Canvas.clear(_1=>undef)
        ** recursed on Class.invokeSuper
    
    15:00:33.966:WARN:Log:[object Error]
    15:00:34.044:RDQ5:WARN:Log:Error:
    	''this.form.fieldIdProperty' is null or not an object'
    	in http://svonmiller.highlinedata.com:81/iap/include/isomorphic/system/modules/ISC_Forms.js
    	at line 669
        FormItem.getFieldName()
            "return this[this.form.fieldIdProperty]"
        FormItem.hasErrors()
        FormItem.$15x(_1=>"formCell")
        FormItem.getCellStyle()
        FormItem.$140()
        FormItem.getCellHeight(_1=>undef)
        Canvas.applyTableResizePolicy(_1=>Array[1], _2=>100, _3=>20, _4=>2, _5=>Array[2], _6=>undef, _7=>undef)
        DynamicForm.getInnerHTML(undef)
        Canvas.$px(_1=>undef)
        Canvas.$rd()
        Canvas.$ra()
        Canvas.redraw(_1=>false)
        Class.invokeSuper(_1=>null, _2=>"redraw", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
        Class.Super(_1=>"redraw", _2=>Obj{length:1}, _3=>undef)
        DynamicForm.redraw(false)
        Canvas.redrawChildren()
        ** recursed on Canvas.$ra
    The main objective is to simply have this pulldown menu jump the user to an anchor further down the page. This is of course inside of a HTMLPane. Is there some other way of doing this, or is there something I'm doing wrong? Keep in mind that I'm loading the same page, just trying to put the anchor on the URL.

    Thanks,
    Stan
    Last edited by svonmiller; 17 Sep 2010, 12:02.

    #2
    This is caused by invalid usage somewhere outside of the code you've shown. Note the warnings about colliding IDs and forms being destroyed. You are probably creating forms twice, or trying to re-use items across forms (which is invalid and will also cause warnings).

    Comment


      #3
      It looks like it must be because I'm loading the same page into the pane. Do I need to destroy this form object before reloading the page? Is there a simpler method of trying to do this? I just want to have a pulldown menu to takes the user to a named anchor further down the page. Would be simple to do with a regular HTML select form object, but of course I want to do it with smartclient.

      Comment


        #4
        What do you mean you're "loading the same page into the pane" - are you trying to load SmartClient components into the HTMLPane? There are big prominent warnings in the docs telling you to never do this.

        Comment


          #5
          Yes, I've been building an entire framework around this method. If there are big prominent warnings in the docs, I'd like to know where. They certainly are not in the docs for HTMLPane. There are no warnings there about that at all.

          The approach I'm trying to build is just like the demo explorer for SmartClient. When you click on the left nav, a center content section refreshes, but not the entire page. If there is another way to do this, other than using an HTMLPane, please advise.

          Comment


            #6
            HTML content can be loaded and reloaded from a URL via the property contentsURL. This method of loading is for simple HTML content only; SmartClient components should be loaded via the ViewLoader class.
            From:

            http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#class..HTMLFlow

            Also:

            contentsType:"page" should only be used for controlled HTML content, and only when such content cannot be delivered as an HTML fragment instead (the default). To dynamically load SmartClient components, use ViewLoader, never this mechanism (click here for why).
            From:

            http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#attr..HTMLFlow.contentsType

            And then:

            Loading the SmartClient framework into multiple frames or iframes within the same browser is not a supported configuration, or more accurately, not a supportable configuration, for the following reasons:
            Which is the beginning of:

            http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#group..noFrames

            Comment


              #7
              Those are docs for HTMLFlow. As I've mentioned throughout the thread, I'm using HTMLPane, and I've been looking at the HTMLPane documentation. If this is a problem for HTMLPane, then it should be listed there as well.

              However, I didn't purchase support so you can point out to me that I didn't read the docs (which you often do on this board). I've listed in this thread several times what I'm trying to do, you've not once given me a suggestion on how to achieve it. This is not why we purchased support, and I don't appreciate the snarkey responses I often get in response to questions. Perhaps you could tell me how to do what I'm trying to do, as I've asked several times, or forward this off to someone on your team who is better with working with customers.

              Comment


                #8
                We're not misreading your question.

                class HTMLPane extends HTMLFlow
                All properties of HTMLPane inherit from HTMLFlow - it has no unique properties. It is literally the same class with a different default setting for overflow. The documentation for eg contentsType for HTMLPane is the documentation for HTMLFlow.

                As far as wanting a suggestion for how to achieve your use case - we just answered that question:

                To dynamically load SmartClient components, use ViewLoader, ...
                If you go look at ViewLoader, there's overview information, a whole chapter on choosing the right architecture, and a running sample. You should review all of it.

                You are getting correct and complete answers far faster than you've paid for (eg 35 minute response time when you paid for 72 hours). Note that it's standing policy to point to the docs since they are professionally written and deeply interlinked with other related topics. It's better to send you to the relevant docs with some context than to re-explain the same thing in the forums.

                Comment


                  #9
                  Just to make it crystal clear: we don't point you to the docs because we're trying to make fun of you, so please don't assume that. We point you to the docs because it will answer your current question and the next five related questions.

                  Comment


                    #10
                    The feature explorer approach is exactly the style of interface I'm trying to create (static left navigation loading a dynamic pane on the right). In the docs, it sounds like viewLoader might be a problem with IE 6 (with our clients anyway) and it also sounds like I may take a performance hit. Or at least circumvent some of SC's architecture advantages.

                    Is the viewLoader approach how the FeatureExplorer was created? I was hoping to have a look at com.isomorphic.servlet.FeatureExplorerRPC so I could see how you did it, but I've not been able to locate any source for it.

                    Comment


                      #11
                      You wouldn't want to look at FeatureExplorerRPC source code, it's doing something much more complex than just navigating and loading components and would not be a good example for you.

                      As you alluded to, the SmartClient Architecture topic tells you to pre-load your views. Is there anything about your application that prevents this? If not, best to focus on this approach.

                      Comment


                        #12
                        The application is quite large, so it wouldn't be feasible to preload views for the whole app. The number of objects would be enormous. I suppose I could segregate the app to use views for sections, but I'd still have a lot of full page reloads, which I was trying to avoid. I'd also have a lot of SC objects in memory, as the pages have a fair amount of complexity.

                        Another approach would be frames, but I already know that's not a good way to go either for a variety of reasons (most of which are listed in your docs). It's beginning to sound like having static navigation with a dynamic content pane isn't going to work for us. At least not for the entire application. I'll have to rethink how we might segregate the application into manageable groups of views.

                        Comment


                          #13
                          See the architecture overview: if you're defining functions/methods that create the components on demand, there is very very little memory footprint from loading even thousands of screens up front. And the code size is also very small.

                          So you want to take that approach unless you have very unusual requirements (an example would be that you need to do all event handling on the server side).

                          Comment

                          Working...
                          X