Closing currently opened window while change in another window in power builder - data-binding

I am currently using powerbuilder 6.5
In my application, i want to make a code where any change in one window should reflet another window.Two windows are using the same table. if we channge in one window it is not reflecting in another window if the other window is opened earlier. what cani do?

It might help to know a little more about what you are trying to accomplish. Are both windows open at the same time on a single user's screen? Or is one window available to one user and the second being viewed by a separate user waiting to see the updates?
By themselves, the datawindows won't retrieve automatically on updates to the underlying table. In fact, if you have configured the datawindows properly, the update rules should provide some concurrency protection and will not let the second dw update the same table after the first updates. DataWindow2 will sense there's been a change and will try to prevent clobbering the DataWindow1's changes. But again, this may not be an issue if in your context the second window is read-only.
You could have the first window finish its update then check for the existence of the second window and have it retrieve. Even better, use a non-visual business object as an intermediate handler (and also keep nasty cross-window communication code out of the GUI). When the first window's update is successful have it tell the business object it's done, and the object can then tell the second window to retrieve. But there would need to be more done if your second window is updateable.

Use the datawindow ShareData method to share the content of the two datawindows (you do mean datawindow when you say table, right?).
BTW, I feel for you, having to use that PB 6.5 dinosaur. OTOH, we've just migrated from PB 10 to shiny new PB 11.5, and it has the worst IDE I have ever used. As a programmer, I'm embarrassed to see such am awful software. Sybase should be ashamed of themselves, releasing such a lousy product.

# eran
No i meant table only.
Two windows are using different datawindow and for these datawindow it is using same table.
So if we change in one window it wont reflect that change in other window if it opened one.

Related

AX2012 and UIPath

I'm working with UIPath to automate some processes in Microsoft Dynamics AX 2012. When I use UIPath to indicate a button to press or a field to type into, UIPath gets a brainfreeze (stops working) and just chews on it for 3-6 minutes before it has completed. It works, but it take a ridicolous amount of time to make a process, as this is the case at every click. There is no problem when the process is running from orchestrator - it is only during development and only in AX. In all other programs it only takes a split second.
Does anyone know what causes AX to be this slow and how to fix it?
I have attached a video here, where you can see the issue: Link to video showing performance issues
Thank you in advance
This probably happens because the UiPath activity tries to load the whole table (including what is not directly visible) into memory. To workaround this, you might just filter your table in a way that you just have a few rows visible before you Indicate on screen the specific element.
Note that a similar behavior might occur during run time if there is a lot of data to capture.
UI Framework needed to be swithed. Pres F4 to go switch to AA before hovering over AX.

How do I load data from a record into multiple edittexts in android studio?

I'm currently working through my A Level computer science controlled assessment, and am making an application designed to help Scout Leaders manage their group. This is my first time working in Java, SQLite, Android Studio and XML so I've run into a few problems along the way. At this point in time, I'm in the process of creating a login system, part of which involves editing login details. I was wondering if there's a way of loading multiple values from one record into different EditTexts at once, so the user only needs to edit the already-existing username and password, rather than type it in again with a slight edit? Thanks in advance. I didn't think it necessary to include any code in this question, as I'm only looking for an example, however if it would help please don't hesitate to ask - I just couldn't find a guide on this anywhere else.
You retrieve the data into a Cursor via a query that selects the required columns.
You then move to the appropriate row (record) in the Cursor (probably the first and only row).
For each EditText you set the text, using the setText method with the data from the respective column using an appropriate get???? method passing the column offset to the method (e.g. your_cursor.getString(<the_column_offset>)).
Rather than calculating and hard coding an offset, it is more reliable and flexible to use the getColumnIndex(<the_column_name_as_string>) method.
After all have been set you then close the Cursor
Note and would be replaced with respective values specific to the App.

Using realm with infinite scrolling table view in swift

Im learning about using NSOperation, NSOperationQueue for my networking calls to deliver a more responsive UI in my apps' table view.
The result of the networking operation get stored into the realm and displayed in the table view.
This is an infinite scroll table view and as the user gets the end, more data is pulled into the app.
I am wondering what is the best design paradigm to use here, and where is the best spot to clear the realm. I don't want to inflate the app with useless data. I just want them to have data if they log back in with no network (airplane mode).
I also would like to know where the best spot to trigger these networking operations is? cellForRowAtIndexPath perhaps? I am not to sure since I usually just use Alamofire and trigger a network request in viewDidLoad. But these are not cancellable calls.
I've gone through the great tutorials on ray wenderlich but other then the playground examples, I am still not getting a real world application tutorial. If anyone knows of a good one on this subject let me know
thanks
This might be tricky to answer since it all depends on your app, the size/type of data it's displaying and how often you want to perform network fetches. In the end, it will be most likely be a compromise between what 'feels good' and how many system resources need to be consumed to make it happen.
In this particular scenario, Realm is being used as a caching mechanism and nothing more, so when to clear it should probably depend on how aggressively you wish to clear it.
If I was building a system like this, I would decide on a set number of the latest items I would always want to have available and save them in Realm. If the user then decided to start scrolling down beyond that limit, more data would be downloaded and appended to the Realm database as they went. Eventually the user will get tired and scroll back to the top (Or they might even just quit the app and restart from the top). At that point, it would be appropriate to trigger an operation to review the size of the Realm cache and remove as many items as necessary to bring it back to the desired size. If they start scrolling down again, then it's appropriate to just re-download that data.
Unlike SQLite, where items are copied into memory, Realm is very good at lazy-loading resources mapped from disk, so it's not necessary to worry about the number of Realm items in memory, more just the size of the Realm file on disk, which again depends on how big the data you're downloading is.
As for when to trigger another network operation to request more data, it's probably best to do it in tableView(_:willDisplay:forRowAt:). Depending on how large the data to download is (and the size of your table cells are), you should play with it until it feels natural when scrolling at a pretty normal speed. As a starting point, I'd recommend starting at maybe a whole screen-worth of table cells before hitting the bottom of the scroll view.
Good luck!

