cancel
Showing results for 
Search instead for 
Did you mean: 

How to change selection property of context to 0..n ?

Former Member
0 Kudos

Hello,

I can't cange selection property of context to 0..n. Some other fields in property page of Context element are changeble but selection is set to 0..1 and does not allow to change.

Could you please help ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

See to avoid this what you can do-> Suppose you have create a context node and you changed some of its property. Now creating the same type of node what you can do just copy the previous node and just paste it where you want to create same type of node.

This will minimize such type of error and wastage of time.

Regards

Narendra

Former Member
0 Kudos

See to avoid this what you can do-> Suppose you have create a context node and you changed some of its property. Now creating the same type of node what you can do just copy the previous node and just paste it where you want to create same type of node.

This will minimize such type of error and wastage of time.

If I stay in Context of in View Editor, I copy and paste one of existing node of request with its subelements, response and result elements. I suppose this one new structure will automatically connected with coresponding webservice method ? How can I use it from logic of view ?

Is it enough to use lines below to call method of webservice, or I have to do additional initialization ?


wdContext.currentFilterCompany_2Element().setACompanyId("0008");
wdContext.currentFilterCompany_2Element().modelObject().execute();

Could you please suggest me some tutorial how to use technic copy/paste of context node ?

sanyev
Active Participant
0 Kudos

Hi Sergey,

Selection cardinality of a mapped node being fixed is ok. You are not supposed to change the selection cardinality of a mapped node. The mapped node will take the selection cardinality of the original node. So your context size becoming zero has nothing to do with the selection cardinality of the mapped node.

From your previous posts what I could understand is that you need to execute a webservice model, then make some changes and then re-execute the webservice model without affecting your original data. Correct me if I am wrong.

Once you execute a webservice model if you execute the same model again old data will be refreshed. If you don't want the old data to be refreshed then you need to have two instances of the webservice model.

I would suggest you to use separate controllers for that. One can be your component controller (can be mapped to the view and UI elements) second one can be a custom controller. (can be done in the component controller itself but will make things complecated.) Both the webservice models has to be initialized and executed separately.

Sanyev

Former Member
0 Kudos

Hello Sanyev Babu,

Thank you very much for good idea, I'll try your approach.

I think it will help me.

Answers (4)

Answers (4)

Former Member
0 Kudos

I made new model and all necessary work to run webservice method, but received the same exception during runtime like described in my another post.

I don't know the reason (((

Edited by: Sergey Chernushenko on Feb 10, 2009 4:05 PM

Former Member
0 Kudos

Strange but even after copy new context mapping has selection property 0..1 (((

Former Member
0 Kudos

Hi,

You need to change the selection property of both contexts(View as well as component controller). The properties must be same.

Please revert if you require more info.

Regards

Narendra

Former Member
0 Kudos

Hi Sergey,

Please check if you have done the mapping between this View Context element with component controller context etc.

You need to remove the mapping then you can change the selection property of context.Then again you can map it.

Hope this will help

Regards

Narendra

Former Member
0 Kudos

Thanks,

I deleted mapping, changed property selection. But now I can't restore mapping. Appeared new arrow from view to model directly, not to Component Controller. Now I can't even delete this arrow

Former Member
0 Kudos

Hi,

Delete the mapped node in view and the mapping wil be removed automatically. You can again carry out the steps to map from model to controller and from controller to view.

Regards,

Murtuza

Former Member
0 Kudos

When I create mapping I drug and drop context from right side to left side. Element node Result_bla_bla_bla under element node Response... became with selection property 0..1 but corresponding result element of model context has selection property 0..n. Is it bug ? I can't change this property when mapping exists, so in order to change it I must delete mapping. When mapping deleted I cant restore it because appears arrow pointed directly to model.

Former Member
0 Kudos

Hi,

This is not a bug. This is how the java proxy classes are generated out of your defined structures in R/3. Please elaborate what is the problem that you are facing and why do you want to change this property?

Regards,

Murtuza

Former Member
0 Kudos

This is continue of problem started here

I want to use one method of webservice twice in diferent places of one application. In order to make it I applied template on Component controller from right click context menu. Now I try to make new context hiererchy like already existed in application but connected with new method of webservice (made using template above). I noticed that Result element of mapping has selection property 0..1 not like as in other existed mapping where 0..n.

I suspect that it is the reason of problem where in code I receive size of wdContext.nodeCompanyCheckResult().size() = 0

P.S. I can't debug application because it hungs server very often so I obliged use some absurd method to understang If code worked well


  //@@begin javadoc:onActionCheckCompany(ServerEvent)
  /** Declared validating event handler. */
  //@@end
  public void onActionCheckCompany(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionCheckCompany(ServerEvent)
    
	requestCompanyCheck = wdContext.currentCompanyCheckElement();
	
	sDebug = " onActionCheckCompany ";

	requestCompanyCheck.setACompanyId(contextElement.getCompanyID());
	
	companyComponent.executeCompanyCheck();
	
	responseCompanyCheck = wdContext.currentCompanyCheckResponseElement();
	
	resultCompanyCheck = wdContext.currentCompanyCheckResultElement();
		
	if (responseCompanyCheck != null) {
		sDebug += " responseCompanyCheck not null";
	} else {
		sDebug += " responseCompanyCheck null";
	}
	
	resultCompanyCheck = wdContext.currentCompanyCheckResultElement();
	
	if (resultCompanyCheck != null) {
		sDebug += " resultCompanyCheck not null";
	} else {
		sDebug += " resultCompanyCheck null";
	}
	
	sDebug += "size:" + wdContext.nodeCompanyCheckResult().size();
	//sDebug = " company Id=" + resultCompanyCheck.getCompanyId(); 

	contextElement.setSDebug(sDebug);
    
    //@@end
  }