on 07-21-2009 1:35 PM
hi
i am creating a webdynpro which contains a table - i did it in the component controller
i want this table to be displayed only if its not initial
is it possible ?
thanks
Ami
Hi,
You can create a context attribute (type com.sap.tc.webdynpro.progmodel.api.WDVisibility) and bind it to the "visible" property of the table. Then you just have to set this variable to WDVisibility.NONE if the table is empty.
EDIT : sorry, didn't realize you use WD ABAP. Here's a tutorial for WD ABAP : http://wiki.sdn.sap.com/wiki/display/WDABAP/SimpleapplicationtochangepropertiesofUIElementsduringruntimeinWebDynpro+ABAP
Regards,
Pierre
Edited by: Pierre DOMINIQUE on Jul 21, 2009 3:00 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi..
Follow this step to display the table only if it has values....
1) You will have table context which will be binded to your table.. get the table vaules using....
get all declared attributes
lo_nd_table->get_static_attributes_table(
IMPORTING
table = lt_nd_table ).
2) Now create a attribute called table_visible and type is WDUI_VISIBILITY.
Bind that attribute with the table visible property.
Now check the condition.
if lt_nd_table is inital.
lo_el_nd_table-table_visible = if_wdl_core=>visibility_none.
else.
lo_el_nd_table-table_visible = if_wdl_core=>visibility_visible.
Bind the Table Values
lo_nd_table->bind_table( lt_nd_table ).
endif.
Hope this will help you.
Regards
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Under Context,create attribute VISIBILE of type wdui_visibility.
Bind the context attribute to the table visible property.
navigate from <CONTEXT> to <ND_nodename> via lead selection
lo_nd_nd_nodename = wd_context->get_child_node( name =
wd_this->wdctx_nd_nodename ).
get element via lead selection
lo_el_nd_nodename = lo_nd_nd_nodename->get_element( ).
get all declared attributes
lo_nd_nd_nodename->get_static_attributes_table(
IMPORTING
table = lt_nd_nodename ).
Now set the visibility as
if lt_nd_nodename is not initial.
set single attribute
lo_el_nd_<visibilitynode>->set_attribute(
EXPORTING
name = `VISIBLE`
value = '02' ). "visible
else.
set single attribute
lo_el_nd_<visibilitynode>->set_attribute(
EXPORTING
name = `VISIBLE`
value = '01' ). "Invisible
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have a context attribute DISPLAY_TABLE type WD_BOOLEAN and map this to the table property VISIBLE.
Now just change the context attribute DISPLAY_TABLE value to X or SPACE based on the number of records in the table. Sample code is below.
if table_data is not initial.
node_ref->set_attribute( name = 'DISPLAY_TABLE' value = 'X').
endif.
Regards,
Manne.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.