In Ionic-React how to create a carousel with ionic slides and want to use it inside the IonList, so the image can be a thumbnail or avatar. I tried changing the CSS but with no luck and also autoplay is not working.
Want to use it purely in ionic so that it can be accessed on mobile as well.
const slideOptsOne = {
initialSlide: 0,
slidesPerView: 1,
autoplay: true
};
<IonList>
<IonItem>
<IonSlides pager={true} options={slideOptsOne}>
<IonSlide>
<IonThumbnail slot="start">
<img src="image source" className="divSlide"/>
</IonThumbnail>
</IonSlide>
<IonSlide>
<IonThumbnail slot="start">
<img src="image source" />
</IonThumbnail>
</IonSlide>
</IonSlides>
<IonLabel>
<h5>Finn</h5>
<h6>I'm a big deal</h6>
<p>Listen, I've had a pretty messed up day...</p>
</IonLabel>
<IonLabel>
<p>Finn</p>
<p>I'm a big deal</p>
</IonLabel>
</IonItem>
<IonItem>
<IonSlides pager={true} options={slideOptsOne}>
<IonSlide>
<IonThumbnail slot="start">
<img src="image source" className="divSlide"/>
</IonThumbnail>
</IonSlide>
<IonSlide>
<IonThumbnail slot="start">
<img src="image source" />
</IonThumbnail>
</IonSlide>
</IonSlides>
<IonLabel>
<h5>Han</h5>
<h6>Look, kid...</h6>
<p>I've got enough on my plate as it is, and I...</p>
</IonLabel>
<IonLabel>
<p>Finn</p>
<p>I'm a big deal</p>
</IonLabel>
<IonLabel>
<h5>Han</h5>
<h6>Look, kid...</h6>
<p>I've got enough on my plate as it is, and I...</p>
</IonLabel>
</IonItem>
</IonList>
The IonItem format is somewhat fixed. If you want to use it, I would suggest changing your approach to the following:
<IonList>
<IonItem>
<IonThumbnail slot="start">
<IonSlides options={slideOptsOne}>
<IonSlide>
<IonImg alt="logo" src="..." />
</IonSlide>
<IonSlide>
<IonImg alt="logo" src="..." />
</IonSlide>
</IonSlides>
</IonThumbnail>
<IonLabel>
<p>Finn</p>
<p>I'm a big deal</p>
</IonLabel>
</IonItem>
<IonItem>
...
</IonItem>
</IonList>
Related
I am getting the error "Cannot add direct child without default aggregation defined for control sap.m.Label". Not sure what this means. Here is my fragment:
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:f="sap.f">
<ResponsivePopover id="popover" title="{Name}" class="sapUiPopupWithPadding" placement="Bottom">
<beginButton>
<Button id="submit" text="{i18n>submit}" press="onSubmit" class="sapUiTinyMargin"/>
</beginButton>
<content>
<f:GridContainer>
<f:layout>
<f:GridContainerSettings rowSize="5rem" columnSize="8rem" gap="1rem"/>
</f:layout>
<f:layoutS>
<f:GridContainerSettings rowSize="5rem" columnSize="10rem" gap="0.5rem"/>
</f:layoutS>
<f:layoutXS>
<f:GridContainerSettings rowSize="5rem" columnSize="10rem" gap="0.5rem"/>
</f:layoutXS>
<Label text="{i18n>req}" required="true">
<f:layoutData>
<f:GridContainerItemLayoutData columns="3"/>
</f:layoutData>
</Label>
<Label id="txt" text="{i18n>cat}" required="true">
<f:layoutData>
<f:GridContainerItemLayoutData columns="3"/>
</f:layoutData>
</Label>
<RadioButton id="rbtn1" text="{i18n>grq}">
<f:layoutData>
<f:GridContainerItemLayoutData columns="4"/>
</f:layoutData>
</RadioButton>
<RadioButton id="rbtn2" text="{i18n>frq}">
<f:layoutData>
<f:GridContainerItemLayoutData columns="4"/>
</f:layoutData>
</RadioButton>
<TextArea id="txtarea" value="" placeholder="{i18n>typeq}" growing="true" growingMaxLines="10" width="100%">
<f:layoutData>
<f:GridContainerItemLayoutData columns="7"/>
</f:layoutData>
</TextArea>
<Text text="{i18n>note}">
<f:layoutData>
<f:GridContainerItemLayoutData columns="7"/>
</f:layoutData>
</Text>
</f:GridContainer>
</content>
</ResponsivePopover>
</core:FragmentDefinition>
Expected result is the fragment will load with out errors.
The named aggregation must have the same namespace as the parent tag.
The namespace of the parent control tag and the aggregation tag must be the same. (Source)
In your case, the issue is in <SomeSapMControl><f:layoutData>. Remove the f: in <f:layoutData> so that it matches with the parent's (default) namespace.
sap.ui.require([
"sap/ui/core/Core"
], Core => Core.attachInit(() => sap.ui.require([
"sap/ui/core/Fragment"
], Fragment => Fragment.load({
definition: `<f:GridContainer xmlns:f="sap.f" xmlns="sap.m">
<Label text="Label within GridContainer">
<layoutData>
<f:GridContainerItemLayoutData columns="3"/>
</layoutData>
</Label>
</f:GridContainer>`
}).then(control => control.placeAt("content")))));
<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m,sap.f,sap.ui.layout"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-async="true"
data-sap-ui-compatversion="edge"
data-sap-ui-xx-waitfortheme="init"
></script>
<body id="content" class="sapUiBody"></body>
"Cannot add direct child without default aggregation defined for control sap.m.Label". Not sure what this means.
Within control definition, control developers can assign a default aggregation so that application developers can add children without having to put an aggregation name explicitly in the XML view definition. An example of this is sap.f.GridContainer. Its default aggregation is items.src Hence, you won't need to add <f:items> to add children there (See my code snippet above).
If, however, the control has no default aggregation and the child node name matches with none of the named aggregations, the XML processor will throw the above error.
The sap.m.Label and the other controls cannot be used inside sap.f.Gridcontainer directly. You'll need to place them inside <f:items> first.
From the documentation: https://sapui5.netweaver.ondemand.com/sdk#/api/sap.f.GridContainer%23overview
<f:GridContainer>
<f:layout>
<f:GridContainerSettings rowSize="5rem" columnSize="5rem" gap="1rem" />
</f:layout>
<f:layoutS>
<f:GridContainerSettings rowSize="4rem" columnSize="4rem" gap="0.5rem" />
</f:layoutS>
<f:items>
<GenericTile header="Sales Fulfillment">
<layoutData>
<f:GridContainerItemLayoutData rows="2" columns="2" />
</layoutData>
</GenericTile>
<w:Card manifest="url-to-manifest">
<w:layoutData>
<f:GridContainerItemLayoutData rows="6" columns="3" />
</w:layoutData>
</w:Card>
<Panel>
<layoutData>
<f:GridContainerItemLayoutData columns="4" />
</layoutData>
<Text text="Sales information" />
</Panel>
</f:items>
</f:GridContainer>
I'm trying to identify versioning system by folder structure. I've got this project from our new customer and he has no idea about anything. I need help with software identification, so I can browse the sources. Repo struct. is as following:
.index contains SQLite3 DB
There is a lot of .xtl files in within these folders. I tried Mercurial, but it's not Mercurial repo. Please help me with identification.
XTL file content example:
<t:content lang="en-us" style="background-image:url('/svc/stream/media/coffee_strip');background-position:left top;background-size:auto;background-repeat:repeat-x;background-attachment:scroll;" styleClass="cover-and-fit fix-alt" xmlns:t="uri:t">
<div class="grid grid-gutter-large">
<div class="grid-row">
<div class="grid-col ice-container box-shadow grid-one-fifth" style="background-image: url("/svc/stream/media/paper_background"); background-attachment: scroll; background-size: auto; background-position: left top; background-repeat: no-repeat;">
<div class="ice-content align-center small-padding-top small-padding-bottom">
<t:link href="/en"><t:img height="100" src="/media/DC_logo_new" width="95"/></t:link>
</div>
</div>
<div class="grid-col ice-container grid-four-fifths">
<div class="grid"><div class="grid-row"><div class="grid-col ice-container grid-three-fourths"><t:module class="Menu" function="display" styleClass="small-padding-top mini-margin-top align-center cs-inversed">
<t:prop name="root" value="auto"/>
<t:prop name="template" value="horizontal"/>
<t:prop name="style" value="clean"/>
<t:prop name="mobileTemplate" value="off-canvas-left"/>
<t:prop name="startlevel" value="1"/>
<t:prop name="maxdepth" value="0"/>
<t:prop name="mobileToggle" value="with-text"/>
<t:prop name="limit" value="none"/>
<t:prop name="fillAllSpace" value="false"/>
</t:module></div><div class="grid-col ice-container grid-one-fourth"><t:module class="product" function="myCart" styleClass="none-margin-bottom small-padding-bottom small-padding-top small-margin-top align-center cs-inversed"/></div></div></div>
</div>
</div>
</div>
</t:content>
I am using PF v.5.3.5 and JSF v.2.2.8. It is a frequent topic in SO. I noticed that there is a bug in PF v.5.3.5 documentation related to the appendTo attribute.
1st approach
The p:confirmDialog is rendered and commandbuttons are rendered but actions does not work and message is not rendered if it is placed inside of nested h:form.
2st approach
If I place this dialog outside of main h:form it is not rendered at all also if I add the global="true" attribute.
3st approach
The p:confirmDialog is rendered and commandbuttons are rendered but actions does not work and message is rendered if the nested h:form is removed.
<h:form>
...
<p:confirmDialog id="askSessionDialog1" widgetVar="askSessionDialog1" severity="alert"
appendTo="#(body)" rendered="#{treeData.askSessionDialogRendered}" visible="#{treeData.askSessionDialogRendered}">
<h:form>
<f:facet name="message">
<h:outputText value="#{msg.WEB_ADMIN_PAGES_TREESEGMENT_NOSESSION}" escape="false"/>
</f:facet>
<p:commandButton value="#{msg.WEB_BUTTONS_OK}" action="#{treeData.save(false, true)}" icon="fa fa-check"
update="#(form)" type="button" />
<p:commandButton value="#{msg.WEB_BUTTONS_CANCEL}" action="#{treeData.setAskSessionDialogRendered(false)}"
icon="fa fa-close" onclick="PF('askSessionDialog1.hide()')" update="#(form)" type="reset" />
</h:form>
</p:confirmDialog>
...
</h:form>
BECKEND PART
setAskSessionDialogRendered(true);
RequestContext.getCurrentInstance().update("treeSegmentForm askSessionDialog askTurnOffDialog askSessionDialog1 askTurnOffDialog1");
Thanks in advance for constructive posts and comments.
SOLVED
This is the best approach that works for me now.
<h:form>
...
<p:confirmDialog id="askSessionDialog" widgetVar="askSessionDialog" severity="alert"
appendTo="#(body)" rendered="#{treeData.askSessionDialogRendered}" visible="#{treeData.askSessionDialogRendered}">
<f:facet name="message">
<h:outputText value="#{msg.WEB_ADMIN_PAGES_TREESEGMENT_NOSESSION}" escape="false"/>
</f:facet>
<h:form>
<p:commandButton value="#{msg.WEB_BUTTONS_OK}" icon="fa fa-check" type="button" accesskey="o">
<p:ajax event="click" listener="#{treeData.save(false, true)}" oncomplete="PF('askSessionDialog').hide()"
update="#(form)" />
</p:commandButton>
<p:commandButton value="#{msg.WEB_BUTTONS_CANCEL}" icon="fa fa-close" type="reset" accesskey="c">
<p:ajax event="click" listener="#{treeData.setAskSessionDialogRendered(false)}"
onsuccess="PF('askSessionDialog').hide()" update="#(form)" />
</p:commandButton>
</h:form>
</p:confirmDialog>
...
</h:form>
BACKEND
setAskSessionDialogRendered(true);
RequestContext.getCurrentInstance().update("treeSegmentForm");
SPACIAL THANKS TO: #YagamiLight
He helped me to kick off my solution.
primefaces mobile commandLink action does not work, it's not loading the page with id="station1". f:setPropertyActionListener is work and call setSelectedStation() method .
<pm:page id="fastStationPage">
<pm:header title="Fast Charging Station" swatch="b" ></pm:header>
<pm:content>
<h:form id="stationsDetailsForm">
<p:growl id="messages" showDetail="true" />
<p:dataList value="#{navigationViewImpl.fastStationList}" var="station" type="ordered">
<p:commandLink value="#{station.name}" action="pm:station1?transition=slide" update=":station1:stationDetail">
<f:setPropertyActionListener value="#{station}" target="#{navigationViewImpl.selectedStation}" />
</p:commandLink>
</p:dataList>
</h:form>
</pm:content>
</pm:page>
<pm:page id="station1">
<pm:content>
<h:outputText id="stationDetail" value="#{navigationViewImpl.selectedStation.name}" escape="false"/>
</pm:content>
</pm:page>
public void setSelectedStation(StationDTO selectedStation) {
this.selectedStation = selectedStation;
}
I got answer. I not configure face-config.xml file. I am not add navigation-handler
<application>
<navigation-handler>
org.primefaces.mobile.application.MobileNavigationHandler
</navigation-handler>
</application>
I have a problem with xforms, how refresh only rich:panel when I choose value from h:selectOneMenu :
<!--<h:form> call bean but--> <form><!--open start page-->
<h:selectOneMenu id="add" onchange="submit()" <!-- can't find context , error orbeon/java--> >
<!-- is not working <a4j:support event="onchange" actionListener="#{bean.action}"/> -->
<s:selectItems value="#{bean.List()}" var="message" itemValue="#{message}" label="#{message}" />
</h:selectOneMenu>
</form>
more Code JSF :
<form>
<rich:panel styleClass="DocumentBody" id="documentPanel"
name="panell" style="margin-top:10px; height:90px;">
<f:facet styleClass="documentHeader" name="header"></f:facet>
<div id="documentTest" class="actionButtons">
<div style="clear: both; height: 15px; width: 60px" />
<s:button id="addButton" value="#{messages['operation.save.button']}"
action="#{actionBean.generateNewName()}" reRender="confirm"
onclick="#{actionBean.generateNewName()};#{rich:component('confirm')}.show();return false;">
</s:button>
<s:button id="loadButton" value="#{messages['operation.load.button']}"
action="#{actionBean.loadDraft()}" reRender="documentTests,documentPanel,loadButton" />
<s:button id="deleteButton" value="#{messages['operation.delete.button']}"
action="#{actionBean.deleteDraft()}" reRender="documentTests,documentPanel,deleteButton" />
</div>
</rich:panel>
</form>
<h:form style="margin: 0;">
<h:selectOneMenu id="messageTypeAdd"
style="margin-right:5px; margin-top:-30px;margin-left:90px;"
valueChangeListener="#{actionBean.documentTestChange}"
enableManualInput="false" selectFirstOnUpdate="true"
directInputSuggestions="true" onchange="submit()">
<!-- submit() rerender all page, but i try refresh only modalPanel id="confirm" -->
<s:selectItems value="#{actionBean.getdocumentTestList()}"
var="message" itemValue="#{message}" label="#{message}" />
<!--a4j and f:ajax is not work, i try update JSF 1.2 to 2.0 -->
</h:selectOneMenu>
</h:form>
<rich:modalPanel id="confirm" autosized="true" width="300">
<f:facet name="header"></f:facet>
<rich:messages style="color:red;" globalOnly="true" />
<a4j:outputPanel ajaxRendered="true">
<h:panelGrid>
<h:panelGrid columns="2">
<h:outputText value="#{messages['report.name.label']}" />
<h:inputText id="newDraftNameInput" value="#{actionBean.newDraftName}"
valueChangeListener="#{actionBean.newDraftNameChange}">
</h:inputText>
</h:panelGrid>
</h:panelGrid>
</a4j:outputPanel>
</rich:modalPanel>