on 2011 Dec 14 4:30 PM
Hi,
I'm trying to display a button only if the fields are not in display only mode. Currently I have the following code:
<chtmlb:config displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ). %>"
mode = "RUNTIME" />
<%@extension name="/QAS/V6BPL_BSP_EXT" prefix="QAS" %>
<%
if displayMode = 'INITIAL'.
%>
<QAS:button_thtmlb applicationName = "<%= controller->application_name %>"
applicationNamespace = "<%= controller->application_namespace %>"
componentId = "<%= controller->component_id %>"
controllerName = "<%= controller->controller_name %>"
text = 'Search B2B' />
<%
endif.
%>
I am getting the error DisplayMode is not known.
Appreciate your help.
Hi Jamie,
displayMode is an attribute of BSP extension chtmlb and hence can't be outside the chtmlb tag.
Try this code:
<%
data: lv_displaymode type abap_bool.
lv_displaymode = controller->view_group_context->is_view_in_display_mode( controller ).
%>
Now you can use value in variable lv_displaymode to achieve your requirement.
Thanks
Vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is what I have. I just want to be able to check if the fields are in display only mode or not. Thanks for your help!
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="xhtmlb" prefix="xhtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<thtmlb:tray id = "de"
indent = "FALSE"
design = "PLAIN" >
<thtmlb:trayHeader>
<thtmlb:textView id = "TrayTitle"
text = "Adresse Principale" />
</thtmlb:trayHeader>
<thtmlb:trayBody>
<thtmlb:grid cellSpacing = "1"
columnSize = "1"
rowSize = "2"
width = "100%" >
<thtmlb:gridCell rowIndex = "1"
columnIndex = "1"
width = "100%"
horizontalAlignment = "LEFT" >
<thtmlb:gridCell rowIndex = "2"
columnIndex = "1"
width = "100%">
<chtmlb:config displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ). %>"
mode = "RUNTIME" />
</thtmlb:gridCell>
<%
data: lv_displayMode type abap_bool.
lv_displayMode = controller->view_group_context->is_view_in_display_mode( controller ).
if lv_displayMode IS BOUND.
%>
<%@extension name="/QAS/V6BPL_BSP_EXT" prefix="QAS" %>
<QAS:button_thtmlb applicationName = "<%= controller->application_name %>"
applicationNamespace = "<%= controller->application_namespace %>"
componentId = "<%= controller->component_id %>"
controllerName = "<%= controller->controller_name %>"
text = "<%= otr(Z3CSD01/Z3CSD01_BOUTON_SEARCHQAS)%>" />
</thtmlb:gridCell>
<%
endif.
%>
</thtmlb:grid>
</thtmlb:trayBody>
</thtmlb:tray>
I'm not sure about this piece of code:
<%@extension name="/QAS/V6BPL_BSP_EXT" prefix="QAS" %>
<QAS:button_thtmlb applicationName = "<%= controller->application_name %>"
applicationNamespace = "<%= controller->application_namespace %>"
componentId = "<%= controller->component_id %>"
controllerName = "<%= controller->controller_name %>"
text = "<%= otr(Z3CSD01/Z3CSD01_BOUTON_SEARCHQAS)%>" />
However, you can always use the standard button code:
<%
if lv_displayMode = abap_true.
<thtmlb:areaFrameSetter toolbarButtons = "<%= controller->gt_button %>"
maxButtonNumber = "2" />
endif.
%>
In order to fill gt_button, you can redefine DO_PREPARE_OUTPUT method and fill gt_button there.
Hope this helps.
Thanks
Vishal
I hope you are using the below statements in sequence.
<%
data: lv_displaymode type abap_bool.
lv_displaymode = controller->view_group_context->is_view_in_display_mode( controller ).
if lv_displayMode = abap_true.
<thtmlb:areaFrameSetter toolbarButtons = "<%= controller->gt_button %>"
maxButtonNumber = "2" />
endif.
%>
User | Count |
---|---|
30 | |
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.