Can I set tab text color or icon to indicate validation errors on the page in Xamarin TabbedPage (iOS and Android)? - xamarin

I want users entering data across multiple tabs to be able to see at a glance whether and where they have validation errors / fields not populated. I can indicate errors for the selected form in the form body, but for unselected tabs I want to use red color and/or a red icon in the tab to indicate if it is failing validation.
I see various posts explaining how to use a custom renderer or effect to set tab text color for all tabs or selected/unselected tabs (e.g. here, here, here modifying the framework itself and here). However, the posts I've seen do not show a way to change the color of a SPECIFIC tab. In this case I want to either change the color or add/remove an error icon that would show beside the Title in the tab header based on the validation results for the page accessed via the tab. Is that possible?
Update:
I also found this - seemed more promising because it does seem to change tabs based on their positions or title rather than just on whether they were selected or not, but it seems to be dependent on using bottom tabs, which I'm not doing.
I also have found this, and element.Children[i] does get me the ContentPage from which I can determine what color I want the tab's test to be, and it's possible that the tab variable that's returned by activity.ActionBar.GetTabAt(i) somehow gives me access to update the tab's text color, but I'm not seeing any method or property that seems promising - basically I still don't see how to get access to the UITabBarItem so I can call SetTitleAndAttributes on it to set its text color. (Also, if I declare the tab variable by its type of Android.App.ActionBar.Tab instead of using var, I get a note saying that type has been deprecated. It seems upon investigation that the whole ActionBar class has been deprecated. But how can that be when it still exists as a property of Android.App.Activity, which is not deprecated?)
Many thanks for your assistance!

Related

showing warning in bottom panel in Guidewire

