Adding Tab dynamically - apache-flex

I have a tab and want another tab with click of button.
Another tab has VBox (Contains charts,grid etc).
It gives an error while adding code addChild(), removeChild() on button click.
The error is of null object reference.
Please suggest me.
Thanks

You're probably trying to access children of a tab that has not been initialized yet. The simplest solution is to change the creationPolicy property of your TabNavigator to "all".
You can see an explanation of creationPolicy in the Adobe documentation.
If this is not the solution, you're probably going to have to post more specific code.

Related

Xamarin Forms, Adding items dynamically inside CarouselView on the run, Strange Behaviour

I use the same DataTemplate to populate some of the views inside my CarouselView: a XAML file with a ContentView. I assign a custom class list to ItemsSource of the carouselview AND use bindings inside the template layout fields to fill them with the properties of my custom class. Everything is working fine. Here comes the wierd part: Let's say there's a button in the template and when you click it on the screen, a Label with "Well Done" text is added to the current Stacklayout of the shown carouselview. This is done by the codebehind of my template XAML. This is ok, too, but I expect this "Well Done" to disappear after I swipe back and forth enough. Because it's not part of the template. It does not disappear, instead I see it on other carousels once in every 4 swipes and it is replaced, I mean it appears on different carousels if I swipe back and forth. To make it disappear completely I have to swipe away from the views that share the same DataTemplate. I cannot understand the mechanics behind this behaviour. I can create another field inside the template to put the "Well Done" text there and show it when the time comes, I know. But I want to understand the mechanics. Thank you.
Asking the right question about a problem is the key to any solution..
After the realization that I've mentioned at the Update comment, I've searched for DataTemplate Caching and found this issue post on Xamarin.Forms Github: https://github.com/xamarin/Xamarin.Forms/issues/9200
There you can find an explanation to how CollectionView was designed and understand the mechanics behind the behaviour. No bug. It's by design.

How do you force Combobox dropdowns to stay open

How do you force Combobox dropdowns to stay open even when other Alert boxes appear. Looking at what to subclass from mx.Combobox, there doesn't seem to be much that i can do to short of implementing an entire combobox from scratch.Thx
For that you need to create a custom ComboBox which if created in following Link. and might be this link will going to be useful to you.
Please visit this LINK

Flex form inside Pop up window - Tab (order) between forms not working

when user clicks on Add button, then a pop up button will be opened with certain form elements (like textinput, date field, text area).. When i used 'TAB' inside this form,it is not working. I found in couple of Questions / forums that we need to create an instance of FocusManager and then bring/activate focus for the pop up. But still i didn't see the tab working inside the form. In order to tab order working inside a pop up, what steps we need to follow.
I tried using focusmanager and property like tabfocusenabled, tabenabled and also added taborder inside each form element. But no luck.
Iam using Flash Builder 4.5 and using spark components for development.
Is there any workaround for this problem?
Thanks in Advance,
Regards
Srinivasan
Thanks for all your responses.
Finally the issue has been solved by one of my colleague. Problem is , the form has been loaded inside Horizontal accordion (flexlib HACCORDION). So inorder to draw focus inside the accordion to child elements, we need to add 'hasFocusableChildren="true"' for the HAccordion (horizontal accordion component). Adding this property solves the tab order problem.
I have also pasted the code below:

Flex 3 TileList selected item strange behaviour

I have a Flex TileList with an itemRenderer made by me.
The list loads the content perfectly and renders it.
Renderer is a simple canvas element with a checkbox and another canvas with some labels with data.
I implemented a method that, on TileList itemClick="clickedItemHandler(event)", changes the state of the checkbox (if checked -> uncheck, and vice versa).
Problem is: the method works if i click on any place of the item, EXCEPT the checkbox. When i click the checkbox, it doesn't change state.
My thoughts: maybe i was changing the state of the checkbox, and the event changing it back, but i debugged it and it doesn't look like so..
The solution is actually quite simple. Perhaps the best way to make this work is making sure the CheckBox ignores mouse clicks, and this can be done by setting the "mouseEnabled" attribute to false.
Cheers
I think you're probably correct. The checkbox toggles when you click it and then you toggle it back when the event gets to the TileList. You may not see this when debugging depending on how you are confirming... you may be able to fix this by confirming that the target of the event is not a CheckBox.

OS like behavior when edditing a Tree item!

I have a Tree Control inside my Flex Application which I want to edit on a doubleclick on a tree item. I found the properties doubleClickEnabled="true", doubleClick="startEditMode()", and editable="true". With these functions I can detect a double click and I can change the editable property to true based on a double click.
The problem is that after I double clicked on a Item i have to click once more to really enter the edit mode. That doesn't seem to be intuitive at all...
Somebody came up with the solution to make a additional click programaticaly:
clickedItemRenderer.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
The problem I have is to get the clickedItemRenderer out of the doubleclick event (MouseEvent). How can I do that? Is there a other solution tho simply enter the edit mode by double click on the tree object?
Thanks for any hints!
Markus

Resources