cancel
Showing results for 
Search instead for 
Did you mean: 

Value and Model node

Former Member
0 Kudos

Hi All,

Could anybody give me details about value node and model node like what is the diff, how to create, how to access/set values to attributes of model and value nodes. If provided with an example will be more helpfu

Suitable answers will be rewarded with points!

Thanks in advance,

chandan

l

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chandan,

Model nodes are used when we have the BOL object. One exmple would be if we want to show a business partner details on UI, then we will create a mode node for BuilHeader object. BuilHeader object is available in BP BOL component.

In case, we do not have BOL in place and we want to call apis directly and maintain data, then we go for Value node, where we need to write our own logic for handling data.

To know whether a context node is Model node or not, please check the attribute BASE_ENTITY_NAME of that context node class. For mode node, it would have the BOL object name as value and for Value node, it would be empty.

To access/set data for attributes under a context node, use the getter and setter methods. i.e. get_<attribute_name> and set_<attribute_name>

Regards,

Manas.

Edited by: Manas Sahoo on Mar 16, 2008 12:32 AM

Former Member
0 Kudos

Hi,

Thanks for your reply.

I have few doubts.

How can i create a Value node? Correct me if im wrong,

If i right click on a context node of any view and proceed with wizard creating a new context node, it ll ask for BOL entity, without entering which i cannot proceed creating a value node.

Consider if we have to add few attributes to a view, which are not available in any of BOL entities, how can we achieve this plz explain.

Regards,

chandan

Former Member
0 Kudos

Hi Chandan,

I am sorry for late reply. I was not watching this thread. Now I have put this thread in watch mode, so my next reply will be fast.

Regarding your 1st question, how to create a vlue node. When you create a node using wizard, you will get the option to choose value node. Please choose the radio button for value node. By default model node is selected, so it asks for bol entity.

Regarding 2nd question, from wizard we can add only model attrributes to a model node. But if you are creating new context node, then in the wizard you may select required value attributes. But once the context node is created, then you can not add value attribute.

As per my knowledge , there is one work around possible to do so . Try to add attrribute to an existing context node . The wizard will have 2 steps "Selection of Attribute Type" , "Attribute Definition" .

In step "Selection of Attribute Type" choose add model attribute.

In step "Attribute Definition" use required attribute name and choose a bol attribute which has same ddic (e.g. if value attribute is a date field, then choose a bol attribute which is of date type).

It will create new atttribute under the context node. Now moddify the getter and setter method and put logic as per your requirement.

Regards,

Manas.

Former Member
0 Kudos

Thanks for your reply.

When creating a context node is it mandatory to give a custom controller name and corrosponding context node in Cusotom controller and also the parent node , relation with parent node and also the option of "always create instance".

I tried by not giving any inputs for above fields and the result was input field of that context node was disabled.

Regards,

chandan

Former Member
0 Kudos

No it is not mandatory to create a custom controller or provide it details in the wizard. To pass data between different views, we bind context nodes to custom controller. Custom controller data is available to all views under a component.

Parent node is used only if you are creating a context node for a child object . Eg. If you go to account details view, they show the detail of account and its address. Address is child object. So while creating you must specify the relationship with account.

Regarding "always create instance" , if the page is an editable page, then you must set it to true for all child objects.

In your case, if it is not a child object, then plz make sure that the entity is locked and check the get_i method of that attribute. Get_i method determines whetehr the field will be editable or not.

Regards,

Manas.

Former Member
0 Kudos

Hi,

Thank you so much for you reply.

Wanted to know if its not a child object where shud i put code for lock.

Also is it possible to have popups in webclient 5.2, if yes plz let me know in detail how to achieve . i have some idea using about popups in javascript, but i guess it dosent allow to have much customization for example if i have to display a dynamic message which is stored in abap variable.

Regards,

chandan

Edited by: chandan rajgopal on Apr 11, 2008 1:10 PM

Answers (0)