How to setup multifields at the same level with each of them being nested multifields in AEM (Adobe Experience Manager) - content-management-system

I am trying to create two multifields at the same level but both of those multifields should have nested multifields.
I am able to create two multifields at the same level with the following content file but the second one breaks out of the container and it's positions is misplaced on the CQ dialog UI.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
jcr:title="Demo"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<tabs
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/tabs"
maximized="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<continentsTab
jcr:primaryType="nt:unstructured"
jcr:title="Continents"
sling:resourceType="granite/ui/components/coral/foundation/container"
margin="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<continents
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Continents">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./continents">
<items jcr:primaryType="nt:unstructured">
<name
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Name"
name="./name"/>
<countries
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Countries">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./countries">
<items jcr:primaryType="nt:unstructured">
<name
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Name"
name="./name"/>
<code
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Code"
name="./code"/>
</items>
</field>
</countries>
</items>
</field>
</continents>
</items>
</continentsTab>
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<tabs
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/tabs"
maximized="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<continentsTab
jcr:primaryType="nt:unstructured"
jcr:title="Continents"
sling:resourceType="granite/ui/components/coral/foundation/container"
margin="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<continents
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Continents">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./continents">
<items jcr:primaryType="nt:unstructured">
<name
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Name"
name="./name"/>
<countries
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Countries">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./countries">
<items jcr:primaryType="nt:unstructured">
<name
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Name"
name="./name"/>
<code
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Code"
name="./code"/>
</items>
</field>
</countries>
</items>
</field>
</continents>
</items>
</continentsTab>
<continentsTab2
jcr:primaryType="nt:unstructured"
jcr:title="Continents"
sling:resourceType="granite/ui/components/coral/foundation/container"
margin="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<continents
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Continents">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./continents">
<items jcr:primaryType="nt:unstructured">
<name
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Name"
name="./name"/>
<countries
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Countries">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./countries">
<items jcr:primaryType="nt:unstructured">
<name
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Name"
name="./name"/>
<code
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Code"
name="./code"/>
</items>
</field>
</countries>
</items>
</field>
</continents>
</items>
</continentsTab2>
</items>
</tabs>
</items>
</content>
</jcr:root>
Reference: https://levelup.gitconnected.com/aem-how-to-use-nested-multifields-in-your-components-using-a-sling-model-vs-pure-htl-92ff8d036ba1

Related

sap.f.SemanticPage: adding more than 1 content control fails

