cancel
Showing results for 
Search instead for 
Did you mean: 

clearing the Custom Controller

former_member216611
Participant
0 Kudos

Hi Experts ,

My requirement is I have two view first view is a table view once user a select a row , second view is displayed with this fields in edit mode there user may change the data . for this I created Custom Controller with all the fields so when user select a row that will be in second view . Now In first view I have a button New entry when user clicks on New Entry I want to call second view with no data ,but I get the first entry in the table view .

I bind the both view views to the same custom controller . so how can I delete data in custom controller ,Bcz when I check the CURRENT object in Get methods it contains data

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I understand you have created two views. But are both views look same ? If yes, you dont need to create two different views for edit mode/display mode.

If two views are different then, when you click new entry, you should not delete the custom controller data as it will delete the data from the previous screen also when u come back there.

The ideal way to pass data to the next screen is passing the collection thru the nav link. So when u editing existing data, that collection should have one existing entity in edit mode and when u click new, the collection should be having one entity with all fields blank.

You can pass the collection in two different methods like edit and on_new_entry.

former_member216611
Participant
0 Kudos

Thank you very very much for your reply , Both are different views first one is table view with first attribute type is link , example take it as serial number when user clicks on serial number that serial number data open in another view there user may change data , and I have button Name as Newentry in first screen ,when user clicks on new entry it need to fetch max serial number and increment that number and that number only visable in next screen , no need show other details .

to show clicked entry I write code like this in the event click ( which was created by me)

DATA:LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.
  LR_ENTITY ?= ME->TYPED_CONTEXT->SEARCHNODE->COLLECTION_WRAPPER->FIND( IV_INDEX = LV_INDEX ).
  CHECK LR_ENTITY  IS BOUND.
  DATA:LR_COLLECTION TYPE REF TO IF_BOL_BO_COL.
  CREATE OBJECT LR_COLLECTION TYPE CL_CRM_BOL_BO_COL.
  LR_COLLECTION->ADD( LR_ENTITY ).
  CALL METHOD ME->OP_TOSELSCREEN( IV_DATA_COLLECTION = LR_COLLECTION ).

when user clicks on newentry

I want to go next view max+1 of serial number and reaming attributes be empty

Thanks In Advance

Edited by: siva_crm on Oct 19, 2011 1:48 PM

Former Member
0 Kudos

You should remove the custom controller binding from the next view. So when u execute event click , the above lr_collection should be used to populate the context nodes of the 2nd view. u have to code that to populate the context nodes.

In case of the event newentry , you should create a blank entity of the same type and add it to the collection and pass the similar way like u did in click method. if you need some serial number to be populated then u should populate that field with using the bol methods like set_property before adding the blank entity to the collection.

Also when u edit in the next screen, you dont have to do any custom code to reflect that change in the custom controller. But while adding new entry, you need to add some custom code so that new entity is added in the custom controller context node collection in some event method of the 2nd view.

former_member216611
Participant
0 Kudos

I am very very thankful to you Asen ,My problem was solved . I rewarded the points to you.

Answers (0)