Topic
  • 7 replies
  • Latest Post - ‏2012-07-05T08:44:20Z by SystemAdmin
SystemAdmin
SystemAdmin
557 Posts

Pinned topic main Action list should be called on click of tabs

‏2011-12-02T15:41:06Z |
Hi,
I have created tabs model using Model Container builders. The problem is main Action lisr should be called on clicking of each tab.

For example, I have two tabs TabA and TabB. In TabA, initially page1 will be displayed and user can navigate from page1 to page2.
If user clicks on TabB and then comes back to TabA, page1 should be displayed. But it is showing navigated page i.e page2

I am using WPF designer version 7.0.0.2
Updated on 2012-07-05T08:44:20Z at 2012-07-05T08:44:20Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    557 Posts

    Re: main Action list should be called on click of tabs

    ‏2011-12-02T16:16:31Z  
    You didn't say whether you were using Page Tabs or Dojo Tabs, which work very differently. I believe I have a solution if you are using Page Tabs:

    The LJO that is created by Model Container has a setModelInstance() operation to which you can pass a null. This will cause the model instance to be re-created the next time that it is needed. You can put an HTML Event Action on the link of the page that contains the actual tabs. (That page is inserted on all your pages by the Page Tabs builder.) In the method called by the HTML Event Action, set to mull the model instances of all your model containers. That way, every time the user clicks any of the tabs, his current model instance will be released, only to be re-created when he returns to that page.
  • SystemAdmin
    SystemAdmin
    557 Posts

    Re: main Action list should be called on click of tabs

    ‏2011-12-02T18:47:23Z  
    You didn't say whether you were using Page Tabs or Dojo Tabs, which work very differently. I believe I have a solution if you are using Page Tabs:

    The LJO that is created by Model Container has a setModelInstance() operation to which you can pass a null. This will cause the model instance to be re-created the next time that it is needed. You can put an HTML Event Action on the link of the page that contains the actual tabs. (That page is inserted on all your pages by the Page Tabs builder.) In the method called by the HTML Event Action, set to mull the model instances of all your model containers. That way, every time the user clicks any of the tabs, his current model instance will be released, only to be re-created when he returns to that page.
    Hi Steve,

    Thanks for your reply. I am using Page Tabs and Model Container. I don't see setModelInstance method in the LJO created by Model Container builder.
  • SystemAdmin
    SystemAdmin
    557 Posts

    Re: main Action list should be called on click of tabs

    ‏2011-12-02T18:55:03Z  
    Hi Steve,

    Thanks for your reply. I am using Page Tabs and Model Container. I don't see setModelInstance method in the LJO created by Model Container builder.
    Umm, look again?

    If you checked "Load when Visible" then there are two LJO's created. Perhaps you looked at the wrong one.

    Did you know this? ... if you click on the right arrow for a particular builderCall in the BuilderCall list (the Outline View) it will select in the Application Tree all the elements that that Buildercall created.
  • SystemAdmin
    SystemAdmin
    557 Posts

    Re: main Action list should be called on click of tabs

    ‏2011-12-03T14:23:31Z  
    Umm, look again?

    If you checked "Load when Visible" then there are two LJO's created. Perhaps you looked at the wrong one.

    Did you know this? ... if you click on the right arrow for a particular builderCall in the BuilderCall list (the Outline View) it will select in the Application Tree all the elements that that Buildercall created.
    Hi Steve,

    I am attaching my sample project. Sorry I didn't found 'Load when visible' checkbox. I have observed 'Linked Models' and 'Linked Java Objects' section in the 'Application tree' but didn't foud setModelInstance() method
  • SystemAdmin
    SystemAdmin
    557 Posts

    Re: main Action list should be called on click of tabs

    ‏2011-12-06T12:31:46Z  
    Hi Steve,

    I am attaching my sample project. Sorry I didn't found 'Load when visible' checkbox. I have observed 'Linked Models' and 'Linked Java Objects' section in the 'Application tree' but didn't foud setModelInstance() method
    I'm quite puzzled. I am using a more current version of the Factory, but I'm pretty sure that API hasn't changed in years. Try the following, and I'll show you some cool tricks, as well.

    1. Open any model with pages on it.
    2. Create a Model Container builder
    3. Name the Model Container zz, put it somewhere on a page. (It doesn't matter where, we're not going to run it; I just want it not to have errors.) Point it to any other model. Hit OK.
    4. Create a new Method builder.
    5. Click the little tab so that you can see the Application Tree while the Method Builder is open.
    6. Find the Linked Java Object named zz. Drag it into the body of the Method builder. It should become
    com.bowstreet.builders.webapp.methods.ModelContainer zz 
      = (com.bowstreet.builders.webapp.methods.ModelContainer)webAppAccess.getVariables().getObject("zz");
    

    Pretty cool, eh?
    7. Below it, type "zz." (without the quotes, but including the dot).
    8. Press Ctrl-Space. You should get a pop-up with all the legal choices. It should include setModelInstance among the choices.
    Updated on 2014-03-25T15:49:36Z at 2014-03-25T15:49:36Z by iron-man
  • mburati
    mburati
    352 Posts

    Re: main Action list should be called on click of tabs

    ‏2011-12-06T15:20:28Z  
    I'm quite puzzled. I am using a more current version of the Factory, but I'm pretty sure that API hasn't changed in years. Try the following, and I'll show you some cool tricks, as well.

    1. Open any model with pages on it.
    2. Create a Model Container builder
    3. Name the Model Container zz, put it somewhere on a page. (It doesn't matter where, we're not going to run it; I just want it not to have errors.) Point it to any other model. Hit OK.
    4. Create a new Method builder.
    5. Click the little tab so that you can see the Application Tree while the Method Builder is open.
    6. Find the Linked Java Object named zz. Drag it into the body of the Method builder. It should become
    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">com.bowstreet.builders.webapp.methods.ModelContainer zz = (com.bowstreet.builders.webapp.methods.ModelContainer)webAppAccess.getVariables().getObject("zz"); </pre>
    Pretty cool, eh?
    7. Below it, type "zz." (without the quotes, but including the dot).
    8. Press Ctrl-Space. You should get a pop-up with all the legal choices. It should include setModelInstance among the choices.
    > I'm quite puzzled. I am using a more current version of the Factory, but I'm pretty sure that API hasn't changed in years.

    I haven't had time to look at your models, but wanted to add a point of interest related to Zag's comment. While that APi may not have changed in years, some related behavior may have. I'm pretty sure that between 7.0.0.x and 7.0.1, Model Container was changed to add the LinkedModel and LJO at design time even if some of the builder inputs were indirect refs (like the model name itself). I'm not saying this is your issue, as now that I look at it, it doesn't look like you're using indirect refs for the model name, but it is a change between the older release you're using and the more current release Zag tried it on.

    ..mb1
  • SystemAdmin
    SystemAdmin
    557 Posts

    Re: main Action list should be called on click of tabs

    ‏2012-07-05T08:44:20Z  
    my question is answered. Thanks to SteveZag