I am working on customization of Guidewire's ClaimCenter, and in certain situation I want to show warning in bottom panel which is usually displayed by common rejectField() method.
Can I somehow display this same panel without using rejectField() method ?
If not, may I somehow implement such method on Payment entity ?
(Keep in mind that I am working on customization, and I do not have access to most of Guidewire's source code.)
You will generally call rejectField on a validation rule. That will bring up a popup tab with a warning. You cannot get the same type of experience but you can bring in warnings on a yellow bar using the Alert Bar element on the pcf. You can put in conditions as needed for the alter bar to be displayed.

Removing/hiding the toolbar tracking separator

I'm working on adding support in my app for full-height sidebars, as introduced in macOS 11.
The trick is, when the window tab bar is visible, I want to turn the full-height sidebar off. The two don't mix well when the sidebar content is different in each window, as it is in my app. See Xcode for an example of what I want to do (View > Show Window Tab Bar). See Preview for an example of what I want to avoid (open two multi-page PDFs and put them in a single tabbed window).
What's working:
I observe the window's tabbedWindows property, and toggle the fullSizeContentView flag in its styleMask accordingly. Thus the window's style updates as needed when I hide and show the tab bar.
What's not working: I need to have a sidebarTrackingSeparator item in my toolbar in order to have some items above the sidebar. But when fullSizeContentView is off, that item appears as a plain separator. I don't want it to be visible at all in that state.
There isn't a straightforward way to hide a toolbar item, especially if it doesn't have a view, which it turns out this one doesn't.
I tried removing the separator item and re-adding it when the window state toggles, but that leads to Cocoa throwing exceptions, complaining that only one tracking item can be registered at a time. This would seem to be a bug, but Xcode manages it somehow.
So how can I properly toggle my window and toolbar state without having that visible separator?
It looks like I've solved the problem by saving the separator item when I see it in toolbarWillAddItem, and then returning it from toolbar(_:itemForItemIdentifier:willBeInsertedIntoToolbar:) to avoid having a new instance created. That way, removing and re-adding the item works without having exceptions thrown.
The last little snag was to not remove and re-add the separator blindly. The window state may have been preserved across app launches, so I needed to not make assumptions about how the window would initially appear.

clearing controls Visual basic Forms

I have a Picture boxes inside a parent label and I want to be able remove them all. I tried MyLbl.controls.clear() and that didn't do anything, I did not get an error, just nothing happened. I tried giving them tags and looping through all controls In the form looking for the tag but it never found them.
Is there a way to do this?
WinForms Label control does not allow adding child controls by default using designer, even if picture boxes appear above the label. Unless you explicitly said MyLbl.Controls.Add MyPicture1, the picture box is actually child of your Form or some other container.
You can check this by going to View > Other Windows > Document Outline in Visual Studio when a form designer is open.
In case picture box is child of a form, you'll have to remove related controls from form's Controls collection.
But to simplify this, you can just add a GroupBox or Panel to your Form, and place PictureBoxes there. Then, you can do MyGrpBox.Controls.Clear().

Getting the current value of a textbox in Access 2013 Custom Web App

in a List view I want a particular control (textbox) to have a red background color if it has a certain value. I have tried the following:
Click on the textbox then click the Data icon in the context sensitive controls that appear. I can then see that the name of the control is First_NameTextBox. I then click anywhere on the List view and click the Actions icon in the context controls that appear to the right of the view. I select "On Current". I then create two steps that should be executed whenever a new record is activated:
If [First_NameTextBox] = "somevalue" Then
SetProperty
Control Name [First_NameTextBox]
Property BackColor
Value #FF0000
End If
However, this turns the textbox red no matter what the value in First_NameTextBox is. How do I reference the CURRENT value of the textbox?
Conditional formatting based on a field value is not available for the List View in a Web App.
If you've built web pages (with or without a templating engine), the design limitations of Access can be frustrating.
Another kind of frustration comes from moving a form in Access from the native Access environment to a browser-based display.
I've felt the first kind of frustration, but so far I've avoided the second kind. I keep MS Access and HTML-rendered forms far away from each other.
Conditional Formatting in the List View of Access Web Apps is Available its just way harder than it should be.
Input "If Statement" under the "Current Macro" by clicking outside any text box or label then traveling to the top right of the view and you will see the Lightning bolt which allows two options, "On Load" and "On Current".
SELECT ON CURRENT
Don't forget You will need to set the control back to the original color by using the else. (also, for some reason I have to flip the Colors so where you would think red would go, Put White.
Example:
IF = "" True Then
White
Else
Red
END IF /DONT ASK ME WHY!
Summary: your Code is Sound, Just input it under the Views Current Macro Location
This is my first post, i spent DAYS looking for this information and found in the deep google somewhere so i hope this helps you.

How to Put image or image based text on Navigation tab (bar) in Oracle APEX 4?

Got this basic issue..
I have two tab navigation bar in Oracle APEX 4.0. The parent tab and the standard tab.
The standard tab which is below parent tab starting from left, I would like to put a text or image made of text on the right side which describes the overall application.
The Text or Image of made of text will be "BASIC PROGRAM" in a Green color with big font size.
Can anybody guide me how to proceed..
I was thinking using substitution strings such as #tab_cells# may work, but not sure where to put and how to do it?
appreciate your help..
Tabs are long due an overhaul, the customisation you can do on them is extremely limited. Short of completely overhauling your menu system, i'd alter this one tab through javascript/jquery.
Please take care with selectors for tabs. I have no idea which theme you are using, i did this for theme 21 with 2 level tabs, selecting a 2nd level tab. Inspect your HTML and adapt this to your requirement.
$("ul#tabs li").each(function(){
if($(this).text().indexOf('Maatregelen')!=-1){
$(this).children('a.tab_link').css(
{"background":'url()', "background-color":"green", "text-shadow":"none"}
);
};
});
I wouldn't change the template per se. There is not much you can do there to the tab generation, since you can not use plsql code. Rather, you could put the tab label in an attribute on a higher level than the a-tag, to have an easier jquery selector. Or you can put the javascript code in to run on-load. Or have a dynamic action on page zero to run on-load, and this will affect every tab in each page.

Resources