Announcement Announcement Module
No announcement yet.
Newbie question on Pages and Views Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie question on Pages and Views

    Hi all,

    I have recently spent some time with the Spring RCP framework and can only say that it looks very interesting and promising.

    I played with the PetClinic example for a few hours and actually managed to convert the OwnerView into using a table instead of a tree without too much hassle, so it must be good! :-)

    However, the lack of documentation and examples makes it a real challenge grasping even core consepts like Page and View and their roles. According to the User Document ( "Each ApplicationPage is defined by one or more dockable Views placed in different sections of the page area (left, bottom, center, etc)

    I'm having real probles seeing where I can add different Views to a page. From the PetClinic example I can identify the OwnerView and VetView, but it seems to me they are added to different Page's ? At least I can't see how the can be shown at the same time in one page.

    Having programmed Swing for a year or two, mainly with CRUD-like admin-applications I really need a Master-Detail look on things and have also developed my own tiny little framework that provides this in a simple way.

    For example, I can have a tree view for Customers in the left side and their Orders in a table to the top right and their OrderLines at the bottom right, all separated by splitpanes.

    The views are organized in a hirearchical structure so that selecting a Customer in the tree will show the corresponding Orders in the Order's table in the top-right table. Likewise, selecting different Order's will show the correct OrderLine's in the bottom right view.

    In effect, the View's are related to each other in a one-to-many relationship exactly like the corresponding domain model shows and when a parent object is selected, sub-views are notified and can retrieve the corresponding objects using the key of the parent object.

    I can't find any support for this in Spring RC. Having searched the doc and this forum the closest I have come is some advice that one can:

    - create a splitpane in a View and add the different components there, but this means that the realtionship between the "sub-views" are not handled by the framework at all

    - write a separate PageDescriptor that adds more than one view, but I really can't see how these can cooperate without me adding all the code for it. Again, no support for this in the current framework?

    One question here: is it possible to wire up Views in the bean descriptors? I see from the PetClinic example that the views are wired up to the Clinic bean, but could I also wire up the OwnerView to the VetView, or more logically a OwnerView to a PetView (if there was one) since these have a 1:M relationship (I guess one can own more that one pet!)?

    This would give me the relationship I needed between the views, but I am still lost as how to show them in the same Page in an orderly fashion (prefferably a splitpane).

    Ok, this was a lot! Hope it makes som sense and that someone can point me in the right direction.

    Apart from the things mentioned here I see a lot of interesting features in Spring RPC so please keep ut the good work!

    /Ragnar :-)

    PS: The User Documentation referes to "ApplicationPageLayoutBuilder" on page, but I can't find that class anywhere in the source.

  • #2

    I'm not a team member directly, so bear with me as I am learning at a similar speed to you.

    I recently went through the effort of implementing a multi-view page here (incidentally, using a split pane):

    In general, you need a new page descriptor, a new page, and a new window (although the window is incidental to the fact that the default implementation is hard wired for the single view page).

    You are correct in assuming that the default 'out-of-the-box' objects don't support multiple views per page. There is only one page, but when a different view is selected, it completely swaps out the content pane of the page to a completely different control - which is why it seems like many different pages.

    I suggest reading my forum post, and seeing if that works for you. After going through the process of trying to implement it following the feedback from a few other forum threads, I got to a point where I was much more comfortable with what I saw. The documentation unfortunately does not match what is in the source.

    I'm still learning about some of the focus rules etc, but it makes a lot more sense now than it did when I started.

    Give it a shot, put feedback here as you go!

    Last edited by robyn; May 19th, 2006, 04:48 AM.


    • #3
      Also note that the "multiple view" support is currently being worked on.

      Integration with 3rd party docking frameworks will be provided.


      • #4
        Originally posted by rjlorimer

        I'm not a team member directly, so bear with me as I am learning at a similar speed to you.


        Give it a shot, put feedback here as you go!

        Thanks for the feedback, rjlorimer.

        The verification you give is just what I need to go a step further. As soon as possible I will give a shot at implementing my generic, multiple CRUD Views from my own framework into Spring RPC.

        To pdbruycker: Nice that multipage support is beeing worked on. Would it be possible to have a time shedule or a small description on what to expect?

        I feel that the Window/Page/View architecture is probably one of the most important aspects of a Rich Client Swing platform and it seems like a weak spot in Spring RC at the moment, so I really hope it gets the proper attention and priority.




        • #5
          for the moment I think Jim Moore is working on it, I don't know the status for now :oops:



          • #6
            You see snpepetclinic - search forum
            It work with multiple view (I have only one window and page - I don't need more pages, but multiple window isn't implement good for now in RCP)

            I make generic forms for database access, currently, with smart search, sorting, grouping (analitic function), reporting with jasper, master detail views and more



            • #7
              Originally posted by snpe
              You see snpepetclinic - search forum


              Thanks snpe, I found it. Saw it before also, but only found the broken links then.

              However, seems like it is quite out of sync with the current cvs code base.
              I had to tinker a lot with the xml files to get it going and I actually gave up fixing the compiler errors in

              IdwApplicationPageshowView(ViewDescriptor viewDescriptor);
              Seems like the calls you make here:

                         view = createView(viewDescriptor);
              are gone and I don't now how to replace them.

              Would be nice it you could fix that one if you can find the time.

              /Ragnar :-)


              • #8
                use this code:
                super.showView( viewDescriptor );
                view = (View) super.getActiveComponent();


                • #9
                  yes, current snpepetclinic is out of sync with cvs.
                  My currently tree have patched RCP cvs (not last, too).
                  I hope that I finish my work quick.I have next features now in generic form :
                  - insert,delete,update row
                  - search for any field and any condition (<,>,=, like,not like,between,null etc) -
                  condition have be AND or OR - can be as you type
                  - sort work in any combination field with ascending and descendi ng
                  - validation work with revert - don't accpet 7th char for max length 6
                  - user can make grouping table - choose group column, sum,max,min,avg,count and sort this too
                  - master detail
                  - check for primary key and list of values (foreign keys) - as you type

                  I make generic report from table (with search and sort setting) and report for grouping table now and then I set product on my site