Delete row button in alv grid in sap - grid

i am using function "REUSE_ALV_GRID_DISPLAY" in order to display a grid. My problem is that not all the buttons in alv toolbar are displayed. For example, i can not see the "delete row" button.
This is my call:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = fieldcatalog
TABLES
t_outtab = lt_files_records_final
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
Can you please help?

IF you need the full editor functionality (including cell editors), you will have to move away from the (obsolete and unsupported) function module to the class CL_GUI_ALV_GRID. See the documentation here.
If you only need a delete button, it might be easier to add a custom button. Check the program SALV_DEMO_TABLE_FUNCTIONS for an example (and start using the ALV OM instead of the old function modules - much easier to code with).

Related

mvcgrid.net unable to use toolbar

I'm working on a website with a feature that can sort users.
I'm using mvcgrid.net libs but I can't figure it out. the toolbar doesn't work.
I used most of the basic source codes from mvcgrid.net but when i press something in the search bar it doesn't work or the items per page selection.
If you have specific code to take a look at, please post. Otherwise, here are a few things you can check:
(1) Be sure you've applied the mvcgrid data attributes needed. For example, for a search field you might have these attributes:
<input
type="search"
data-mvcgrid-apply-additional="change"
data-mvcgrid-type="additionalQueryOption"
data-mvcgrid-option="search"
data-mvcgrid-name="ContactGrid">
(2) Be sure the value you chose for mvcgrid-option (in this example, "search") is then added when you configure the grid. For example:
MVCGridDefinitionTable.Add("ContactGrid", new MVCGridBuilder<ContactViewModel>(defaults)
.WithAdditionalQueryOptionNames("Search")
...
(3) You then need to read the attribute (again in the grid config) in your .WithRetrieveDataMethod()
string search = options.GetAdditionalQueryOptionString("search");
I've forgotten step 2 in the past -- that's generally what has tripped me up.

Retrieve different text from combo box in Qt Designer (pyqt)

this could sound strange and it is more a curiosity then a question.
I have a simple combobox with 2 elements in Qt Designer.
The 2 combobox elements are vertical and horizontal but for the script I'm writing I need to get only v or h.
Usually I easily do it with a loop like:
name = self.combbox.currentText()
if name == 'vertical':
name = 'v'
else:
name = 'h'
and that's ok.
I was just thinking if there is a way in Qt Designer to assign a kind of tag to the elements so the user sees the complete text but with the code it can be retrieved the tag.
Thanks to all
I don't believe you can do this with Qt Designer alone (see How can I add item data to QComboBox from Qt Designer/.ui file).
With some extra Python, though, you can add use setItemData() to add whatever extra data you want (How can I get the selected VALUE out of a QCombobox?) and retrieve it with itemData() and currentIndex().

Component will not delete

I'm doing a bit tidy of the Content Manager and have a component that won't delete (not the same as my other question).
When I try to delete the component in question I get the following error
(8004032D) This item is in use.
Unable to delete Component (tcm:4-65020).
UtilitiesBL.AssertItemCanBeDeleted
UtilitiesBL.AssertItemCanBeDeleted
ComponentBL.Delete
Component.Delete
Request.Delete
When I use the Where Used tool on the component I get no results in the "Used In" tab, one result in the "Uses" tab, the "Blueprint Hierachy" shows it is not localized in any of my three child publications and no results in the "Published To" tab.
I have had a look in the Content Manager database to see if I can spot what is going wrong but not really found anything.
Any ideas?
Thanks in advance.
It looks like the Where Used tool in R5.3 isn't working correctly. The component in question is used in 15000 other components. I found this by using the TOM API directly.
var componentID = "tcm:4-65020";
TDS.TDSE tdse = new TDS.TDSE();
var component = (TDS.Component)tdse.GetObject(componentID, TDSDefines.EnumOpenMode.OpenModeView);
var whereUsedString = component .Info.GetListUsingItems();
Now comes the task of deleting all these links...

How can you extend the default behavior of Tridion.Cme.Commands.Open.prototype._execute()?

I have written a GUI extension which adds an additional tab to many of the Item views in the SDL Tridion CME (e.g. Component, Page and Schema etc.). I have also written some JavaScript which loads that tab directly if when the view is loaded with a tab name is specified in the URL.
The result is that if a page is loaded with the tab name added as follows:
http://localhost/WebUI/item.aspx?tcm=64#id=tcm:1-48-64&tab=InfoTab
Rather than the default of
http://localhost/WebUI/item.aspx?tcm=64#id=tcm:1-48-64
The Info Tab will be loaded on top, instead of the General Tab. This is performed with the following code snippet and works very well:
$evt.addEventHandler($display, "start", onDisplayStarted);
// This callback is called when any view has finished loading
function onDisplayStarted() {
$evt.removeEventHandler($display, "start", onDisplayStarted);
var tabname = $url.getHashParam("tab");
if (tabname != '') {
var tabControl = $controls.getControl($("#MasterTabControl"), "Tridion.Controls.TabControl");
tabControl.selectItem(tabname);
}
}
Now I would like to make a context menu item to open items and link to the tabs using my new functionality. My first thought was to construct the Item URL myself and simply open a new window in my execute method. So I looked at the default functionality in the standard Open.prototype_execute() functionality of the GUI. This is stored in the navigation.js file of the CME, and is performed by the Tridion.Cme.Commands.Open.prototype._execute method. The code is a lot more complicated than I had anticipated as it deals with shared items, and permissions etc.
Rather than just copying all of this code to my own function, I was wondering if there is a way to elegantly extend the existing Open.prototype_execute() function and append my “&tab=MyTab” to the $cme.Popups.OPEN_ITEM_OPTIONS.URL constant for my own functions.
Any advice would be greatly appreciated.
At the end the Open command uses $config.getEditorUrl(item_type) to get the url for the item view (item_type - $const.ItemType.COMPONENT, etc). There are no extension points for this part of the functionality, but you could always try to overwrite it on your own risk.

How do I hide a CCK Nodereference input widget in #after_build?

I like simplifying the node form. One of my tricks in the past has been to conditionally hide CCK elements on new node creation when I want to enforce some kind of default. One of my favorite tricks is to whisk away things put in place by the Prepopulate module. Unfortunately for me, it's recent move to an #after_build-based mechanism seems to be creating all kinds of collisions in how I can manipulate the widget.
This is what I used to do in hook_form_alter():
$form['field_my_nodereference_field'][0]['#type'] = 'hidden';
$form['field_my_nodereference_field'][0]['#value'] = $form['field_my_nodereference_field'][0]['#default_value']['nid'];
$form['field_my_nodereference_field'][0]['#parents'] = array('field_my_nodereference_field', 0, 'nid');
But when I try to play this game in #after_build, I run into errors with the hidden type's validation, or the nodereference_autocomplete_validation. I have resorted to conditionally adding a CSS file. This makes me sad.
Hidden is not enough. Try this one:
$form['field_my_nodereference_field'][0]['#type'] = 'nodereference_hidden';
when the type is a CCK field you have to pass this format _hidden
for instance for a simple text field I used
$form['field_srt'][0]['#type'] = 'text_hidden';
or for a filefield field I used
$form['field_myfile'][0]['#type'] = 'filefield_hidden';

Resources