Couldnt set Width to Combobox in ZK? - zk

Am new to ZK and using combobox in my page.I gave width="100%" to combobox but it doesn't take and if I refresh the page , the combobox shrinks.
Please anyone tell me how I can set common width to entire combobox in my application uniformly?

There are few ways to do what you want. for example:
<div sclass="positionInfo">
<combobox readonly="true" width="30%" model="#load(vm.positionModel)" constraint="no empty:Please select position!"
selectedItem="#bind(fx.position)" tabindex="3">
<template name="model" var="po">
<comboitem label="#load(po.positionName)" value="#load(po.positionId)" />
</template>
</combobox>
</div>
put your combobox inside div element, then set CSS class named "positionInfo".
set CSS rule for CSS selector .positionInfo (width by a specific pixels or percent), then everything will be done.

Related

#circlon/angular-tree-component: How to customize checkbox template

I want to use custom templates for the tree nodes as shown here on their website
https://angular2-tree.readme.io/docs/templates
But I also need the checkbox tri-state functionality as demonstrated here
https://angular2-tree.readme.io/docs/tri-state-checkboxes
In this custom treeNodeFullTemplate example they have a checkbox as part of the template but it doesn't have the tri-state relationship between the parents and children. Is there a way to have a custom checkbox and keep all the correct event listeners etc.? I can't seem to find any documentation on the checkboxes API if there is one.
<tree-root id="tree" [focused]="true" [nodes]="nodes">
<ng-template #treeNodeFullTemplate let-node let-index="index" let-templates="templates">
<div class="tree-node">
<input type="checkbox" [checked]="node.isActive" (change)="node.toggleActivated(true)" />
<tree-node-expander [node]="node"></tree-node-expander>
<div
class="node-content-wrapper"
[class.node-content-wrapper-active]="node.isActive"
[class.node-content-wrapper-focused]="node.isFocused"
(click)="node.toggleActivated(true)">
<span [class]="node.data.className + 'Index'">{{ index }}</span>
<span [class]="node.data.className" [class.title]="true">{{ node.data.title }}</span>
</div>
<tree-node-children [node]="node" [templates]="templates"></tree-node-children>
</div>
</ng-template>
</tree-root>
I can see that the (change) method on the checkbox is not right but do I need to write my own one to get the parent and children and determine state on click? It seems strange that I can't just tap into an existing API.

Position custom react-leaflet control into leaflet control container

In this example the the custom control is placed below the actual leaflet-control-container element.
<div class="leaflet-control-container">
<div class="leaflet-top leaflet-left"></div>
<div class="leaflet-top leaflet-right"></div> <----- Where I want it
<div class="leaflet-bottom leaflet-left"></div>
<div class="leaflet-bottom leaflet-right"></div>
</div>
<div class="leaflet-top leaflet-right"></div> <----- Where it is actually placed
This causes that anything in leaflet-control-container leaflet-top.leaflet-right div is covered with the custom element.
Is there a way to place this custom element inside leaflet-control-container?
That example looks buggy and unnecessarily complex. Try wrapping the minimap component in a LayerControl and using that to set the position:
<LayersControl position="topright">
<MinimapControl />
</LayersControl>

Create a popup inside a form

I want to include a popup inside a form. The normal way to do that is to have 2 forms like:
<div class="wrapper" >
<h:form>
<h:panelGroup id="id1" layout="block">
<ui:include src= content1 />
</h:panelGroup>
</h:form>
</div>
<h:form id="modalId">
<ui:include src= popupContent >
</ui:include>
</h:form>
and render with a button inside content1, the form "modalId" that contains the popUp.
I have the popup form in an external component that is included inside "content1". Due to the popup form is inside the other form,it isnt well rendered. How can I fix that? The idea is to use that component that is common for all my xhtml views
The way i was writing my own components was to rely on the existance of the external form. That is, i did not include any form elements inside the component.
If there was a need to reference the outer form element then i would just pass the from id as one of the attributes of the interface. Composite components are really useful for this kind of stuff:
<composite:interface>
<composite:attribute name="formId" type="java.lang.String" />
</composite:interface>
<composite:implementation>
<h:commandButton value="button" action="someaction">
<f:ajax execute="#{cc.attrs.formId}" render="#{cc.attrs.formId}" />
</h:commandButton>
</composite:implementation>
Then you include that in your outer form (assuming 'comp' is your namespace for composite components and 'modal' is the name of the file containing the component):
<h:form id="myForm">
<comp:modal formId="myForm"/>
</h:form>
Go through this tutorial if you are not familiar with them:
http://docs.oracle.com/javaee/6/tutorial/doc/giqzr.html

