Unity Dropdown shows the first time around, duplicated text - unity3d

I am having this issue where I have a dropdown that should say finances, inventory, and stats. Which when you click on it will cause other panels of UI to appear. Now for some reason, the options it says it has is all Money:(which is the first item name of the first option). Why is that? I've attached images below that show what I mean.
Sorry about the links i dont have high enough rep yet
Duplicated Text of Money
Another instance of ^
My Tabs
Dropdown Setup

Let's take a closer look at your third and fourth pictures and compare them to the default Dropdown UI element.
So in your third image you show a similar tree but what happened to the Template GameObject? It appears you deleted this and replaced it with the Finances GameObject. This is your primary issue. You can't delete this Template GameObject portion of the Dropdown GameObject. The Template is utilized by the Dropdown code in order to further determine the style of the Dropdown you'll see while in game as well as provide you with a template to look at. I don't know all of the internals of how this works, but I know it for sure plays a roll in your issue.
I know this because now take a look at my Dropdown component. Look at the Template field in mine and compare it to yours. Your's is filled with Finances rather than Template, which is the reason that your Dropdown populates with fields from the Finances rather than the values you are trying to pass it.
Here is what I suggest you do. I'm assuming that the FinancesTab, InventoryTab and StatsTab are all UI elements you want to open upon clicking the respective Dropdown item. If that is the case:
Create a new Dropdown GameObject
Don't delete the Template GameObject within it and leave the Template field in the Dropdown GameObject as is
Add a script that utilizes the SetActive function for each UI element (place them in public fields) to the Dropdown GameObject
Set this code up so that when a certain item on the Dropdown is selected, it sets the desired UI Tab to SetActive(true);
Now reference the new script in the OnValueChanged(Int32) field and reference the correct Method from that script in the dropdown menu in the OnValueChanged(Int32) field.
I believe this should solve your problem and help you achieve what you want. Take a look at the Dropdown API and this Youtube tutorial on Dropdowns if my steps are confusing. You can definitely achieve what you want by following those two links (that's how I figured them out!).
Hope this helps!

Your caption is the gameobject 'Label' so its defaulting that in the dropdown because there are no sprites. I'm guessing Label has a text component that says 'Money'?

Related

How to make a GameObject that prompts user for text input in Unity

I'm new to Unity and I'm trying to create an object that upon being placed by the user will prompt the user for text input.
The GameObject is basically a text box. This is also meant for a mobile application.
Fortunately, the answer is very simple and doesn't even require writing code.
You can use the “InputField" UI component.
You can quickly create an InputField from the menu bar entry "GameObject> UI> InputField" or "GameObject> UI> Legacy> InputField>".
This way, if you didn't already have a canvas in the scene, it will be created, and an InputField will be inserted inside.
The parent gameObject manages the inputField, and in fact it is the only one with the component, while the child objects are to show the text, "placeholder" for the text before inserting some text, and "text" to show the text it will write the user.
if you think my answer helped you, you can mark it as accepted and vote positively. I would very much appreciate it :)

Creating a TinyMCE plugin: How to make element selectable and editable

I'm trying to author my very first plugin for tinymce. Now, how do I make an element selectable? With the official image-plugin for example the user can click on a already inserted image, it visually gets focused and the image-plugin-button gets focused as well - see gif. Let's say I want to write a plugin that inserts a „Bootstrap Card“ which basically is just a div element. How do I make an already inserted Card selectable plus of course editable once the users clicks my new plugin button? Bonus question: ;-) Any suggestion for a comprehensive tutorial on tinymce plugin authoring?
To answer the bonus question first, there is an article on the TinyMCE blog that walks through creating your own TinyMCE plugin, with the example being an HTML to Markdown transformation
In the article, under the "Add the plugin to the editor" heading, Shahed Nasser writes the steps for adding the custom plugin button to the toolbar. Check under that heading for more information on getting the custom toolbar icon up and running.
For the Bootstrap Card item question – so it sounds like when your users select the Card, you need the following:
Focus on the existing cards in the document
Enable the ability to edit, adjust, or modify the cards in to get what they want written or expressed in the card done.
The first step would be to identify the card items. The TinyMCE.html.DOMparser API has a method that will filter for a specific node within the editor, and allow you to run a function on any nodes that match the filter. You can find the API docs here - https://www.tiny.cloud/docs/tinymce/6/apis/tinymce.html.domparser/#addNodeFilter
That's reaching the limits of my knowledge of what to do, hopefully the docs and article help give you the first steps to get your custom plugin going.

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

show and hide tabs dynamically in touch ui -AEM

I have a requirement, where I need to show few tabs on selection of a value from a drop down.
I have done this in classic UI. But not sure how to proceed for Touch UI. I know that we can use JQuery, Can anyone let me know the approach I can use.
Its fairly simple, look at the OOTB List Component /libs/foundation/components/list. The selection dropdown is defined - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom, look at property class and cq-dialog-dropdown-showhide-target these are used to manage hide and show.
Now from here look at the dropdown values under - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom/items these values trigger the hide and show mapping to property showhidetargetvalue as in /libs/foundation/components/list/cq:dialog/content/items/column/items/setDescendants

Add/remove usercontrol in panorama item using MVVM - Windows Phone

I have a panorama app that has two panorama items so far, "recent" and "popular." These get populated with data using binding from a viewmodel. I would like to add a third ("search") panorama item that initially shows just a text box and a button.
When the user inputs text and clicks on the button, I want the text box and button to be replaced with the ListBox control that shows the search results.
I cannot find any examples on how to do this using the MVVM pattern. I am not using a MVVM framework and would like not to since I am just learning all this.
If you can explain or better, point me to examples that will allow me to do this, I would very much appreciate the help. If I left out any required info in my request, please let me know.
Sincerely,
Kamal
Typically for something like this you would have a property in your ViewModel that would tell the view what to show. You have lots of different options for how you could do this.
One option would be to have a Results property that your list box is bound to. Put the textbox and button in a Grid and bind the Visibility property of the grid to a property that is Visible is there are no results and not visible if there are.
Lots of different ways to do this.
Examples here and here.
You could probably bind a list of a custom class to the panorama ite .
The custom class contains a title and/or description and a page class.
You can maintain your views in your main viewmodel.
Another solution would be adding the items in xaml and using the same viewmodel for the whole panorama item control. With a property you can control the visibility of each item.
Like Bryant said: there are so many solutions. It depends on your application and requirements... :)