cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed in Changing Existing Records

Former Member
0 Kudos

Hi,

In my application i need to change or edit the existing data .After changing i need

to save it .I have two views DisplayView and EditView .I have one controller named EmployeeComp .There is a UI element in the DisplayView named "EmployeeName" and one value attribute in the view context named "ctx_employeeName" .I have created another context attribute in the component controller and in the second view in the same name and have done the context mapping from view to controller correctly .

There is an action named "onActionChange" which is attached to a button on the DisplayView .On Clicking the change button the action should go to next view i.e EditView .The employee name should be in editable mode and after i change the name and click the submit button on the second view ,it should save the new edited data .

I am facing problem while writing the code for changing the data and then saving it .Can anybody tell me the code to change the data and to save it .

Thanks .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

There will not be any problems as long as you have mapped the same context across the two views .

If the context is mapped then Context always have the updated data.I don't think you need to write any code for that.

Regards,Anilkumar

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Kl,

As far as I see there could be no problem involved in this:

Try the following for the name field :

View 1(Read Only) View 2(Editable)

Context : Attribute Name----


>Name

Once the attribute is mapped.Navigate to another view there is nothing else required.

Regards

Amit

Former Member
0 Kudos

Hi,

You dont need any coding to set the changed value back to the context attribute.

Since you have mapped the context attribute in the DisplayView and EditView to a context attribute of component controller. So after viewing the name in your DisplayView when you navigate to EditView onActionChange,you can change the value.When you cahnge the value and submit the new value that is entered is update across the component controller and DisplayView context.

To see this create a action onActionSubmit in EditView and navigate to the DisplayView, you will see the updated value.

In webdynpro framework when the value of a context attribute is changed, then the value gets updated across all views to which the context attribute is mapped.

Former Member
0 Kudos

Hi,

1)Create attribute as NAME in component controller

2)Context map that attribute to the both the views

3)In both the views,bind that attribute to UI element(Input Field)

4)Insert button to both views and also create action like, click------>

first button----->secondview

click-->second view button--


>firstpage

Try the above steps,

whatever change in first view it will update in seond view,if u change in second view it will update in first view....