on 03-26-2008 12:23 PM
Hi,
1.Can we call WDDOINIT() method from any other method ??
2.if yes can we call WDDOINIT() method present in one view ,from any other method
present in some other view?? and how can do that?
Thanks,
Deepika
hi,
wdDOInit method is a hook method which would called by the framework to initialize the controller. and this method is going to be called only once to initialize .so we can't have a controll on the wdinit() .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Then my qst is : if view 1 will call view 2, at that time wddoinit( ) method will be called or not??
if not, then which method will be called when we ll call view 2 from view 1???
Actually,my requirement is:
a. In view 1's wddoInit( ) method i wrote one select statement which will select data from pa0023 table.
b. in view 2 i m inserting one record to the above pa0023 table.
c. so when i will go back from view 2 to view 1, i should get the newly inserted record in view 1 ( which i have inserted in view 2).
For this condition what i need to do ?? can u please suggest??
can we use any other system defined method?
Thanks,
Deepika
Hi Deepika,
wdDoInit() is almost same like init() method in servlets. everytime ur view is initialized , it will be called by framework.
For ur requirement, better u store values from both views in component controller's context & get the values from there. make sure while navigating u refresh ur table . that should solve ur problem.
regards
Sumit
Hi
whatever the value inserted in the view 2 should be get displayed in view 1.
You will be having a value node with value attributes binded with the pa0023 table.
Create Context mapping so that value node will shared with the View1 and view2 (Create that value Node in the Component Controller).
Whenever you insert the values in the View 2, first invalidate node and then insert the values and now navigate to the view1. You will find the record what you inserted in the view 2.
Regards
Chandran S
Hi Deepika,
From the problem statement, what I understand is, you have 2 views, view1 and view2. On view1 you perform some operation, which will cause updation of the data shown on view2. For view2, the Data Retrieval Logic is performed in wDoInit() method and hence you are not able to get the updated data.
If this is the case, then instead of using hook method wDoInit(), as you will be navigating between Views with the help of plugs, use onPlugFrom<View1> method in view2 for the Data Retrieval Logic.
Hope it helps.
Regards,
Alka.
Thanks a lot for your answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi deepika,
It is possible to invoke wddoinit() method from anywhere,
case 1:
1. use this keyword, to call wdDoInit() method from anyother method present inside the same class.
2. Or, just create an Instance of your class.
Example,
SampleView sample = new SampleView(wdThis);
case 2:
1. Create a context attribute in Componenet Controller, of type
mentioning your view. eg: IPrivateSampleView.
to select this type,
goto properties of context attribute, select type, you can find one popup window, in that, select java native type, and select browse, and just enter IPrivate, now you can able to see your view name there, then select appropriate type.
2. Map that context to both views using context mapping, now initilize that context attribute, from first view as follows
wdContext.current<Nodename>.set<attributename>(wdThis);
3. From another view just create reference,
SampleView sample = wdContext.current<Nodename>.get<attributename>(wdThis);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
You can call wddoinit() method however, it is mainly required to initialisation purpose. If you need to use the same coding, write it in another and then call it according to need.
And while using view, we have to keep in mind that the life-time of a viewcontroller is only till the view is open, so if the controls paases to another view, then it is not possible to call any method wddoinit() of another method because that view too will have another wddoinit() method of its own.
regards,
pinki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Theoretically, yes, but you shouldn't. The hook method are called by the framework and should not be called by application code. If you want to call the code inside wdDoInit() from other methods too, just put it into a separate method and call this from both places.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.