Announcement

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

    Resize/position of widgets in tabset pane

    Should a widget added in a tabset pane get sized and positioned according to the pane? I can't find anything in examples or documentation that speaks to this. Am very new to SmartClient. When I do the following, the ListGrid in the first pane sizes within the pane (maybe that's just an accident), but the Calendar in the second pane uses up the whole browser screen, occluding the TabSet. Do I need to hardcode the size of the TabSet and the Calendar, or is there a way (using the right layout calls), to get the contents of a pane to conform to whatever the pane's sizing is (I know how to enable scroll bars on widgets, so if a widget stays within the pane, and some of it isn't visible, then the user will simply need to scroll the rest into view.

    So, the question again is: what is the recommended way to get a widget to conform to the size and position of the pane that it is associated with? Thanks for any light you can shed.

    My code:


    isc.TabSet.create({
    top:40, left:40, width:1000, height:800,
    tabs:[
    { title:"Voter List",
    pane:isc.ViewLoader.create({
    autoDraw:false,
    viewURL:"./votergrid.js",
    loadingMessage:"Loading Grid..."})
    },
    { title:"Calendar",
    pane:isc.ViewLoader.create({
    autoDraw:false,
    viewURL:"./campaigncalendar.js",
    loadMessage:"Loading Campaign Calendar..."})
    }

    ]
    });

    And here is the calendar widget create:

    isc.Calendar.create({
    ID: "eventCalendar",
    data: eventData

    });
    Last edited by slatzPDQ; 7 Aug 2012, 00:35.

    #2
    You should work with percentages instead of hard coded pixels ("100%" instead of width:1000)

    Comment


      #3
      Resize/position of widgets in tabset pane; followup

      1. Should have mentioned, I am using an eval copy of SmartClient 8.2 that I just downloaded.

      2. In response to the suggestion that I use percentages for size; I've tried that already. The problem is the Calendar doesn't have any notion of the Tab pane that it is supposed to be a part of, and positions and sizes itself by default to take up the whole browser screen -- how do I get the Calendar to stay inside the pane without having to manually position and size it?

      Comment


        #4
        Is there a bug in Calendar -- does not conform to size/position of tab pane

        A bit more info:
        My initial tabset contained a listgrid and a calendar. I have now created a tabset with a form, a listgrid and a calendar. When I click on the form tab, the form appears. When I click on the listgrid tab, the listgrid appears. It is sized to width: "100%" and height: "100%", but it always sizes itself with the size of its pane. If I resize the tabset, the listgrid resizes with it (and scrollbars appear, according to how I've set its properties).

        After clicking the listgrid and watching it load and fill out the full tab, I click on the form tab, and it appears, with the listgrid being completely occluded -- exactly what I'd expect.

        So, when I click on the calendar, with its width and height sized to "100%", it does not confine itself to the size of the tab pane, but fills up the whole screen. When I click on one of the other tabs, the calendar stays on top.

        Unless a Calendar has some different behavior, it is not behaving the way I would expect a widget created in a tab pane should behave (and the way I have now confirmed that at least two other widgets behave).

        Please confirm or explain.
        Last edited by slatzPDQ; 7 Aug 2012, 11:16. Reason: correction

        Comment


          #5
          Read the SmartClient Architecture topic - ViewLoaders are for legacy situations only and it's basically always wrong to use them for a new app.

          Use the Watch Tab in the Developer Console to understand component sizes. You may think a size setting on Calendar is wrong, when it fact it's filling it's containing Layout which is sized incorrectly.

          To get from Isomorphic or others, post runnable code. Prose descriptions don't work because the error could be a typo or other error in the actual code that the prose description does not reveal.

          Also, wrong forum (we'll move the thread).

          Comment


            #6
            Thanks for the response, but....

            Hi.

            Thanks for the response. A few points, though:

            1. What forum should this sort of question be posted in, if not Technical Q&A?

            2. The reason I was using ViewLoader is I was following your example for TabSets. Suggest you have someone correct this.

            3. I did post complete and runnable code in the original thread post, and was referring back to that in most cases.

            Regards

            Comment


              #7
              1. We just moved it to "Technical Q&A", it was previously in SmartGWT Technical Q&A (wrong product)

              2. The docs around ViewLoader make it very clear that ViewLoader is for a narrow use case - be sure to read the ones we referred you to.

              3. But you've modified it since. One again, prose cannot be debugged, so if you've made changes and are seeing new behaviors that still aren't right, you need to post the new code so people can spot things like typos.

              Comment


                #8
                Got it working; thanks for the help

                Once I dispensed using ViewLoader, created a calendar instance with autodraw: false and then declared it as part of one TabSet pane, everything worked exactly as expected.

                Thanks for the help. But I reiterate that you need to change the TabSet example so that it doesn't use ViewLoader anymore.

                I agree that the references you provided allow one to understand that ViewLoader is deprecated, but throughout all your literature, you recommend that one can clone the examples, so it is important that they reflect current best practices.

                thanks again.

                Comment


                  #9
                  We also need examples of techniques that aren't the first choice, since legacy situations are not exactly uncommon.

                  The description in the example and the docs already make it clear that it's for unusual situations - just make sure to read the description of an example to make sure you aren't using a technique designed for a different circumstance, because there are a few more such samples, each clearly labelled.

                  Comment


                    #10
                    Important to get things right

                    Hi

                    I don't want to belabor the point (since neither of us is running for President), but I followed the example at:

                    http://www.smartclient.com/#viewLoading

                    And nowhere in that reference does it say anything about view loading being deprecated or legacy and therefore not working. You need to update that specific example so that someone won't waste a day like I did trying to get something to work.

                    I am not making this suggestion to be difficult, but to make your product and its presentation/marketing even better, so please do not take offense.

                    Best regards
                    Steve

                    Comment


                      #11
                      Correct, the example description doesn't say that ViewLoader is "deprecated or legacy and therefore not working" because none of that is true.

                      ViewLoader is not broken, something was wrong in your usage.

                      Instead of trying to analyze your usage, we recommended getting rid of ViewLoader simply because you shouldn't have been using ViewLoader in the first place.

                      What the example description says is:

                      Code:
                      Declarative view loading allows extremely large applications to be split into separately loadable chunks, and creates an easy integration path for applications with server-driven application flow.
                      Neither situation applies you to, and the docs for ViewLoader feature a very prominent note that directs you to review the SmartClient Architecture before trying to use ViewLoader; that document in turn goes into detail about when dynamic loading of screens would be appropriate.

                      So we feel this is already neatly covered in the sample and docs, with increasing level of detail the deeper you go.

                      Just be sure to read example descriptions and docs.

                      Comment


                        #12
                        And one more thing....

                        In a prior comment in this thread from you (or one of your colleagues), you state: "Read the SmartClient Architecture topic - ViewLoaders are for legacy situations only and it's basically always wrong to use them for a new app."

                        I don't think there was anything wrong with my code. Once I read the comment above (posted yesterday), I dispensed with ViewLoader but otherwise left all code intact -- and the calendar instance now behaves as a child of the tabset/pane, so that position and resize follows the parent, the way I expected.

                        I will return to this in a few weeks when I actually have enough experience with SmartClient to fully understand what's going on, and will provide you with code at that time, but based on everything I know, I think that Calendar objects don't work well with view loading.

                        But, let's leave it at that. I like your product. I intend to buy it for my own small shop. More importantly, I intend to recommend it to my clients once I understand it. That might generate you guys some serious revenue. I want to have a good relationship with Isomorphic. I am not trying to be difficult, just make a constructive suggestion. Thanks much for your time.

                        Regards

                        Comment


                          #13
                          Just to close this out, this statement:

                          "Read the SmartClient Architecture topic - ViewLoaders are for legacy situations only and it's basically always wrong to use them for a new app."
                          .. was correct, and not in conflict with anything else we've said..

                          As far as we can tell, you're confusing the idea that a ViewLoader is *designed for legacy situations* with the idea that *ViewLoader is itself legacy code*.

                          ViewLoader is not legacy code. It is modern code designed to work around limitations of legacy architectures.

                          Hopefully that clarifies things.

                          If you think there's really an issue with Calendar+ViewLoader and not just with your code, clearly you have no need to figure this out anymore, but a minimal, standalone test case would be the next step as far as looking into that.

                          Comment

                          Working...
                          X