I am trying to create a tab based touch-ui dialog AEM (AEM-6.2) But I am facing issues to hide the tabs.
I have 3 tabs in a dialog box.
general (Always enabled)
sports (Enable only when the selection is sports)
movies (Enable only when the selection is movies)
Before configuration, 'sports' and 'movies' tabs are hidden. In the 'general' tab I have a select box with options 'choose sports' and 'choose movies'. On selection corresponding tab should display. I tried using the steps provided in the below given path, but it fails to hide the tabs.
Path : /libs/cq/gui/components/authoring/dialog/dropdownshowhide/clientlibs/dropdownshowhide/js/dropdownshowhide.js
Other reference we tried : https://github.com/aman02deep/aem-6.2/blob/master/tabshideshow.js
Content.xml file:
</items>
</selection>
</items>
</columns>
</items>
</generalPanel>
<sports
jcr:primaryType="nt:unstructured"
jcr:title="Sports"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
margin="{Boolean}false"/>
<items jcr:primaryType="nt:unstructured">
<columns
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<sptext jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textarea"
fieldLabel="enter the text :"
name="./sp_text"
required="false"/>
</items>
</columns>
</items>
</sports>
<movies
jcr:primaryType="nt:unstructured"
jcr:title="Movies"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
margin="{Boolean}false"/>
<items jcr:primaryType="nt:unstructured">
<columns
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<mvtext jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textarea"
fieldLabel="enter the text :"
name="./mv_text"
required="false"/>
</items>
</columns>
</items>
</movies>
</items>
</content>
You can use granite:data to create a data-attribute which you can hide and show at you convinicence using jquery.
Add Listener to change of your radio button
Add granite:data to both tabs
On listener being called, Hide and show, based on your selection and jquery.
Ref: https://docs.adobe.com/docs/en/aem/6-1/ref/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/commonattrs.html
Related
MAUI, VS17.4 pr1, Windows.
I Set CollectionView Span value to 3, So if I have only 1 or 2 objects, the CollectionView will display nothing.
I attached a runable project on my Synology.
BugProject
BTW, ScrollBar doesn't show in the View.
Whole XAML Page:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiApp1.VerticalListDynamicSizeItemsPage"
Title="Vertical list (dynamic item sizing)">
<StackLayout>
<Button TextColor="Wheat"
Text="Add New "
Command="{Binding AddCommand}" />
<Button TextColor="Wheat"
Text="Delete New "
Command="{Binding DeleteCommand}" />
<CollectionView HorizontalOptions="Start"
HorizontalScrollBarVisibility="Always"
ItemsLayout="VerticalGrid, 3"
ItemsSource="{Binding Monkeys}"
VerticalScrollBarVisibility="Always">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="10">
<BoxView WidthRequest="100"
HeightRequest="100"
Color="Red" />
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</StackLayout>
It's a bug, I'll create a github issue.
I have looked everywhere to change the textView shape AND color and the only solution I can find is to make a drawable resource file. Which I did:
rounded_blue.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00BCD4" />
<stroke
android:width="3dp"
android:color="#ffffff" />
<corners android:radius="30dp" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
</shape>
But when I apply it to my textView I get the shape but not the color. The color goes to default.
<Button
android:id="#+id/loginButton"
android:layout_width="249dp"
android:layout_height="45dp"
android:text="Login"
android:background="#drawable/rounded_blue"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/button_standard"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="#+id/button_standard"
app:layout_constraintTop_toBottomOf="#+id/edittext_password"
app:layout_constraintVertical_bias="0.086" />```
[This is what I get ][1]
[1]: https://i.stack.imgur.com/f5P8Y.png
The edges are rounded as I wanted, but I want to change the button color. Why won't the color translate over as well?T
Below is my dialog.xml file
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
title="CQ Dialog"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Tab 1">
<items jcr:primaryType="cq:WidgetCollection">
<addcolumn
jcr:primaryType="cq:Widget"
fieldDescription="Click + to add column"
fieldLabel="Add column"
name="./addcolumn"
xtype="multicompositefield">
<fieldConfigs jcr:primaryType="cq:WidgetCollection">
<countrydetails
jcr:primaryType="cq:Widget"
fieldDescription="Click + to add country details"
fieldLabel="Add country details"
name="./countrydetails"
xtype="multifield">
<fieldConfig
jcr:primaryType="cq:Widget"
hideLabel="false"
xtype="multifieldpanel">
<items jcr:primaryType="cq:WidgetCollection">
<countryname
jcr:primaryType="cq:Widget"
fieldLabel="Country name"
name="./countryname"
width="200"
xtype="textfield"/>
<countryicon
jcr:primaryType="cq:Widget"
fieldLabel="Country icon"
name="./countryicon"
width="200"
xtype="pathfield"/>
<linkurl
jcr:primaryType="cq:Widget"
fieldLabel="Link url"
name="./linkurl"
width="200"
xtype="pathfield"/>
</items>
</fieldConfig>
</countrydetails>
</fieldConfigs>
</addcolumn>
</items>
</tab1>
</items>
</items>
</jcr:root>
I was just trying to create multifield inside another multifield.
Issue I am facing is, once I filled the dialog field with values and when I reopen the dialog, all fields and filled data is cleared and dialog is empty.
Any suggestions what went wrong in my dialog
Thanks
This is possible but not just with the dialog structure you posted. You have to take care of field value serialisation for nested components.
Your values are blanking out because the value map handling of widgets is not compatible with nested values. A good read is at:
https://helpx.adobe.com/experience-manager/using/nested_multifield.html
From my understanding, <groupExpression> tag will be the one that decides whether a new group will be created or not, if there's a change to the element inside <groupExpression>, a new group will be created.
I want my report to look similar to my Excel data source (refer below) hence I want to group the ID and Name in the Excel file. In my jasperReport.jrxml (refer below), my <groupExpression> for Group1 is the ID column of my Excel File. But when I preview the report (refer below), the ID and Name column is not grouped, instead, there's a null string.
How to properly group them and eliminate the null string?
Excel datasource:
jasperReport.jrxml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
<!-- 2016-01-26T15:33:41 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="FirstJasperReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8b8832df-588e-4202-826e-a6b3efcbd22b">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="ExcelDataBase"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="ID" class="java.lang.Integer"/>
<field name="Name" class="java.lang.String"/>
<field name="Title" class="java.lang.String"/>
<field name="Balance" class="java.lang.Integer"/>
<variable name="Balance1" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="Count">
<variableExpression><![CDATA[$F{Balance}]]></variableExpression>
</variable>
<variable name="Balance2" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="Sum">
<variableExpression><![CDATA[$F{Balance}]]></variableExpression>
</variable>
<group name="Group1">
<groupExpression><![CDATA[$F{ID}]]></groupExpression>
<groupHeader>
<band height="30">
<rectangle>
<reportElement x="0" y="0" width="400" height="30" backcolor="#DEFCF2" uuid="de6c2f8d-afa6-45b4-b40e-574f2e07057e"/>
</rectangle>
<textField>
<reportElement x="0" y="0" width="100" height="30" uuid="c028645d-9b29-42d3-b91e-d47f15a5b44a"/>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="100" height="30" uuid="85d2844f-ef91-47a1-9223-c6943a25fe4d"/>
<textFieldExpression><![CDATA[$F{Name}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
......
Preview result:
How to make title1 and title2 appear under the group test1, without the null string (similar to the Excel source file)?
The problem is that the excel datasource is passing $F{ID}==null for second record. This generates the null group (as you can see also the name is null).
The easiest way to fix it is to not use rowspan in excel (include all data in the excel sheet).
If this is not possible you need to save the first $F{ID} value and return this if $F{ID}==null
Example
<variable name="First_ID" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="First">
<variableExpression><![CDATA[$F{ID}]]></variableExpression>
</variable>
In group return variable $V{First_ID} if $F{ID}==null
<group name="Group1">
<groupExpression><![CDATA[$F{ID}==null?$V{First_ID}:$F{ID}]]></groupExpression>
... your groupHeader ....
</group>
I'm customizing a TFS Work Item Type, adding a 'Business Description' HTML Field, but I cannot get the Layout right:
<Tab Label="Details">
<Group>
<Column PercentWidth="60">
<Control FieldName="Customer.BusinessDescription" Type="HtmlFieldControl" Label="Business Description:" LabelPosition="Top" Dock="Fill" />
</Column>
<Column PercentWidth="40">
<Control FieldName="Microsoft.VSTS.CMMI.Symptom" Type="HtmlFieldControl" Label="Symptom:" LabelPosition="Top" />
<Control FieldName="System.History" Type="WorkItemLogControl" Label="&History:" LabelPosition="Top" />
</Column>
</Group>
</Tab>
This turns out like this:
While I really want this ('Photoshopped' with MSPaint):
I have played around with the Fill properties on all three fields, have already set the MinimumSize property on the BusinessDescription field, added a group inside the left column, but I do not seem to find a solution for this.
Is this at all possible?
You'll want to create a group inside both the left and right columns:
<Tab Label="Details">
<Group>
<Column PercentWidth="60">
<Group>
<Column PercentWidth="100">
<Control FieldName="Customer.BusinessDescription" Type="HtmlFieldControl" Label="Business Description:" LabelPosition="Top" Dock="Fill" />
</Column>
</Group>
</Column>
<Column PercentWidth="40">
<Group>
<Column PercentWidth="100">
<Control FieldName="Microsoft.VSTS.CMMI.Symptom" Type="HtmlFieldControl" Label="Symptom:" LabelPosition="Top" />
<Control FieldName="System.History" Type="WorkItemLogControl" Label="&History:" LabelPosition="Top" />
</Column>
</Group>
</Column>
</Group>
</Tab>
You may also want to check out the Process Editor Power Tool - this provides a GUI interface to editing work item types.