UITableViewCells and NSURLConnection

I have a custom UITableViewCell, and when the user clicks a button i make a request to a server and update the cell. I do this with a NSUrlConnection and it all works fine (this is all done inside the cell class) and once it returns it fires a delegate method and the tableivew controller handles this. However when i create the cell in the tableview, i use the dequeue method and reuse my cells. So if a cell has fired a asynchronous nsurlconnection, and the cell gets reused whilst this is still going on, will this in turn erase the current connection? I just want to make sure that if the cell is reused, the actual memory that was assigned to the cell is still there so the connection can fulfil its duty??
You can customize the behavior of a UITableViewCell by subclassing it and overriding the -perpareForReuse method. In this case, I would recommend destroying the connection when the cell is dequeued. If the connection should still keep going, you’ll need to remove the reference to it (set it to nil) and handle its delegate methods elsewhere.
It's never a good idea to keep a reference of a connection or any data that you want to display in a cell, no matter how much of effort you put into it afterward to work around to arising problems. Your approach will never work reliable.
In your case, if the user quickly scrolls the table view up and down, your app will start and possibly cancel dozens of connections and yet never finishes to load something. That will be an awful user experience, and may crash the app.
Better you design your app with MVC in mind: the cell is just a means to display your model data, nothing else. It's the View in this architectural design.
For that purpose the Table View Delegate needs to retrieve the Model's properties which shall to be displayed for a certain row and setup the cell. The model encapsulates the network connection. The Controller will take the role to manage and update change notification and process user inputs.
A couple of Apple samples provide much more details about this topic, and there is a nice introduction about MVC, please go figure! ;)
http://developer.apple.com/library/ios/#documentation/general/conceptual/devpedia-cocoacore/MVC.html
The "Your Second iOS App: Storyboards" also has a step by step explanation to create "Data Controller Classes". Quite useful!
Now, when using NSURLConnection which updates your model, it might become a bit more complex. You are dealing with "lazy initializing models". That is, they may provide some "placeholder" data when the controller accesses the property instead of the "real" data when is not yet available. The model however, starts a network request to load it. When it is eventually loaded, the model must somehow notify the Table View Controller. The tricky part here is to not mess with synchronization issues between model and table view. The model's properties must be updated on the main thread, and while this happens, it must be guaranteed that the table view will not access the model's properties. There are a few samples which demonstrate a few techniques to accomplish this.

I have multiple users, can i lock the web page so that only one user at a time can update a record?

Can anyone help or provide me with some suggestions for the below query.
I have a web form (Minutes of Meeting) and 8 users that need to access this web page and update their area. A user may have more than one area to update and essentially i would like to some how lock down the web page if possible when a user is using it so that no other user can update this web page till joe bloggs has finished with it.
I have a Active Directory security group set up to restrict the site to that group of users only, but i need to think of a solution to the above?
Is there a way i can do this via a web control or via SQL?
There must be better ways to do it. However, Is it possible for you to introduce a sql table column similar to "UpdateInProgress" (bit). Any update process sees that column, If 0 then It updates to 1 and after It saves the changes and updates back to 0 so that the form is available for other to update. If update process sees 1, It can't update the web form because update is in progress.
I also suggest to introduce another column named "UpdateInProgressBy" to check who has opened it for editing.
First of all we must note that there is a big time from the moment the user reads the data, get it in a page, change them and then try to write them back. So we are not talking for the lock command on SQL, nether any other lock that happens in milliseconds and help to synchronize threads, but here we must synchronize people and what they write.
There is also a problem if the user leave the page for any reason and this can make the data lock for ever.
This problem can solve with two approaches.
the easy one, when a user try to save data you must check if the same data have been change in the middle, and warn him, or show a merge dialog, or merge programmaticall, or something similar - I do not know what you won.
the difficult way is to constantly monitor the page that read and change the data, and keep this monitor results on a common table in the data base, and there if a user have been and stay on page, the rest users get a warning and read only data, until the user go.
This monitor must be made with javasript and must know even if a user abandon the page.
SET TRANSACTION ISOLATION LEVEL as SERIALIZABLE
for more information check this link:
http://msdn.microsoft.com/en-us/library/ms173763.aspx

Resources