Show/Hide different fields Based on dropdown value in Magnolia content app? - content-management-system

I have created a content app in which I am able to show and hide different fields using radio buttons but how to Show/Hide different fields Based on the dropdown value in Magnolia content app?
For radio button and fields i used below class info.magnolia.ui.form.field.definition.SwitchableFieldDefinition
and for transformer class i used
info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
but now i want to use
info.magnolia.ui.form.field.definition.SelectFieldDefinition
instead of SwitchableFieldDefinitionbut I am unable to do so with any of the transformer class.
I also searched and found similar thread here but it has the incomplete answer!

According to https://documentation.magnolia-cms.com/display/DOCS/Switchable+field you can define a property named "selectionType" with the value "select".
I haven't tested that though.
If you have a look in SwitchableFieldDefinition, it looks promising though, because there's really a property with that name and it just defaults to "radio" but can be overwritten.

Related

Hi, If we want to show/hide both tabs and fields in AEM, based on the style selected for a component

Like for my one component there a two styles added , if style one is selected then I have to hide 1 field in cq:dialog and if style 2 is selected then I have to show that field
Is the style mentioned above, is a dropdown within same dialog? If yes, there are numerous examples explaining how to implement Show/Hide of dialog fields. Please check here, here, here, here.
Basically idea is on the dropdown field, add a class cq-dialog-dropdown-showhide and a property cq-dialog-dropdown-showhide-target with a value of class selector unique to component. Then by defining property showhidetargetvalue on the element, selecting the dropdown will show/hide respective properties.
If the style you mentioned is the style system applied using brush icon, it is not OOTB. You ll need to add an authoring clientlib and implement logic to hide specific dialog field based of style system applied.
IMO style system is presentational, only to apply skin to the component. It should not drive business logic of allowing dialog properties. As simplistic, maybe allow authors to enter all allowable fields at dialog and using JS, you may consume / not, the dialog properties.

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.

Material-ui List select multiple items

As shown in the documentation example you can implement a selectable List.
I was wondering how would one be able to make the list to support multiple selections.
The method that was used in the example is makeSelectable. There doesn't seem to be any documentation regarding that method and I wasn't able to find anything substantial in the issues of their git project.
Any help will be appreciated.
Create a state variable selectedItems to keep track of selected items of the list.
ListItem supports checkboxes, so you can create a checkbox for each ListItem, add an onCheck handler to it and pass to it a unique value to identify which checkbox is checked and based on that you can modify the state variable selectedItems.
Alternatively, you can use Menu in place of List as it has the property multiple. You can set it to true and that's it.

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... :)