on 03-12-2009 8:26 AM
Hi there,
I understand that we need to initiatlise all elements in a model before it can be binded to the context node. However one of my model has as MANY as 20+ fields. That means I need to initiate all these one by one?
Hi expert,
I do not thing all attribute is initial all your view side...those thing you want show your view that much you need to bind at view context....
thanks
s jati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jackson,
Initialization of model will be required if you wish to give some input parameters from the UI. If you dont initialize, the input fields will come as disabled.
Also, you will need to provide all the mandatory fields before execution.
Hope this solves your query.
Kind Regards,
Nitin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there!
Thanks guys so much! I guessed you guys fixed my confusion.
I have always thought that before binding, all model object need to be initialised. But this is not true. Now I realise only those that you need to use for your UI you need to initialise, if not the UI will be greyed out after you do the binding.
P/S: !!! I have initialised everything up to now!! #$@#$%# 😛
Hi
1.Model doesn't need any initialization at all ,but need a execution with its required input to perform operation in database.
2.If a model require 20 input to execute to proceed, so u have to provide 20 input from view and then execute it
Best Regards
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thanks for your reply.
Can you explain?
Because for webservice, If i don't initiate like below:
// Initialise model objects and relations for Get_SalesOrg
Request_Get_SalesOrgs request9 = new Request_Get_SalesOrgs(model1);
Get_SalesOrgs getSalesOrg = new Get_SalesOrgs(model1);
getSalesOrg.setLanguage("");
request9.setGet_SalesOrgs(getSalesOrg);
wdContext.nodeRequest_Get_SalesOrgs().bind(request9);
(If i don't setLanguage to "")
I won't be able to bind context to model.
Hi Jackson,
As far as I know the initializationis not required as such. Why you are not able to bind the result to the context node is probably due to the BAPI definition. May be it is required that Language cannot be null, it should be initialized with some value.
Thats the only reason why you need to initialize this languiage parameter.
In general you directly execute the model and bind the context node with the result. And this works.
I hope this helps!
Regards,
Pravesh
Hi
This is not initialization but setting a field into model attributes..
Let I explain from one example
Suppose u have to create one student record with name ,class ,age ,DOB etc.For this one Standard Service is there (Model) say createStudent(String name,int age,String class ,Date dob).So All these filed are there in your UI ok ,and end user will provide all the input (name ,class,age,dob) ,now he/she is about to press SAVE button
Form here your coding role is started :
1. You will get all the record from user(UI input field)
like this
String name = wdContext.currentStudentNodeElement().getName();
String age = wdContext.currentStudentNodeElement().getAge();
String sutclass = wdContext.currentStudentNodeElement().getClass();
String dob = wdContext.currentStudentNodeElement().getDob();
2. You have to set these field age,name...... to the model attribute
modelData.setName(name);
modeData.setAge(age)
and so on.
3. Now u have to execute the model to make data in database.
Hope it will help you to understand.
Best Regards
Satish Kumar
Hi there,
Instead of doing this:
String name = wdContext.currentStudentNodeElement().getName();
String age = wdContext.currentStudentNodeElement().getAge();
String sutclass = wdContext.currentStudentNodeElement().getClass();
String dob = wdContext.currentStudentNodeElement().getDob();
Is it possible I SET a whole node, eg: nodeStudentNode (with all attributes inside) into the model before executing the model? (instead of setting each individual attributes seperately?)
Hi, Because I intended to do this:
// Copy from model node into model node
// WDCopyService.copyElements(wdContext.nodeHeader(), wdContext.nodeHeader3());
// Copy from model node into model node
// WDCopyService.copyElements(wdContext.nodeSa_Item(), wdContext.nodeSa_Item3());
(both are model node for source and target)
Then execute:
wdContext
.currentRequest_Sa_ChangeElement()
.modelObject()
.execute();
wdContext.nodeSa_Return2().invalidate();
CopyService and Execution was successful, however when I check the result, there was no result at all.. just blank.. any advice on this?
Hi Jackson,
You have invalidated the node after execution of the model. Executing the model has returned you the values. However just after that you have invalidated the node. This has resulted in the removal of all the records of this node. Invalidate function will bring the initial status of the node. Try and remove this line of code and then check.
wdContext.nodeSa_Return2().invalidate();
Thanks and Regards
Pravesh
Edited by: Pravesh Verma on Mar 13, 2009 2:53 AM
HI Jackson,
Have you tried this? Or is your issue resolved?
Regards,
Pravesh
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.