MOSS 2007 EditModelPanel - sharepoint-2007

I am writing a web control where I'm overriding the CreateChildControls method. In this method I create an EditModelPanel, add a button to it and then add the EditModePanel to my web control's Controls collection (this.Controls.Add(xxx)). The problem is that the button shows up in both Display mode and Edit mode. I've tried setting EditModelPanel's PageDisplayMode property and SuppressTag property and nothing works.
Why does the EditModePanel fail when adding it programatically?
I've googled this issue and someone else had the exact same problem but he got no response.

Firstly, You can detect from within your control if you are in edit mode and not create the child controls. This way you will not need the editmodepanel.
I have refactored the editmodepanel class, and it does things a bit differently. It implements IParserAccessor and the logic is in AddParsedSubObject() method of the interface. I think by manually adding the controls, you are bypassing the IParserAccessor. Hope this helps.

Related

How to call Method of one UI from Another UI without initializing and without making method static. - Vaadin 14

How can we call FirstUI.Java method from SecondUI.java without initializing the FirstUI.java class and without making FirstUI's method static?
FirstUI.Java has multiple tabs buttons that need to hide and show depending on what method (defined in FirstUI.java) SecondUI.java.
SecondUI.java gets loads in the VerticalLayout present in FirstUI.Java. And is added to the Vertical layout by calling the constructor of the SecondUI.java.
If I make FirstUI.Java's method static which making buttons of tabs enable/disable we have to make the tab also static (This is what happening in my case). And the whole application starts to create an issue.
Any Solution?
My code can be accessed from here, all the static methods in this classes needed to be accessed by other classes
Any Idea of how these methods can be called from different UI without making them static?
what your app needs is an event bus mechanism for between UI communication. You're trying to implement things the wrong way with Vaadin. Your original question is just a side effect of the wrong implementation.
Replied to you over email with additional info to resolve the current issues in your app.
-A

setting view.accessibilityElements with embedded view controllers

I am trying to add iOS accessibility support/Voice Over to my app. My main screen has three main controls, but the third control is hosted within an embedded view controller.
I am setting accessibility elements in prepareForSegue and have confirmed that the embedded view controller controls are all loaded. Problem is I can still only select the first two controls which are in the enclosing view controller.
self.view.accessibilityElements =
#[
self.cmdMenu, // works
self.collectionView, // works
self.childViewController.peerMenu // doesn't work
];
All three views have isAccessibilityElement = YES.
Am I missing something? I can't imagine that there is a restriction on the accessibility elements being in the same view controller.
I found my bug and now have Voice Over working. In the process I figured out a number of things that I would like to share.
To my original question, you can reference controls in your child view controllers from your main view controller. You can add the controls directly (as I did in my question) or you can add all accessibility elements in the child view controller using self.view.accessibilityElements = #[ _control1, childViewController.view, childViewController2.view].
If you add all of the controls in your child view controller as in (1.) then ensure that childViewController.view.isAccessibilityElement = NO.
You can add any kind of object to accessibilityElements, even elements that have no accessibility information. The API will not assert or warn you. This ended up being my bug.
If your UI changes and you need to change the number or order of items in your accessibilityElements array tell UIKit about it using UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self). The notification argument (where I'm sending self) tells Voice Over where it should position its cursor when the notification completes.
If you want to read aloud some text for a transient notification (imagine when Clash Of Clans tells you how many Gems you found in that Tree Stump) call UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, messageText). One caveat, this won't read aloud the messageText unless there is no other Voice Over in progress. You need to manage the timing yourself. Submitted a bug on this. Apple could make this a lot better.
If you are using UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, messageText) you can listen for UIAccessibilityAnnouncementDidFinishNotification, but unfortunately this notification has almost no value. You only will get notified if your messageText was fully spoken. It doesn't tell you that it was spoken, but interrupted, and it will also not get triggered for any text spoken through the UIKit framework.
The Accessibility Inspector in the iOS Simulator kind of sucks. If your accessibility settings are correct, it can tell you what is there. If you have a problem the Inspector does not provide you any information about what is wrong. This is true of the entire UIAccessibility API. It is so easy to use that it almost always works. But when it doesn't work you need to resort to hunt and peck to figure it out. The API needs some assertions or console messages similar to how Apple handles Constraint warnings. Spoiler alert: the Accessibility Inspector in Xcode 8 is wayyyyy better, but still would not have helped with my issue.
There is a ton of good information in the UIAccessibility.h header. If you are embarking on UIAccessibility support, it is a good read.