Typo3 7.6 Flux backend layout column title

I created a basic template with the builder extension. In the page properties I set Backend layout to fuildpages and I see now in the backend the 2 columns that the builder extension created:
<f:section name="Configuration">
<flux:form id="standard">
<!-- Insert fields, sheets, grid, form section objects etc. here, in this flux:form tag -->
</flux:form>
<flux:grid>
<!-- Edit this grid to change the "backend layout" structure -->
<flux:grid.row>
<flux:grid.column colPos="0" colspan="3" name="main" />
<flux:grid.column colPos="1" name="right" />
</flux:grid.row>
</flux:grid>
</f:section>
<f:section name="Main">
<h1>I am a page template!</h1>
<p>
My template file is EXT:my_template/Resources/Private/Page/Standard.html.
</p>
<div style="float: left; width: 75%;">
<h2>Content main</h2>
<v:content.render column="0" />
</div>
<div style="float: left; width: 25%;">
<h2>Content right</h2>
<v:content.render column="1" />
</div>
</f:section>
But in the backend this columns don't have the names "main" and "right".
In typo3 6.2 this worked with the basic template the builder create. Do I miss something?
And an additional question: Is there a sysext for the default backend layout "Left" "Normal" "Right" "Border"? I wanted to watch there how it is done but I could not find it.
You need to set the label attribute on your <flux:grid.column/>-tags. The name attribute is only used to reference the column in other places, for example to render it using the <v:content.render/>-ViewHelper from EXT:vhs.
A note on translations of the column label: The label attribute can not contain usages of the <f:translate/>-ViewHelper, due to caching (GitHub issue). If you want to translate your column names, you need to provide the translation under some default key, which one that is is explained here.

FlexBox Item growFactor is not updating the style if the binding is changing

Here is the plunker link: http://plnkr.co/edit/XVINtJ1RbNrkaCAFbZti?p=preview
I have a view with a FlexBox with 2 items that span 100% width.
<FlexBox width="100%">
<items>
<Button press="onButtonLeftPress" text="{LayoutModel>/left}" width="100%" type="Emphasized" >
<layoutData>
<FlexItemData growFactor="{LayoutModel>/left}" />
</layoutData>
</Button>
<Button press="onButtonRightPress" text="{LayoutModel>/right}" width="100%" type="Reject">
<layoutData>
<FlexItemData growFactor="{LayoutModel>/right}" />
</layoutData>
</Button>
</items>
</FlexBox>
The growFactor of the 2 FlexBox items are bound to a LayoutModel that is initialized in index.html
var layoutModel = new sap.ui.model.json.JSONModel();
layoutModel.setData({
left: 2,
right: 1
});
ui5Core.setModel(layoutModel, "LayoutModel");
By pressing the buttons I update the model properties "left" and "right". The values are updated as you can see but the style for the items is not updated.
I see that FlexBox is taking into consideration only at initialization the values, but if the value is changed the UI is not updated.
The main idea is that I'm trying to obtain a layout with 2-3 columns that collapse/expand.
Do you have any ideas how to obtain this? or how to solve this FlexBox bug?
Many thanks
You have to call invalidate() on the FlexBox instance inside your handler functions. This will make the FlexBox rerender and everything works as expected. Here is a "One-File" jsbin example: https://jsbin.com/pisadigene/edit?html,output
I did not check the code of the FlexBox but I guess that updating the GrowFactor of a FlexBox item does not trigger a change (i.e. rerendering). I guess it’s just a one-time thing...
However, you should be aware that using invalidate() will trigger a re-rendering for all content inside the FlexBox. So that is not a good idea in case you have a lot of content inside the FlexBox because it can have a negative effect on performance… I am not very sure what you try to achieve but using flexboxes for a complete layout of the app might not be a good idea. Instead you should check the other opportunities you have with SAPUI5, i.e. MatrixLayout etc.