I am trying to get three panels to show on my object page but for some reason it shows only the last panel like it is shown on the screenshot:
The Object.view.xml looks like the following:
<mvc:View controllerName="ns.mngportfolios.controller.Object" xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:semantic="sap.f.semantic" xmlns:form="sap.ui.layout.form">
<semantic:SemanticPage id="page" headerPinnable="false" toggleHeaderOnTitleClick="false" busy="{objectView>/busy}" busyIndicatorDelay="{objectView>/delay}">
<semantic:titleHeading>
<Title text="{PORTFOLIO_NUMBER}" level="H2" responsive="true" />
</semantic:titleHeading>
<semantic:headerContent>
<ObjectNumber number="{
path: 'EBITDA',
formatter: '.formatter.numberUnit'
}" />
<ObjectAttribute text="{COMPANY_NAME}" />
</semantic:headerContent>
<Panel class="sapUiResponsiveMargin" width="auto" headerText="{i18n>portfolioTitle}" expandable="{device>/system/phone}" expanded="true">
<content>
<form:SimpleForm id="objectForm">
<form:content>
<Label text="{i18n>portfolioSharesLabel}" />
<Text text="{PORTFOLIO_SHARES}" />
<Label text="{i18n>portfolioNameLabel}" />
<Text text="{PORTFOLIO_NAME}" />
<Label text="{i18n>portfolioDepreciationLabel}" />
<Text text="{= ${DEPRECIATION} + ' ' + 'EUR'}" />
</form:content>
</form:SimpleForm>
</content>
</Panel>
<Panel class="sapUiResponsiveMargin" width="auto" headerText="{i18n>yearTitle}" expandable="{device>/system/phone}" expanded="false">
<content>
<List id="companyList">
<items>
<StandardListItem icon="sap-icon://building" title="Building1" />
<StandardListItem icon="sap-icon://email" title="abcd#mail.com" />
<StandardListItem icon="sap-icon://world" title="google.com" />
<StandardListItem icon="sap-icon://phone" title="+00123456789" />
<StandardListItem icon="sap-icon://map" title="23 Wall st, 10005 NY" />
</items>
</List>
</content>
</Panel>
<Panel class="sapUiResponsiveMargin" width="auto" headerText="{i18n>mapTitle}">
<Image src="{
parts: [
'23 Wall St',
'10005',
'New York',
'United States'
],
formatter: '.formatter.formatMapUrl'
}" />
</Panel>
<semantic:sendEmailAction>
<semantic:SendEmailAction id="shareEmail" press=".onShareEmailPress" />
</semantic:sendEmailAction>
</semantic:SemanticPage>
</mvc:View>
Can someone help me to identify the missing piece here?
"content" aggregation of sap.f.semantic.SemanticPage has a Cardinality of 0..1. This means we can add a maximum of one child control. To accomplish the task of displaying 3 panels, try embedding all three panels inside a container. A few examples of containers which could be used can be found in samples page under the category containers and layouts.
To provide an example :-
<mvc:View controllerName="ns.mngportfolios.controller.Object" xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" xmlns:semantic="sap.f.semantic" xmlns:form="sap.ui.layout.form">
<semantic:SemanticPage id="page" headerPinnable="false" toggleHeaderOnTitleClick="false" busy="{objectView>/busy}" busyIndicatorDelay="{objectView>/delay}">
<semantic:titleHeading>
<Title text="{PORTFOLIO_NUMBER}" level="H2" responsive="true" />
</semantic:titleHeading>
<semantic:headerContent>
<ObjectNumber number="{
path: 'EBITDA',
formatter: '.formatter.numberUnit'
}" />
<ObjectAttribute text="{COMPANY_NAME}" />
</semantic:headerContent>
<VBox>
<items>
<Panel class="sapUiResponsiveMargin" width="auto" headerText="{i18n>portfolioTitle}" expandable="{device>/system/phone}" expanded="true">
<content>
<form:SimpleForm id="objectForm">
<form:content>
<Label text="{i18n>portfolioSharesLabel}" />
<Text text="{PORTFOLIO_SHARES}" />
<Label text="{i18n>portfolioNameLabel}" />
<Text text="{PORTFOLIO_NAME}" />
<Label text="{i18n>portfolioDepreciationLabel}" />
<Text text="{= ${DEPRECIATION} + ' ' + 'EUR'}" />
</form:content>
</form:SimpleForm>
</content>
</Panel>
<Panel class="sapUiResponsiveMargin" width="auto" headerText="{i18n>yearTitle}" expandable="{device>/system/phone}" expanded="false">
<content>
<List id="companyList">
<items>
<StandardListItem icon="sap-icon://building" title="Building1" />
<StandardListItem icon="sap-icon://email" title="abcd#mail.com" />
<StandardListItem icon="sap-icon://world" title="google.com" />
<StandardListItem icon="sap-icon://phone" title="+00123456789" />
<StandardListItem icon="sap-icon://map" title="23 Wall st, 10005 NY" />
</items>
</List>
</content>
</Panel>
<Panel class="sapUiResponsiveMargin" width="auto" headerText="{i18n>mapTitle}">
<Image src="{
parts: [
'23 Wall St',
'10005',
'New York',
'United States'
],
formatter: '.formatter.formatMapUrl'
}" />
</Panel>
</items>
</VBox>
<semantic:sendEmailAction>
<semantic:SendEmailAction id="shareEmail" press=".onShareEmailPress" />
</semantic:sendEmailAction>
</semantic:SemanticPage>
</mvc:View>
Please choose the container control that best suits your layout demands.This is just an example.

What sapui5 controls to use to build the following interface?

