Does the loop property of the sap.m.Carousel work? - sapui5

I am trying to enable the Carousel's loop feature.
In my view, I declare the property:
<Carousel height="auto" loop="true" pages="{ProductCollection}">
<customLayout>
<CarouselLayout visiblePagesCount="2" />
</customLayout>
</Carousel>
It seems not to work!
Here's a sample of my code: https://embed.plnkr.co/zILEH3/

Turns out it was a bug that it worked backwards at all 😄 which is fixed by now..
According to the note in the API reference, which I missed, the sap.m.Carousel was designed to ignore the loop if the visiblePagesCount is not 1.
Note: When this property is set to something different than the default value, the loop property of Carousel is ignored.

Related

ion-toggle ionChange get called multiple times in ionic

ion-toggle ionChange get called multiple times in ionic. I have tried using different techniques to solve it but I am not successful.
Code 1:
<ion-toggle
(ionChange)="changeData()"
color="success"
checked="{{data}}"
>
</ion-toggle>
Problem: When I used code 1 then ionChange get called multiple time and it does not show correct state first time.
Code 2:
<ion-toggle
(ionChange)="changeData()"
color="success"
[(ngModel)]="data"
>
</ion-toggle>
Problem: Code 2 causes infinite loop. It calls ionChange infinitly.
If anybody has faced similar issue and/or anybody knows how to tackle it then please let me know. Thanks
Infinite loop or multiple time calling of a method can be occurs if you are changing the the value of boolean in (ionChange)="changeData()" while you are already using [(ngModel)]="data" which is changing boolean value on toggling. So remove any code in your code which is changing data on ionChange.
I was facing similar problem when i was changing the value of boolean on ionChange while i was already using [(ngModel)].
So remove any code similar to code below in changeData() method:
// remove code which is changing state again
data = !data
I solved in the following way, remove the link from ngModel or checked with some variable. To go back to the previous state I map with the viewChild and control it from there.
Online test link
here

ng-bootstrap datepicker popup placement not changing

I'm trying to use the placement option listed under input options for the NgbInputDatePicker.
I'd like to change the default bottom-left position of the popup datepicker, but when I try to use placement in the plunker example (https://ng-bootstrap.github.io/app/components/datepicker/demos/popup/plnkr.html) It doesn't change the position of the popup.
I've tried:
adding [placement]="top" inside of the input tag:
<input class="form-control" placeholder="yyyy-mm-dd"
name="dp" [placement]="top" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
I've also tried just placing it in the parent div:
<div class="input-group" placement="top">
<input class="form-control" placeholder="yyyy-mm-dd"
name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
but neither seems to change the pop up position. I'm new to Angular, so perhaps I just have the syntax wrong somehow? I noticed other input APIs in the documentation that seemed to be used in this fashion so I thought it might work...
I'm using ng-bootstrap 1.0.0-beta.2, and Angular 4.3.4.
Thanks.
The problem is that you are using a binding to an expression (top means expression in [placement]="top") while I think that your intention is to use "top" constant. You can solve it using one of the 2 methods:
placement="top" (preferred)
[placement]="'top'" (notice additional quotes around top)
When specified properly the placement option works perfectly fine as illustrated in this plunker: http://plnkr.co/edit/NCNmpm3tlxapH4jZS08F?p=preview

SAP UI5: NumericContent: scale is shorted

I am having a problem while using SAP UI5. I am using a NumericContent Tile. Here I want to set "km/h" as a scale, but it always gets abbriged to "km/".
How can I prevent this?
<TileContent footer="{i18nExtended>SpeedTripMax}" class="sapUiSmallMargin">
<content>
<NumericContent value="{mymodel>/SpeedTripMax}"
truncateValueTo="6" scale="km/h"/>
</content>
</TileContent>
I do not know why it is happening, but according to api one should use sap.suite.ui.commons.GenericTile instead of sap.suite.ui.commons.NumericTile because it is deprecated since version 1.25.
Try GenericTile approach.
EDITED 10:42 120717:
I tested it on my system and it is bug, because k/h works fine:
The max string length is just 3 signs:
I was testing it within GenericTile.

Use constant in f:viewAction through OmniFaces importConstants

I'm testing OmniFaces importConstant functionality and successfully display a constant on a page like this:
#{Config.SOME_CONSTANT} (writes 4 to the page)
If I try to do this in a f:viewAction however, it doesn't work:
<f:viewAction action="#{bean.someMethod(Config.SOME_CONSTANT)}" />
It resolves to zero in the method.
What am I doing wrong?
A viewAction is and called right after metadata parsing (see this article) and before the view is even rendered.
I'm not quite sure what the "EL Scope" referred to in the documentation is, but it appears to be render time only, ie only until after your viewAction is called.

Why bindings do not work?

<textbox id="nextTitleTextbox" readonly="true" value="#bind(ivm.inventory.successorTitleName)" />
<button id="nextTitleButton" label="..." mold="trendy" onClick="#command('chooseFormerOrSuccessor', isFormer = false)"/>
<a id="nextTitleHrefView" href="/inventory_new.do?method=edit&docUID=${ivm.inventory.successorTitleName}">view</a>
<a id="nextTitleHrefHistory" href="javascript:showRenamingHistory(${ivm.inventory.successorTitleName},${ivm.inventory.successorTitleName})">history</a>
The problem is in 'a' tags. Textbox and buttons works fine, but links in 'a' tags do not catch information from binding, so link there looks like /inventory_new.do?method=edit&docUID=. I really don't understand what's wrong here, because I tried a lot of combination and something similar is working on other pages. Where is mistake in this binding?
I even tried to put string from zscript
<zscript>
String successorTitleHref = "/inventory_new.do?method=edit&docUID=" + ivm.inventory.successorTitleName;
</zscript>
But got exception:
Typed variable declaration : Class or variable not found: ivm.inventory.replacementTitleName.
Also, it's supported controls, that locates in separate file, and every control adding with use derective.
Binding in ZK has nothing to do with variable replacement. #bind() doesn't mean you can use ${...}. The two are completely separate concepts even though both are called "EL Expression" in the manual. But binding EL Expression and ZUML EL Expressions are two different things.
To allow access to ivm in a zscript, you need to define this variable somewhere in the script. One way is to instantiate it:
IVM ivm = new IVM();
or you can use a custom variable resolver.