DirectX10/ShapDX Custom control

I am trying to create custom control with directx10/direct2D output (panel, not a form). I do all rendering in the overriding OnPaint method, however I have read somewhere that it is wrong and RenderLoop should be used instead. But where should I insert RenderLoop.Run if I can write code only inside of the control? Thank you.
You would create a thread, and have RenderLoop.Run inside the thread. When you do this you have to make sure that events sent back and forth between the components are invoked in a safe manner.

iOS Interface Builder: How to make templates

I've recently started developing an iOS app, which I've never done before, so it's been going a bit slow, but I'm learning, so that's understandable.
I want to make a custom interface, so I've been making subclasses of the default view classes (like UIButton) so that I can define custom drawing. I've been told this is the best way to define custom interface elements that can be reusable. It definitely seems to be working that way. However, I haven't been able to make elements completely reusable by just using a subclass.
For example, in order to prevent a button's text from changing color when it is clicked, I have to manually go into the interface builder and set the button type to "Custom." After that, code that I enter into the subclass's constructor to change attributes seems to work. But I have to do this for every button I add, and in code the "buttonType" attribute is read only. Is there a way for me to define (just once) certain attributes for every instance of my button subclass that I add to the interface?
My goal is to be able to have a button subclass or template that defines all attribute values that I want my buttons to have, and every instance that I add automatically reflects those properties without me having to change anything. More so, I want to be able to modify that subclass/template and have those changes reflected in every existing instance. I have to imagine that this is possible in iOS. There is simply no way to build sophisticated interfaces without this capability.
Define a custom Button class (inherited from UIButton) in your project and in the init set the properties which you wanted to be set across.
In the interface builder go to the the class inspector and enter the button to be of the previously declared button.
buttonType needs to be set for all the button as this is defined at initialization time and exposed as read only property. If you want absolute reusability for your case, create a view, with an embedded button in code. when you create a button, create using the static method buttonWithType.
Wherever you need, drag and drop a UIView and set the view type to be the custom view.

Custom TControl doesn't paint at design time until cut and pasted

I have an odd issue with TChromeTabs. I know it must be something simple, but I can't figure out what needs to be done to fix it.
When I initially drop the TChromeTabs control on a form it is completely transparent. If I cut the control then paste it back to the form the contents are displayed correctly. The contents also appear if I close, then re-open the form.
As I have no idea why this is happening I can't really give you any code samples. However, you can download the source code here: http://code.google.com/p/delphi-chrome-tabs/downloads/list.
Your control doesn't paint itself because you disable painting. You call BeginUpdate in the constructor, and you don't call EndUpdate until the Loaded method is called. But Loaded is only called when loading a control from a persisted state. Usually, we think of that as being when the control is loaded from a DFM file, but the IDE uses the same technique to allow putting controls on the clipboard.
You haven't noticed this before because, apparently, you only test your control by opening a pre-made demo project. The demo project has a control in its DFM file, so the only code path you exercise is the DFM case. You don't exercise the path where the constructor is called directly — when the control is first dropped on a form, or when the control is created "dynamically" in code.
To fix this, begin by getting rid of the BeginUpdate call in your constructor. Instead, to check whether your control is still in the process of being constructed, check csCreating in ControlState.
You can also get rid of your stsLoading state. Delphi already gives you that with the csLoading bit of ComponentState. Besides, your use of stsLoading is wrong since you set it in the constructor, just like you do with BeginUpdate.
Instead of relying on Loaded being called, you might wish to move certain code into the AfterConstruction method. Put code there that needs to run after your component is created but that has nothing to do with loading properties from a DFM (or other persistence source). I'm not sure I see anything in your Loaded method that really belongs there. Nearly all of it should be able to occur in the constructor.
You should also be aware of the CreateWnd method. It's called when your control's window handle gets allocated. That's where you should start allowing paint operations to occur. When you don't have a window handle, you have nothing to paint to.

Resources