I got a requirement to build a table that should look like
Desired Interface
Where start time and End time will have TimePicker input fields. Can someone please suggest how to achieve this interface( what controls to use or maybe an example in jsfiddle would be highly appreciated) Thanks in Advance
Here is what i have so far:
<Table id="idNonRosterTable" inset="false" items="{schedule>/}">
<columns>
<Column hAlign="Center"/>
<Column hAlign="Center">
<Text text="Monday"/>
</Column>
<Column hAlign="Center">
<Text text="Tuesday"/>
</Column>
<Column hAlign="Center">
<Text text="Wednsday"/>
</Column>
<Column hAlign="Center">
<Text text="Thursday"/>
</Column>
<Column hAlign="Center">
<Text text="Friday"/>
</Column>
<Column hAlign="Center">
<Text text="Total hours per week"/>
</Column>
</columns>
<items>
<ColumnListItem vAlign="Middle" >
<cells>
<ObjectIdentifier title="{schedule>week}"/>
<HBox>
<VBox><Text text="Start time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text text="Total Hrs/Day"/></VBox>
<VBox><Text text="End time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text/></VBox>
</HBox>
<HBox>
<VBox><Text text="Start time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text text="Total Hrs/Day"/></VBox>
<VBox><Text text="End time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text/></VBox>
</HBox>
<HBox>
<VBox><Text text="Start time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text text="Total Hrs/Day"/></VBox>
<VBox><Text text="End time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text/></VBox>
</HBox>
<HBox>
<VBox><Text text="Start time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text text="Total Hrs/Day"/></VBox>
<VBox><Text text="End time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text/></VBox>
</HBox>
<HBox>
<VBox><Text text="Start time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text text="Total Hrs/Day"/></VBox>
<VBox><Text text="End time"/><TimePicker valueFormat="HH:mm" displayFormat="HH:mm"/><Text/></VBox>
</HBox>
<Text/>
</cells>
</ColumnListItem>
</items>
</Table>
For me it looks like nested for loop with sap.ui.table.Table, addColumn() and addRow()

SAPUI5 Smart Table filter not working when place smart table inside a dialog popup

I have a sapui5 smarttable inside a fragment that used in a dialog to display the table in a popup.
I've given all the required parameters to the smarttable and smart filter. But when I click the GO button on the filter it doesn't do any thing. (not even a request is calling)
But filter suggestions are displaying when I type some text in a filter field.
Pagination and data displaying also working correctly.
Don't know the reason. Do you have any idea????
Source
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar"
xmlns:smartTable="sap.ui.comp.smarttable" xmlns:smartField="sap.ui.comp.smartfield" xmlns:unified="sap.ui.unified"
xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">
<smartFilterBar:SmartFilterBar id="actionItemHistoryFilterBar" entitySet="VTicketPOActionItemHistory"
persistencyKey="actionItemHistoryFilterBar_Persis">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="TICKET_ID" index="0" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"
label="{#i18n>poActionItemHistoryTicketId}"></smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="PO_NUMBER" index="1" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"
label="{#i18n>poActionItemHistoryPONumber}"></smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="ACTION_ITEM" index="2" visibleInAdvancedArea="true"
preventInitialDataFetchInValueHelpDialog="false" label="{#i18n>poActionItemHistoryActionItem}"></smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="DUE_DATE" index="3" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"
controlType="date" filterType="interval" label="{#i18n>poActionItemHistoryDueDate}"></smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="ACTUAL_COMPLETION_DATE" index="3" visibleInAdvancedArea="true"
preventInitialDataFetchInValueHelpDialog="false" controlType="date" filterType="interval"
label="{#i18n>poActionItemHistoryActualCompletionDate}"></smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>
<smartTable:SmartTable id="actionItemHistoryTable" entitySet="VTicketPOActionItemHistory" smartFilterId="actionItemHistoryFilterBar"
useExportToExcel="false" useVariantManagement="false" useTablePersonalisation="true" tableType="ResponsiveTable"
header="{i18n>poActionItemHistory}" showRowCount="true" persistencyKey="actionItemHistoryST_persis" enableAutoBinding="false"
demandPopin="true" class="sapUiResponsiveContentPadding"
requestAtLeastFields="PO_NUMBER,TICKET_ID,ACTION_ITEM_ID,DUE_DATE,COMMENT,ACTUAL_COMPLETION_DATE,ACTION_ITEM">
<Table id="articlecoretable" growing="true" growingThreshold="10" mode="MultiSelect" sticky="ColumnHeaders">
<!--sticky="ColumnHeaders"-->
<columns>
<Column id="TICKET_ID" hAlign="Begin">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "TICKET_ID", "columnIndex":"0", "leadingProperty": "TICKET_ID"}'/>
</customData>
<Text text="{#i18n>poActionItemHistoryTicketId}"/>
</Column>
<Column id="DUE_DATE" hAlign="Begin">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "DUE_DATE", "columnIndex":"3", "leadingProperty": "DUE_DATE"}'/>
</customData>
<Text text="{#i18n>poActionItemHistoryDueDate}"/>
</Column>
<Column id="ACTUAL_COMPLETION_DATE" hAlign="Begin">
<customData>
<core:CustomData key="p13nData"
value='\{"columnKey": "ACTUAL_COMPLETION_DATE", "columnIndex":"4", "leadingProperty": "ACTUAL_COMPLETION_DATE"}'/>
</customData>
<Text text="{#i18n>poActionItemHistoryActualCompletionDate}"/>
</Column>
<Column id="STATUS" hAlign="Begin">
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "STATUS", "columnIndex":"5", "leadingProperty": "STATUS"}'/>
</customData>
<Text text="{#i18n>poActionItemHistoryStatus}"/>
</Column>
</columns>
<items>
<ColumnListItem type="Active">
<cells>
<Text text="{parts: [{path: 'TICKET_ID'}],formatter: '.formatNumericString'}"/>
<Text text="{parts: [{path: 'DUE_DATE'}],formatter: '.formatter.formatDatetoDisplay'}"/>
<Text text="{parts: [{path: 'ACTUAL_COMPLETION_DATE'}],formatter: '.formatter.formatDatetoDisplay'}"/>
<core:Icon src="sap-icon://alert" class="iconClass" tooltip="{i18n>ammendment_tooltip}"></core:Icon>
</cells>
</ColumnListItem>
</items>
</Table>
</smartTable:SmartTable>
</core:FragmentDefinition>

