Checkbox in List View ABAP - checkbox

I want to do a simple thing but I don't have any idea. I made a button in GUI status it has a functon key and it works. Now the real thing. I want that for every checkbox I mark, when I press the button to call a new screen to show me only the entries that were checked.
The checkbox is added in the itable, but I think it doesn't matter that much. How can I tell the button which checkboxes on screen where checked?

The answer is pretty much what Bernard said, though it is lacking some detail.
You will need to know how many lines you wrote, this is stored in SY-LINNO, note that you need to also take into account how many pages you outputted which is stored in SY-PAGNO and how many lines are on a page which is stored in SY-LINCT.
You could get that info, which is probably a better approach, with 'DESCRIBE LIST'.
Then for each line with the command 'READ LINE' you can find the value of the checkbox.
READ LINE line OF PAGE page [result].
From there things should be a piece of cake.

For the checked records the checkbox field is 'X', while for the unchecked records the checkbox field is space (' '). So you need to loop over the records on the screen, then only display the ones where the checkbox is equal 'X'.

Besides all the answers you already got, you don't want to dig into interactive list programming any deeper (unless you have to do this for a programming exercise). Take a look at the ALV Object Model Documentation and the SALV_DEMO_* example programs.

Related

Best method in pyqt for assigning text to a variable according to whether or not the text box has been edited

I'm currently in the process of coding a GUI for one of the scientific instruments in my research lab. I have mild python experience, however pyqt is entirely new to me. I'm currently working on slots and signals for much of the interface and my current problem is one aspect of text edit.
You can see in the attached photo that I have placeholder text set in the text box for 'Path'. Normally this will never change, but I need it to have the capability to accept input if the user decides to change it. I need to assign this, whether it be the placeholder text or the user input, to a variable titled 'filePath'. What is my best method to accomplish this?
I was considering using an if statement that determines whether or not the text input has changed, but I cannot find the command on any website by which to do this. If there's a better method, I am open to that as well. Thanks for any help!

Problems with page layout in Oracle Apex

I'm trying to solve a formatting issue I'm having with Oracle Apex. Overall, this is a fantastic tool for whipping up proof-of-concept type applications, but whenever it comes to "prettying up" a page, it seems to be very difficult to work around.
I have a simple form-based page based on a table. However, I'd like to do a few simple things like group certain fields together on the form (phone info), perhaps throw an image in etc. I can't see any way to do either of these things inside a form. For example, here is an example page
and here are the small changes I want to make (photoshopped):
What the heck am I missing here? I can't seem to add anything except database fields inside the form to visually change things.
Any help appreciated.
It can be done - see this demo (I took the liberty of copying your icon, hope you don't mind). It looks like this:
How it was done
1) I uploaded the image into Apex. (Alternatively it can be hosted elsewhere).
2) I created a page item of type "Display Image" with attributes as follows:
Note the use of rowspan=3 in two places (circled in yellow), to make the picture and its (blank) label occupy 3 rows of the HTML table Apex uses for layout.
3) I created a page item of type "Stop and start table" and put it after the Mailing Address item. This prevents the phone icon taking up the same horizontal space as the name and mailing address, resulting in phone items being pushed too far to the right.
4) I set the "Begin on new line" property of the first phone item to "No" so that it appears to the right of the icon. The remaining phone items have "Yes" so that they appear below the first.

WPF: Getting a list box to stay put

