cancel
Showing results for 
Search instead for 
Did you mean: 

Cardinality Problem?

Former Member
0 Kudos

Hi all,

I am using Model nodes for getting data and sending data back to BAPI. But if i perform search, i get results and once i come back and perform another search its showing previous results. I am invalidating Context and eventhen it shows previous results. i read in a book i need to create an element. As it is a model node i can't create. Can any one solove my problem. ?

In Controller:

wdDoInit()

{

__Arch__Arm_Project_Search_Input search = new __Arch__Arm_Project_Search_Input();

wdContext.node__Arch__Arm_Project_Search_Input().bind(search);

}

DoSearch()

try

{

wdContext.current__Arch__Arm_Project_Search_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}catch(Exception ex)

{

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(ex.toString());

ex.printStackTrace();

}

in View:

wdContext.node__Arch__Arm_Project_Search_InputElement().invalidate();

I can not understand where i am doing mistake!

Can any one tell me is there any issue cardinality causes Context clearing problem? if yes give some suggistions.

Thanks

Ravi Golla

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try to put

__Arch__Arm_Project_Search_Input search = new __Arch__Arm_Project_Search_Input();

wdContext.node__Arch__Arm_Project_Search_Input().bind(search);

inside the Method itself

AM

Former Member
0 Kudos

Problem Solved by

Creating New Model Element in custom controller, calling method which contains new model element in InboundPlug and

if(!firstTime) in wdDoModifyMethod

{

execute RFC again;

}

Thanks Anoop

Regards

Ravi

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Ravi,

will you please give me the model node structure so that i can send exact code.

With Regards

Naidu

Former Member
0 Kudos

Hi,

In CustomController

wdDoInit()

{

__Arch__Arm_Project_Search_Input search = new __Arch__Arm_Project_Search_Input();

wdContext.node__Arch__Arm_Project_Search_Input().bind(search);

}

public void DoSearch( )

{

//@@begin DoSearch()

try

{

wdContext.current__Arch__Arm_Project_Search_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}catch(Exception ex)

{

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(ex.toString());

ex.printStackTrace();

}

//@@end

}

In View

wdDoInit()

{

wdThis.wdGetArchCompController().DoSearch();

}

Please send me code as soon as possible. Do you undestand my problem?

My problem is getting previous results when i am running search second time.

Thanks and Regards

Ravi Golla

Former Member
0 Kudos

Hi ,

Use this line after invalidate


__Arch__Arm_Project_Search_Input search = new __Arch__Arm_Project_Search_Input();
wdContext.node__Arch__Arm_Project_Search_Input().bind(search); 

Regards

Bharathwaj

Former Member
0 Kudos

Hi Bharathwaj,

Can you suggest me where can i put this invalidate() and instance of model.

Presenly i am keeping this code in wdDoExit() and InBoundPlug().

i do not undestand why my view shows previous results even i invalidated()?

Can you give me briefe information about using this code.

Thanks and Regards

Ravi Golla

Former Member
0 Kudos

Hi ,

Invalidate in case of Adaptive RFC based model nodes is useless , because the supply function for the model node will reload the values from the model every time you invalidate.

To avoid this , instead of invalidate you can bind it with an empty value. (which is wat i have suggested.. ). The

invalidate()

is not needed.

Doing it in a inbound plug to the initial view would be a proper option.

Regards

Bharathwaj

Former Member
0 Kudos

Hi Bharathwaj,

it is not working ? Do you think any other idea.

Thanks and Regards

Ravi Golla

Former Member
0 Kudos

Hi ,

Copy the current value node structure(copyNode1) .. and use it (copyNode1) for binding it with UI elements

Transfer values from the mapped value node to the newly created value node using

WDCopyService.copyCorresponding(mapped value node , copyNode1);

Then whenever u want values , copy frm the mapped node.. if you dont want them.. use invalidate on the newly created node[copyNode1].

Since the new node just copies from the mapped value node.. invalidate would work.. !

Regards

Bharathwaj

Message was edited by:

Bharathwaj