Trouble with navigating between tabsheets in code - delphi-7

I am having a problem with navigating between tab sheets in code.
I have a button that will be clicked
In the OnClick event the next tabsheet should become the active tabsheet
I am looking for the code to put in the button that will make the active tabsheet move from the current tabsheet to the next tabsheet. I am using a page control with two pages.

TPageControl has a SelectNextPage() method for this very purpose, eg:
PageControl1.SelectNextPage(True);

Related

Is it possible to hide the ContextualBalloon without removing the view from the DOM?

I have a situation where a toolbar item in CKEditor5 opens a ContextualBalloon which contains an iframe.
In my current understanding, the only way to hide the balloon is to remove the iframe view i.e.
this.balloon.remove(this.colorPickerIframeView)
However this removes the iframe view from the DOM, meaning that the next time I open the balloon view the iframe is reloaded.
I'd rather not have to reload the iframe every time, is there any way around that?
If you want to only hide the ContextualBalloon's view you can try to use this.balloon.view.hide()

Angular Material md-select load options in async way

I need to load select's options asynchronously (
through a service), using the Angular Material md-select component.
Actually, I use a click event to load data. It works but I need to click the select twice to show the options. That it's a problem.
The expected behavior is shown at this link (AngularJs Material)
The actual behavior is shown at this link.
Is Async options' loading supported by md-select?
The reason you need to click twice is because when you first click, there are no options in the select control and so it doesn't try and open the panel. Then your async method loads the options into the DOM and on the next click it will open.
In order to deal with this, you must always include at least one <mat-option> in your <mat-select>. You can add a disabled <mat-option> with a <mat-spinner> showing that the data is loading for example.
Here the most simple example of that. This is not the best approach... see below.
However, this still uses the click event which isn't the best approach. If you put the click event on the <mat-select> there are spots where you can click on the control but your click event wont trigger even though the dropdown panel still opens (places like the floating label area). You could put the click event on the <mat-form-field> but then there will be places where you can click and trigger the click event but the dropdown panel wont open (places like the hint/error text area). In both cases you lose keyboard support.
I would suggest using the <mat-select> openChanged event instead of a click event. This has its own quirks too but they are manageable.
Here is an example using the openChanged event. I also made the component more robust overall.
I also made a version that uses the placeholder element to show the spinner instead of using a disabled mat-option. This required View Encapsulation to be turned off.
Note: In my example, the service can return different data depending on the circumstances. To simulate this my fake service keeps track of how many requests you send it and changes the options returned accordingly. So I have to set the option list back to empty and clear the formControl's value every time the list is opened. I save the selected value before clearing the formControl so that if the service returns a list with the same item I can automatically reselect the value. If you only need to load the options once, then you would want to modify the code a bit to only load the options the first time the user opens the select.

How to force the back button to show on title bar?

Here's the scenario:
I'm working with Xamarin forms and using FreshMVVM.
My main screen is a FreshTabbedFONavigationContainer, one of the tabs navigate deeper into other pages while the others don't. If I'm in one of those deeper pages and do:
CoreMethods.PushNewNavigationServiceModal(...)
the next navigation page is added to the stack and the back button appears and works fine.
But if I call the same method from a root page in my main tabs page, the back button doesn't appear. I'm calling the same method, the same way, with the same argument types. I've even tried the same arguments.
Why would it work from a deeper FreshBasePageModel and not from the first FreshBasePageModel in a FreshTabbedFONavigationContainer? I've tried FreshTabbedNavigationContainer too and it made no difference.
Also, is there a way to force the back button to show and manage its behavior?

UPDATE (Event) PROBLEM WITH AJAX ACCORDION CONTROL

I Have three records which I want to display in three Accordion Panes
which (every pane) will have a Header and a content ( Two label controls, 1 text box and 1 checkbox and 1 link button)
I am able to display data on the accrodion from database but when I am trying to Update the text in textbox by clicking link button the LINKBUTTON doesnot fire and unabel to make the update. How can we create Update event working ??
I am creating the Accordion Panes and Content controls statically and directly assigning the values to the controls from Code behind in Page Load.
I was able to do it using the "ItemCommand" event of the Accordion Panel by using the Command Name property of a Link Button which will update the Text Boxes.
It works for me now but I felt JQUERY will be a better option which has no postback, css issues..

SL3 dataform validation indicators don't show in tab pages

I have a Prism/SL3 application with a tab control and each page of the tab control is a "Region" that has its own view and viewModel. when I want to validate the main page, I call dataForm.ValidateItem(), then I go to all the child views and do the same. the problem is, only the pages which user has clicked on them (on the tab page), get instantiated and the pages that are never shown, don't have their view instantiated, thus I can't validate them.
any help?
I created a psuedo work around for this. It's very hacky, but it does work. My example involved walking the visual tree (up and down) to find respective controls that are invalid and then "expanding" the selected item. I have used an accordian in my example, but have also tested this with tab:
http://thoughtjelly.wordpress.com/2009/09/24/walking-the-xaml-visualtree-to-find-a-parent-of-type-t/
HTH,
Mark
EDIT: Link updated.

Resources