on 09-09-2011 7:08 AM
Hello,
Under the component ICCMP_BT_INR, I have called a custom Component ZIBCOMP,which has functional location details.
My custow view under the custom component ZIBCOMP has 3 fields and all of then are greyed out.
For ex:
In usual UI screens we have
Field Label : _______________ (Place holder for entering the value)
In my view the place holder after field label is not visible:
Field Label : NOT VISIBLE (Place holder for entering the value)
Please suggest,if am missing anything in designing the view.
One more thing is my custom component is integrated into the Custom View set in the standard Component.Is something wrong
with the Viewset design?
Regards,
Najm
Hi,
I think the basic problem is with the context node entity which you are using to display the 3 fields,
The basic rule is that if your entity is properly created in the create context node methods, then
the field would be editable.(created and in edit mode)
lets assume that you are displaying the 3 fields from XXX context node in the view and XXX context node
has a standard base_entity and it is related to some other standard root entity with the relation which u see in the
bol_model_browser. So in the create_xxx method, after the standard code creates the model and assigns it
to you context node, you should call another method like on_new_focus(check any standard code to see the method definition).
this method resides in the xxx context class and call the method like xxx->on_new_focus( lcl_entity ) from the create_xxx method.
the lcl_entity should be the parent of that xxx entity. inside the on_new_focus add the code to create a related entity
of the parent if there is no entity created. (see the bol_model_browser to check the relation between ur xxx and parent node.)
let me know it worked or not..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Asen,
Its quiet confusing for me .Let me provide me the details:
Stanadard Component : SRQM_INCIDENT_H
Custom Component created : ZICCMP_IBCOMP ,View : ZIbase
Context Node: BTREFOBJ
The view in the custom component has the fields Ibase,Component and Prodcut ID.These fields values will be entered by the user (should be in input mode,they are not as of know). One question here..do ihave to use a Model node or Value node here?
Code under CREATE_BTREFOBJ:
DATA lr_entity TYPE REF TO cl_crm_bol_entity.
* in case that the focus_bo (predecessor) exists and is changeable,
* then create a collection for the data of the view. otherwise remove
* the collection which leads to read-only fields.
IF focus_bo IS BOUND.
lr_entity ?= focus_bo.
IF lr_entity->is_changeable( ) EQ abap_true.
me->clear_collection( ).
ELSE.
* Allow user to create follow-up even the service ticket is set to complete
* me->collection_wrapper->clear_collection( ).
me->clear_collection( ).
ENDIF.
ELSE.
me->collection_wrapper->clear_collection( ).
ENDIF.
Please suggest the necessary modifications.
Regards
Najm
the code inside CREATE_BTREFOBJ should be like this..
assumption: this context node is a model node. whether it is value node/model node, it depends on the fields u will use. if all the fields which you want to display is available in the standard entity which has a relation with the header entity then use model node. other wise use value node,, but then you have to code to save the data.
DATA:
model TYPE REF TO if_bsp_model,
coll_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,
entity TYPE REF TO cl_crm_bol_entity, "#EC *
entity_col TYPE REF TO if_bol_entity_col. "#EC *
model = owner->create_model(
class_name = 'CL_SRQM_H_BTREFOBJ_CN' " replace with the class it has already created
model_id = 'BTREFOBJ' ). "Check the case
CLEAR model.
initial setting for depandant model node
coll_wrapper = btadminh->get_collection_wrapper( ). " if parent is other than btadminh, use that here instead of btadminh
TRY.
entity ?= coll_wrapper->get_current( ).
CATCH cx_sy_move_cast_error.
ENDTRY.
IF entity IS BOUND.
BTREFOBJ->on_new_focus( focus_bo = entity ).
ENDIF.
the on_new_focus method should have code like this. Please see any on_new_focus method, so that u create it correctly. It is not a normal method, it is event handler method. click the button beside the documentation button to set the properties for event handling.
DATA: lv_collection TYPE REF TO if_bol_bo_col,
entity TYPE REF TO cl_crm_bol_entity.
get collection of dependent nodes
entity ?= focus_bo.
TRY.
lv_collection = entity->get_related_entities(
iv_relation_name = 'BTREFOBJ_rel' )." add the correct relation
IF lv_collection IS NOT BOUND or lv_collection->size( ) = 0.
IF entity->is_changeable( ) = ABAP_TRUE.
TRY.
entity = entity->create_related_entity(
iv_relation_name = 'BTREFOBJ_rel' ). " add the correct relation
CATCH cx_crm_genil_model_error cx_crm_genil_duplicate_rel.
should never happen
ENDTRY.
IF entity IS BOUND.
CREATE OBJECT lv_collection TYPE cl_crm_bol_bo_col.
lv_collection->add( entity ).
ENDIF.
ENDIF.
ENDIF.
CATCH cx_crm_genil_model_error.
should never happen
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
me->set_collection( lv_collection ).
Hello Guys,
Any input for me on my issue?
Regards
Najm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Khaya.
I'd think there's something wrong with your view configuration. Could you share your layout page html code?
If it looks like this:
<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<chtmlb:config mode = "RUNTIME"
xml = "<%= controller->configuration_descr->get_config_data( ) %>" />
then check your view config from the UI config tool. Try deleting the config, and re-creating it.
Hope it helps.
FSA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sebastine,
I replaced the following code by the code provided by you:
<chtmlb:overviewFormConfig/>
<chtmlb:config mode = "RUNTIME"
xml = "<%= controller->configuration_descr->get_config_data( ) %>" />
Then i deleted the configuration and created a new one.After creation of new config am getting the following error:
Cannot display view ZICCMP_IBCOMP/ZIbase of UI Component ZICCMP_IBCOMP
An exception has occurred Exception Class CX_BSP_ELEMENT_EXCEPTION - : No valid source context supplied Method: CL_BSP_ELEMENT=>IF_BSP_ELEMENT~RAISE_ERROR
Source Text Row: 3
The contect node is already available.
Please suggest.
Regards
Najm
Hello,
I deleted the configuration tab and created it again.Now i can see the reuqired fields in the component,with there place holder
But,the ppalce holders are greyed out i.e the fields ar not input enabled.Though the field's properties in configuration tab say the
field type as INPUT FIELD.
Further anything need to be done at layout code.
Regards
Najm
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.