on 07-02-2012 11:49 AM
Hi,
My requirement while clicking the action button in 1st component then the tab should be invisible in 2nd component.
The tab view is in 2nd component.i mapped the visibility attribute to all the tab.But its not invisible while clicking the action
The disabled tab should be invisible but its not working in my condition.I am mapped both enabled and visibility node.But enabled concept is working but visibility is not working.........
Can any one give the solution in step by step........
Prabhu,
this can be achieved through external context mapping.
just simply follow the below steps.
component-2:
1. Create an Interface node - create an attribute for visibility
2. bind this visibility attribute to TAB visibility
component - 1:
1. Define component-2 in component usages
2. define the interface node of component-2
3. set the visibility value at your action.
This will automatically goes to component-2, and based on the value it acts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chengalarayulu,
I am write the code in the onaction button of first component but the tab is in visible condition only.
This is my code can u arrange the code according to ur logic,
if gs_getdetails-next1 = 'Design Form'.
DATA lo_nd_visibles TYPE REF TO if_wd_context_node.
DATA lo_el_visibles TYPE REF TO if_wd_context_element.
DATA ls_visibles TYPE wd_this->element_visibles.
DATA lv_request_v TYPE wd_this->element_visibles-request_v.
* navigate from <CONTEXT> to <VISIBLES> via lead selection
lo_nd_visibles = wd_context->get_child_node( name = wd_this->wdctx_visibles ).
* @TODO handle non existant child
* IF lo_nd_visibles IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_visibles = lo_nd_visibles->get_element( ).
* @TODO handle not set lead selection
IF lo_el_visibles IS INITIAL.
ENDIF.
* @TODO fill attribute
lv_request_v = 02.
* set single attribute
lo_el_visibles->set_attribute(
name = `REQUEST_V`
value = lv_request_v ).
DATA lv_design_v TYPE wd_this->element_visibles-design_v.
* @TODO fill attribute
lv_design_v = 01.
* set single attribute
lo_el_visibles->set_attribute(
name = `DESIGN_V`
value = lv_design_v ).
DATA lv_testscript_v TYPE wd_this->element_visibles-testscript_v.
* @TODO fill attribute
lv_testscript_v = 01.
* set single attribute
lo_el_visibles->set_attribute(
name = `TESTSCRIPT_V`
value = lv_testscript_v ).
DATA lv_acceptance_v TYPE wd_this->element_visibles-acceptance_v.
* @TODO fill attribute
lv_acceptance_v = 01.
* set single attribute
lo_el_visibles->set_attribute(
name = `ACCEPTANCE_V`
value = lv_acceptance_v ).
endif.
Hi Prabhu,
Not the type of attribute. There are four attributes by name REQUEST_V, DESIGN_V,TESTSCRIPT_V and ACCEPTANCE_V. among this attributes check which attributes are binded to visible property and which attributes are binded to enable propery.
1. Bind the Visible property of respective tabs to the attribute of type visible(better take type as WDY_BOOLEAN ).
2. Have a check now . It should work fine
3. If the enable works then visibility also works. take the type as WDY_BOOLEAN or reset the values instead of '01' assign '02' and check.
make sure your binding for VISIBILITY property of TAB -
1. if it is already bound and value is not set, then the tab will not display
2. if the binding is done, value is set, then check your IF condition where you are setting the visibility value - i think you bound this to REQUEST_V - check
3. Just for your reference, read the visibility attribute in popup view - WDDOINIT, and put break point, then you will confirm either the value is setting in component-1 or not.
Hi Chengalarayulu D,
I am read the visibility attribute in popup view - WDDOINIT the value is setting but its not invisible according to my condition.............
Hi Chengalarayulu D,
Can u send me any sample screen shot to invisible the tab on clicking the action button........
Hi Prabhu,
1. Create a Node in the component controller of component1 and define the node as interface
2. Create two different attributes one for enable and the other one for visible
3. Define external context mapping from component 1 to component 2-->component controller
4. Bind the attributes to the enable and visible properties of a Tabstrip
Note : Taking ex like initially i keeping the tabstrip invisible and on click the button i will make the tab strip visible
5. In the component 1--> WDDOINIT set the visible property Tab Strip as abap_false
6. in the component 2--> ONACTIONBUTTON set the property as abap_true.
Note: If you are working in a single session then Context mapping works fine else you need to pass the parameters through the URL. If it is the second case then reply, i will sent you the code
Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sankar,
The action button in 1st component.While clicking the action button it will open a popup of 2nd component.In the above image there is button call display related form it is the onaction button.
i am creating a interface method in 2nd component and call it in 1st component...In the method i am writing a code,
IF ls_requestform-next1 = 'Design Form'.
DATA lo_nd_visible TYPE REF TO if_wd_context_node.
DATA lo_el_visible TYPE REF TO if_wd_context_element.
DATA ls_visible TYPE wd_this->element_visible.
DATA lv_request_v TYPE wd_this->element_visible-request_v.
* navigate from <CONTEXT> to <VISIBLE> via lead selection
lo_nd_visible = wd_context->get_child_node( name = wd_this->wdctx_visible ).
* @TODO handle non existant child
* IF lo_nd_visible IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_visible = lo_nd_visible->get_element( ).
* @TODO handle not set lead selection
IF lo_el_visible IS INITIAL.
ENDIF.
* @TODO fill attribute
lv_request_v = 02.
* set single attribute
lo_el_visible->set_attribute(
name = `REQUEST_V`
value = lv_request_v ).
DATA lv_design_v TYPE wd_this->element_visible-design_v.
* @TODO fill attribute
lv_design_v = 01.
* set single attribute
lo_el_visible->set_attribute(
name = `DESIGN_V`
value = lv_design_v ).
DATA lv_testscript_v TYPE wd_this->element_visible-testscript_v.
* @TODO fill attribute
lv_testscript_v = 01.
* set single attribute
lo_el_visible->set_attribute(
name = `TESTSCRIPT_V`
value = lv_testscript_v ).
DATA lv_acceptance_v TYPE wd_this->element_visible-acceptance_v.
* @TODO fill attribute
lv_acceptance_v = 01.
* set single attribute
lo_el_visible->set_attribute(
name = `ACCEPTANCE_V`
value = lv_acceptance_v ).
ENDIF.
Hi Prabhu,
See the Screen Shot Below:
Context mapping should be defined only from Comp1 to Comp 2.
Logic is written in the WDDOINIT method of COMP 1
Logic in Button of Comp 2
Result
OutPut:
Prabhu instead of 01 and 02, use ABAP_TRUE and ABAP_FALSE.
Note: Context Mapping should be only from Component 1 to Component 2
If the screen shots are not clear reply me. still i will try explaing you clearly through the text
Regards,
Sankar Gelivi
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.