I have this situation where I have a ListBox which is being populated from a background thread (it's an address book and the data is coming from AD).
The problem is that since the list is sorted (using CollectionViewSource) and also available to the user while more data is being retrieved, it's bouncing all over the place as new items are being inserted at various places in the list. So it's available to the user, but mostly unusable since the user's selections keep going out of view.
Is there a way to keep Focus to the item selected, and preserve the selection, even if items are being inserted above and below the selection from the background thread? I would prefer not to sort on the server, which I understand can be a bad thing when it comes to AD.
I'm going to respond to this from a UI design perspective rather then a technical code perspective. (I'm sure someone else will have a way to have the list box keep the selected item in view)
I would argue that the use of a list box while large ammounts of data is being added to it is fairly impossible to do nicely. Lets just say you do get it to keep the selection in view, what about while the user is still searching for their required item, you wouldn't be able to keep it still then.
Firstly if the expected total load time is under 10 seconds you could just disable the list box until loading is finished. (Obviously grey it out with a spinning animation or something so the user can see it's doing something.) I'm assuming you have already dismissed this option otherwise you probably wouldn't be asking here. But I do think this is worth considering. If the load time is farily small consider if your users will really gain anything by being able to browse the list while it is still being loaded.
Secondly, I would propose that you find a way to restrict the contents of the list box so that only small quantities are every displayed at one time. You could do this by only displaying names starting with a single letter of the alphabet (along with a letter selection control). Or you could provide a filter entry text box at the top where the user could type the first few letters and the list box would only display the names starting with those letters. This would allow the user to type say "sa" and the list box would display "sam", "samantha", "sacha", etc. Now you only have a small number of items in the list so you don't have to worry about it jumping around. If the number of items in the list grows too large (because of the loading on the background thread) and the list goes beyond the height of the box the user can simply type an extra letter to futher filter the list.
Sorry if this isn't really what you wanted, but I thought it would be worth bringing alternative design up incase you'd overlooked it.

Access 2007, Textbox search box like the Facebook name search box on the top right

so basically I have an AddCompany Form, where theres a textbox [CompanyName], i want to type a new company name in there, but meanwhile check if theres an already existing one.
So for example,say i want to type Microsoft, when i type M, the textbox shows whole bunch of other names with M, and then keeps going until I type finish typing microsoft. Basically jsut how the facebook search box works.
How do i implement this on Microsoft Access 2007?? could it be in the on dirty event/on change/On key down event???
please enlighten me!!
Thank you very much!!!
A much simpler version of the same thing can be done with the Access wizards. If you turn on the form wizards in form design and click the Combo Box button and point to a location in the header of your form, you'll automatically get a choice to create a combo box that will look up a record that matches something listed in the dropdown list.
However, keep these things in mind:
it works only when you've bound your form to an entire table (which is not recommended for large recordsets)
the code it creates is horrendously BAD.
There are a number of ways to solve this problem. If you're happy binding your form to the entire table, bookmark navigation (as with the code created by the wizard) will be fine. However, I recommend you use this code instead of the wizard code (assumes the combo box has a bound column with the PK ID of the record you're trying to find):
Private Sub MyComboBox_AfterUpdate()
If IsNull(Me!MyComboBox) Then Exit Sub
With Me.RecordsetClone
.FindFirst "[MyID]=" & Me!MyCombBox
If Not .NoMatch Then
If Me.Dirty Then Me.Dirty = False
Me.Bookmark = .Bookmark
End If
End With
End Sub
The combo box would need to use a SQL rowsource, and it would be something like:
SELECT CompanyID, CompanyName FROM Company ORDER BY CompanyName
And you'd define the combo box to have 2 columns, the first one the bound column, and you'd set the width for the first column to 0. The wizard walk you through doing this and set it up for you. The only thing it does wrong is write really bad code to do so.
Now, if you're not searching for a unique value, it gets more complicated, and you might want to use a different approach. Suppose you have a form that displays people and you want to see the ones for a particular company. In that case, you might want to filter by CompanyName. In that case, instead of doing a Find operation as outlined above, you might want to apply a filter. In that case the AfterUpdate event of your combo box would be something like this:
Private Sub MyComboBox_AfterUpdate()
If IsNull(Me!MyComboBox) Then Exit Sub
Me.Filter = "[CompanyName]=" & Chr(34) & Me!MyComboBox & Chr(34)
Me.FilterOn = True
End Sub
Now, in that case, your combo box would have but one column, with the company name and no hidden ID field, so it's somewhat different.
I don't like programming this kind of filtering as it's provided by the Access UI (you can right click on the CompanyName field and in the shortcut menu that pops up, type in the company name you want to filter for, including wildcards, ? and *). Also, it can get confusing when you try to filter when there's already a filter in place. If you're viewing just CitiCorp and then you filter by JP Morgan Chase, you won't get anything.
Instead, I'll tend to change the Recordsource of the form instead of applying a filter. This means each search will give you a new resultset and is the most efficient approach. It does make things a little bit more complicated in terms of returning to your original starting point, but in a properly-designed app, you should probably be presenting only subsets of data to the users in the first place, so the problem this approach "causes" is one that you'd need to resolve to build a proper and efficient user interface that retrieves only the data that the user really needs.
In general, this feature is called auto-completion (I've also heard find-as-you-type). There is an article giving an example of how to do this in Access on this page.
The forms in Access have event handler functions. So couldn't you use autocompletion code added to these functions for this functionality? I found a book on Google Books which discusses this.
I can think of the following code which would need to be added to the event handler function:
1. SQL to find existing potential matches
2. Code generated drop-down box to display potential matches

WPF: Listbox, centering selected item

Is it possible to always keep selected item in the middle of a listbox? If the user selects an item, I want to scroll so that the newly selected item is in the middle.
I guess it want be possible for the 'edge cases' (the first and last few items), but that's ok.
David Anson posted some articles on his blog that might help you here: Part 1 and Part 2. He gives an extension method that centers an item in an List Box. You might be able to build on that.
It is possible with couple of lines of custom code. Here's a discussion of a sample implementation. You might need to tweak it a bit to account for even number of items, insted of only odd number, but the general idea is the same.

Resources