on 05-10-2007 3:19 PM
Hi All,
I am using 3 function modules in my application.
I created views, for reading data from database and another for updating values in database. For Viewing View (Project_View Function Module), For Updating view (Project_Edit Function Module). When user cliecks UPDATE button on Viewing page(Table DATA), it passes viewing values to Updating view.
i.e. wdContext.Arch_Project_Edit_InputElement().SetTitle(wdContext.Arch_Project_ViewElement().getTitle).
It passing values from Viewing view to Updating View.
When i press UPDATE button on Updating View its updating my database. For only one record.
<u><b>MY QUATION HERE:</b></u>
When i click back button in Updating view and go back to update view. And if i select another record, Previous values are appearing in Update View.
Any idea ?. Sample code would be helpful.
Thanks and Regards
Ravi Golla
Coding must be in WdModifyView() not in wdInit();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ravi,
Please try a small test: for the Update view on "Properties" of view editor change Lifecylce property value from "framework_controlled" (it's a default) to "when_visible".
Typically this solves (without coding) majority of problems when view is not reinitialized correctly. Btw, in this case remove invalide() or bind() calls suggested by Abhijeet.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valery,
I see your posts, thanks for your replies. my view is not refereshing with new values. what do you suggest. And i have another quation. I have a problem with dropdown boxes too. i want to set blank as first value in my dropdown box. SAP has provided with blank but i am using model node. i read about cardinalities and setLeadSelection. but my problem has not been solved. I think you can solve these two problems.
Thank you
Regards
Ravi Golla
Hi,
If i understood correctly, then you have table in edit view, here you select the record and say update so it takes you to update view, here after clicking on UPdate button it updates values in database, i.e rfc getting executed.
and when again you go back to edit view previous values are seen right?, if this is your problem then this is because after updating values to database you gotta execute rfc which brings data to WD, so this updated data will be seen.
If your problem is , after going into update view the previously updated values are still seen , then invalidate() the context node in update view. Remember invalidate(), refresh all the data i.e. deletes. So this context should just be used in Update view , if it is used elsewhere then that data will be lost.
let me know if you have some other problem
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhijeet,
It is model node and cardinality o..n.
My Quation is : why it context is not clearing and only updating one record. when click another record still old record appears in context. i used invalidate() in wdDoExit() and and it Action Method too. but it is clearing all previous data and not appearing any new data even i click new record?. if you have any other idea than invalidate()?
Thank you
Regards
Ravi Golla
Ravi,
oho so it is a model node!!!
One thing you can do is,
when you create element of model node of Updateview, instead of using
addElement(); use bind();
i hope this element addition you are using in when you click on the row in firstview
. bind() replaces the entire existing collection of element so when you will do this ,before navigating to second view the newly added element will become the only element and then only this element is displayed.
About why it is updating only one record, so for that you may required to add all the elements you want to update.(then here before you execute rfc with updated values all the records are need to be kept in node and here bind() should not be used , instead addElement())
let me know if you have problem
regards
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.