cancel
Showing results for 
Search instead for 
Did you mean: 

How do i delete a duplicate method

Former Member
0 Kudos

Hello Friends,

In my component controller a method has created twice and it showing a error like duplicate method and when am trying to delete it, it doesn't delete.can anybody help me how do i delete it.

Accepted Solutions (0)

Answers (4)

Answers (4)

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Please note that when you are deleting a method, select "All" option but not "Yes" option.

Because, Yes option will delete method from Methods tab but not the implementation part, whereas if u press All... it will delete the method from Methods tab and the corrosponding implementation of the method will get commented and this commented code you can find at the end of your implimentation....

Regards,

S.S

Former Member
0 Kudos

Hey guys get rid of dat..revert back to my backup..Thanks

Former Member
0 Kudos

Hi Priyaranjan

Could you clarify if you have created this method on Methods tab in component controller or you use some other way to create it?

And please provide the code snippet of both methods in your component controller. I think it may help to solve your problem.

Regards

Ivan Dulko

Former Member
0 Kudos

public void refresh( )

{

//@@begin refresh()

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

try

{

wdContext.currentGlobalTypesElement().setPageHeader("");

wdContext.nodeGlobal_AP_Header().invalidate();

wdContext.nodeGlobal_AP_Item().invalidate();

wdContext.nodeLocal_AP_ItemDetail().invalidate();

wdContext.nodeLocal_AP_ItemMoreDet().invalidate();

wdContext.nodeLocal_UserAction().invalidate();

wdContext.nodeFileAttachments().invalidate();

//Invalidates the Node to clear the previously selected Document date and company code

wdContext.nodeLocal_PayTerm_F4().invalidate();

}

catch (Exception e)

{

msgMgr.reportException(e.getMessage(),false);

logger.errorT("Error in method refresh");

}

public void refresh( )

{

//@@begin refresh()

//@@end

}

And the second (Bold) refresh method is duplicated and there is only one method in my method tab...its not removing by just remove the tab..so could u plz help me out

Former Member
0 Kudos

Remove the following three bold lines from your code. Please note that every properly defined method will start with //@@begin <methodname> and ends with //@@end You should write your code only between those two sections.

public void refresh( )

{

//@@begin refresh()

Former Member
0 Kudos

Hi

Try commenting first three bold lines, Also check if either any action available to corresponding method. if yes try deleting that action with "Delete corresponding method /action handler" option checked.

Thanks

Mandeep Virk

Former Member
0 Kudos

Open your View / Component Controller and click on the tab "Methods". Select the method you want to delete and right click to see the option "Delete"

Cheers,

~kranthi

Former Member
0 Kudos

Hi kranthi...I have tried in this way too it get delete from the method but in my implementation part it still showing..

when i try to delete it..it automatically comes...plz help me buddy

Former Member
0 Kudos

This is weird! From the methods tab, delete it and save your project and restart your NWDS.

Former Member
0 Kudos

no man still the method comes...

Former Member
0 Kudos

delete the gen folders from navigation tab or delete the project from local workspace and verify again.

MSR.