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 18.104.22.168
This topic has been locked.
7 replies Latest Post - 2012-07-05T08:44:20Z by SystemAdmin
Pinned topic main Action list should be called on click of tabs
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-07-05T08:44:20Z at 2012-07-05T08:44:20Z by SystemAdmin
Re: main Action list should be called on click of tabs2011-12-02T16:16:31Z in response to SystemAdminYou 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.
Re: main Action list should be called on click of tabs2011-12-02T18:55:03Z in response to SystemAdminUmm, 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.
Re: main Action list should be called on click of tabs2011-12-03T14:23:31Z in response to SystemAdminHi 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
Re: main Action list should be called on click of tabs2011-12-06T12:31:46Z in response to SystemAdminI'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 060000VQ20352 PostsACCEPTED ANSWER
Re: main Action list should be called on click of tabs2011-12-06T15:20:28Z in response to SystemAdmin> 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.