Default controller not work with my fxml

I have no clue why this code does not work. I have created an fxml document using Scene Builder and all it does is add a borderpane. So far I only get errors when trying to call my fxml. I think it might be because the program dose not think I initialized some of my variables, but I don;t know why.
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.fxml.FXMLLoader;
public class Main extends Application {
#Override
public void start(Stage primaryStage) {
try {
BorderPane root = (BorderPane)FXMLLoader.load(getClass().getResource("Sample.fxml"));
Scene scene = new Scene(root,400,400);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
import javafx.fxml.FXML;
import javafx.scene.layout.Pane;
public class SampleController {
#FXML
Pane mainPane;
#FXML
private void initialize() {
System.out.println(mainPane.getHeight());
}
}
hears the fxml file created.
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane maxHeight="-Infinity" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.SampleController">
<top>
<MenuBar BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</top>
<center>
<BorderPane prefHeight="200.0" BorderPane.alignment="CENTER">
<center>
<AnchorPane prefHeight="273.0" prefWidth="1104.0" BorderPane.alignment="CENTER">
<children>
<Pane fx:id="taskPane" layoutX="10.0" layoutY="4.0" minHeight="259.0" AnchorPane.bottomAnchor="10.0" AnchorPane.topAnchor="0.0">
<children>
<ScrollPane layoutX="19.0" layoutY="54.0" prefHeight="205.0" prefWidth="337.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="290.0">
<children>
<VBox layoutX="1.0" prefHeight="238.0" prefWidth="297.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Button layoutX="39.0" layoutY="16.0" mnemonicParsing="false" text="New Habit" />
<Label layoutX="152.0" layoutY="21.0" text="Habits">
<font>
<Font size="22.0" />
</font>
</Label>
</children>
</Pane>
<Pane layoutX="376.0" layoutY="7.0" minHeight="259.0" AnchorPane.bottomAnchor="10.0" AnchorPane.topAnchor="0.0">
<children>
<ScrollPane layoutX="19.0" layoutY="54.0" prefHeight="205.0" prefWidth="337.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="290.0">
<children>
<VBox layoutX="1.0" prefHeight="238.0" prefWidth="297.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Button layoutX="39.0" layoutY="16.0" mnemonicParsing="false" text="New Task" />
<Label layoutX="152.0" layoutY="21.0" text="Dayley Tasks">
<font>
<Font size="22.0" />
</font>
</Label>
</children>
</Pane>
<Pane layoutX="748.0" layoutY="15.0" minHeight="259.0" prefHeight="259.0" prefWidth="356.0" AnchorPane.bottomAnchor="20.0" AnchorPane.topAnchor="0.0">
<children>
<ScrollPane layoutX="19.0" layoutY="54.0" prefHeight="205.0" prefWidth="337.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="290.0">
<children>
<VBox layoutX="1.0" prefHeight="238.0" prefWidth="297.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Button layoutX="39.0" layoutY="16.0" mnemonicParsing="false" text="New ToDo" />
<Label layoutX="152.0" layoutY="21.0" text="To Do List">
<font>
<Font size="22.0" />
</font>
</Label>
</children>
</Pane>
</children>
<padding>
<Insets bottom="10.0" />
</padding>
</AnchorPane>
</center>
<top>
<Pane prefHeight="150.0" prefWidth="400.0" BorderPane.alignment="CENTER" />
</top>
<BorderPane.margin>
<Insets left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
</BorderPane>
</center>
</BorderPane>
this is what my project looks like.
[enter image description here][1]
[Main (3) [Java Application]
application.Main at localhost:34867
Thread [main] (Suspended (exception NullPointerException))
SystemProperties.setVersions() line: 81
SystemProperties.lambda$static$55() line: 67
1917513796.run() line: not available
AccessController.doPrivileged(PrivilegedAction<T>) line: not available [native method]
SystemProperties.<clinit>() line: 64
LauncherImpl.startToolkit() line: 668
LauncherImpl.launchApplicationWithArgs(String, String, String[]) line: 337
LauncherImpl.launchApplication(String, String, String[]) line: 328
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
LauncherHelper$FXHelper.main(String...) line: 767
/usr/lib/jvm/java-8-openjdk-amd64/bin/java (Mar 24, 2018, 5:19:54 PM)
][2]
[1]: https://i.stack.imgur.com/ThjM6.png
[2]: http://eror.com
I think I have fixed it try replacing your fxml with this
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane maxHeight="-Infinity" minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.SampleController">
<top>
<MenuBar BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</top>
<center>
<BorderPane prefHeight="200.0" BorderPane.alignment="CENTER">
<center>
<AnchorPane prefHeight="273.0" prefWidth="1104.0" BorderPane.alignment="CENTER">
<children>
<Pane fx:id="taskPane" layoutX="10.0" layoutY="4.0" minHeight="259.0" AnchorPane.bottomAnchor="10.0" AnchorPane.topAnchor="0.0">
<children>
<ScrollPane layoutX="19.0" layoutY="54.0" prefHeight="205.0" prefWidth="337.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="290.0">
<children>
<VBox layoutX="1.0" prefHeight="238.0" prefWidth="297.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Button layoutX="39.0" layoutY="16.0" mnemonicParsing="false" text="New Habit" />
<Label layoutX="152.0" layoutY="21.0" text="Habits">
<font>
<Font size="22.0" />
</font>
</Label>
</children>
</Pane>
<Pane layoutX="376.0" layoutY="7.0" minHeight="259.0" AnchorPane.bottomAnchor="10.0" AnchorPane.topAnchor="0.0">
<children>
<ScrollPane layoutX="19.0" layoutY="54.0" prefHeight="205.0" prefWidth="337.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="290.0">
<children>
<VBox layoutX="1.0" prefHeight="238.0" prefWidth="297.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Button layoutX="39.0" layoutY="16.0" mnemonicParsing="false" text="New Task" />
<Label layoutX="152.0" layoutY="21.0" text="Dayley Tasks">
<font>
<Font size="22.0" />
</font>
</Label>
</children>
</Pane>
<Pane layoutX="748.0" layoutY="15.0" minHeight="259.0" prefHeight="259.0" prefWidth="356.0" AnchorPane.bottomAnchor="20.0" AnchorPane.topAnchor="0.0">
<children>
<ScrollPane layoutX="19.0" layoutY="54.0" prefHeight="205.0" prefWidth="337.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="290.0">
<children>
<VBox layoutX="1.0" prefHeight="238.0" prefWidth="297.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Button layoutX="39.0" layoutY="16.0" mnemonicParsing="false" text="New ToDo" />
<Label layoutX="152.0" layoutY="21.0" text="To Do List">
<font>
<Font size="22.0" />
</font>
</Label>
</children>
</Pane>
</children>
<padding>
<Insets bottom="10.0" />
</padding>
</AnchorPane>
</center>
<top>
<Pane fx:id="mainPane" prefHeight="150.0" prefWidth="400.0" BorderPane.alignment="CENTER" />
</top>
<BorderPane.margin>
<Insets left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
</BorderPane>
</center>

SAPUI5 SmartTable itemPressed - get pressed cell

is there any chance to get the value of the pressed cell in the itemPress event ? I would like to set a tooltip when somebody presses a cell in a column. Alternatively, is it possible to register this event on a cell only ?
I am using SmartTable (responsive -> sap.m.table) based on XML View:
<smartTable:SmartTable
id="kubas"
entitySet="myEntity"
initiallyVisibleFields="absender,empfaenger,nachtyp"
smartFilterId="smartFilterBar"
tableType="ResponsiveTable"
useExportToExcel="true"
useVariantManagement="true"
useTablePersonalisation="true"
header="Entries"
showRowCount="true"
persistencyKey="SmartTableAnalytical_Explored"
enableAutoBinding="true"
demandPopin="true"
class="sapUiResponsiveContentPadding"
dataReceived="onDataReceived"
>
</smartTable:SmartTable>
Or would it be better to somehow incorporate an icon / image to the cells value and set the tooltip for it ?
It is generally not a very good practice to set tooptip by itemPress event of a cell.
Either you can set a tooltip in Column header or you can customize your Column item showing tooltip.
You can customize your inner table of SmartTable, for example, Column header and Column item like below. More info please see here.
<smartTable:SmartTable entitySet="LineItemsSet"
smartFilterId="smartFilterBar" tableType="ResponsiveTable"
useExportToExcel="true" useVariantManagement="false"
useTablePersonalisation="true" header="Line Items" showRowCount="true"
persistencyKey="SmartTableAnalytical_Explored" enableAutoBinding="true"
demandPopin="true" class="sapUiResponsiveContentPadding">
<Table>
<columns>
<Column width="100px" hAlign="Left">
<customData>
<core:CustomData key="p13nData"
value='\{"columnKey": "Dmbtr", "maxLength": "5","columnIndex":"4", "leadingProperty": "Dmbtr"}' />
</customData>
<Text text="{/#LineItems/Dmbtr/#sap:label}" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text
text="{Dmbtr}" />
</cells>
</ColumnListItem>
</items>
</Table>
</smartTable:SmartTable>
Set tooltip for column header if you want to show general information regarding this column.
<columns>
<Column width="100px" hAlign="Left">
<customData>
<core:CustomData key="p13nData"
value='\{"columnKey": "Dmbtr", "maxLength": "5","columnIndex":"4", "leadingProperty": "Dmbtr"}' />
</customData>
<Text text="{/#LineItems/Dmbtr/#sap:label}" tooltip = "YOUR TOOLTIP"/>
</Column>
</columns>
Set tooltip for each individual cell.
<items>
<ColumnListItem>
<cells>
<Text text="{Dmbtr}" tooltip = "YOUR TOOLTIP"/>
</cells>
</ColumnListItem>
</items>
One more thing though, when i wanted to add the second column i was unable to bind it, in terms, the data was not coming from my entitySet, the column remain empty. If i put a hardcoded text, then it gets popuplated. Any clue why ?
<Table growing="true" growingScrollToLoad="true" >
<columns>
<Column hAlign="Left" vAlign="Middle" visible="true" >
<customData>
<core:CustomData key="p13nData"
value='\{"columnKey": "column1", "leadingProperty": "column1", "filterProperty": "column1", "columnIndex":"0"}' />
</customData>
<Text text="Column1" />
</Column>
<Column hAlign="Left" vAlign="Middle" visible="true" >
<customData>
<core:CustomData key="p13nData"
value='\{"columnKey": "column2", "columnIndex":"1"}' />
</customData>
<Text text="Column2" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<HBox>
<core:Icon src="sap-icon://sys-help" />
<ToolbarSpacer width="5px" />
<Text text="{column1}" tooltip="dasda" />
</HBox>
</cells>
<cells>
<Text text="{column2}" tooltip="dasda" />
</cells>
</ColumnListItem>
</items>