ZK error UI component - css

i have an error when deploying ZK in apache,
java.lang.ClassCastException: neraca.neracaController cannot be cast
to org.zkoss.zk.ui.util.Composer
org.zkoss.zk.ui.metainfo.ComponentInfo.toComposer(ComponentInfo.java:410)
org.zkoss.zk.ui.metainfo.ComponentInfo.toComposer(ComponentInfo.java:397)
org.zkoss.zk.ui.metainfo.ComponentInfo.toComposers(ComponentInfo.java:365)
continued...
here's my zul file,
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<zk>
<style>
.silvergray .complex-layout,
.silvergray .complex-layout .z-south,
.silvergray .complex-layout .z-west {
background: #C5E6EF;
}
.breeze .complex-layout,
.breeze .complex-layout .z-south,
.breeze .complex-layout .z-west {
background: #F7F7F7;
}
</style>
<style>
.z-borderlayout {
background: #FFFFFF
}
.complex-layout .z-north {
background: #008BB6;
}
img.complex-layout-header-img {
padding: 0 10px;
}
.complex-layout-header-label {
position: relative;
top: -30px;
padding-left: 40px;
font-size: 24px;
color: White;
font-weight: bold;
}
.inner-border,
.inner-border .z-north,
.inner-border .z-west,
.inner-border .z-south,
.inner-border .z-east {
background: #FFFFFF;
}
.dl-link {
text-decoration: none;
cursor: pointer;
}
</style>
<borderlayout sclass="complex-layout" height="700px">
<north size="90px" border="0">
<div>
<image sclass="complex-layout-header-img" src="/images/Adempiere.png" />
<label sclass="complex-layout-header-label" value="SCM for Small and Medium Business" />
</div>
</north>
<!-- Sidebar -->
<west width="200px" border="0" flex="true" splittable="true" margins="0,5,0,0">
<vlayout spacing="0">
<panel width="100%" border="normal" title="Menu">
<panelchildren style="padding:5px;">
<vbox>
<toolbarbutton label="Jurnal Keuangan" href="lap_keuangan.zul" image="images/book.png"/>
<toolbarbutton label="Buku Besar " href="neraca.zul" image="images/3.png"/>
<toolbarbutton label="Rasio Lancar" href="rasiolancar.zul" image="images/Modify.png" />
<toolbarbutton label="Rasio Kas" href="kas.zul" image="images/2.png"/>
<toolbarbutton label="Rasio Cepat" href="cepat.zul" image="images/Pie.png"/>
<toolbarbutton label="Rasio Modal Kerja dan Aktiva" href="aktiva.zul" image="images/Bar.png"/>
</vbox>
</panelchildren>
</panel>
</vlayout>
</west>
<!-- Content -->
<center>
<borderlayout sclass="inner-border">
<north border="0" height="4%" margins="2,3,0,0">
<label value="Neraca Keuangan" style="font-size:20px;" />
</north>
<center border="0" margins="0,3,3,3">
<window id="win2" title="" width="auto" height="auto" border="" apply="neraca.neracaController">
<grid>
<rows>
<row>
<hlayout>
<div>
<label>Tahun</label>
<combobox id="tahun" >
<comboitem label="2002"/>
<comboitem label="2003"/>
<comboitem label="2004"/>
<comboitem label="2005"/>
<comboitem label="2006"/>
</combobox>
<button id="pilih" label="pilih"/>
<button id="cetak" label="Cetak" image="images/Print.png"/>
</div>
</hlayout>
</row>
</rows>
</grid>
<listbox id="neraca" multiple="true" model="#{win2$composer.allEvents, load-after='pilih.onClick'}">
<listhead>
<listheader label="Nomer Transaksi"/>
<listheader label="Akun"/>
<listheader label="Periode"/>
<listheader label="Saldo Awal"/>
<listheader label="Debet"/>
<listheader label="Credit"/>
</listhead>
<listitem self="#{each='event'}" value="#{event}">
<listcell label="#{event.trans_no}"/>
<listcell label="#{event.acc_number}"/>
<listcell label="#{event.periode}"/>
<listcell label="#{event.saldo}"/>
<listcell label="#{event.debet}"/>
<listcell label="#{event.credit}"/>
</listitem>
</listbox>
</window>
</center>
</borderlayout>
</center>
<south size="40px" border="0" style="background: none repeat scroll 0 0 ;">
<toolbar mold="panel" align="center">
Powered by ZK
</toolbar>
</south>
</borderlayout>
</zk>
i guess error in apply tag, but im not sure, i have changed it but error still occured, please anyone help me :)

What does your java class neraca.neracaController look like? It must extend from GenericForwardComposer. If it does then there should be no problems.
public class NeracaController extends GenericForwardComposer {
...
}
For more information please refer to this documentation.

Related

JSF Components alignment inside panelGroup

I have a selectOneRadio element with layout="custom" inside a dataTable. Below is the xhtml code-
<p:dataTable var="varlist" value="#{testbean.testlist}">
<p:column headerText="Choose Option" width="120">
<p:selectOneRadio id="customRadio" value="#{varlist.varlistValue}"
layout="custom" required="true">
<f:selectItem itemValue="10" />
<f:selectItem itemValue="20" />
</p:selectOneRadio>
<h:panelGrid columns="1">
<h:panelGroup>
<p:radioButton id="opt1" for="customRadio" itemIndex="0" />
<h:outputLabel for="opt1" value="OPTION 1" styleClass="radiolabelOption"/>
</h:panelGroup>
<h:panelGroup>
<p:radioButton id="opt2" for="customRadio" itemIndex="1" />
<h:outputLabel for="opt2" value="OPTION 2" styleClass="radiolabelOption"/>
</h:panelGroup>
</h:panelGrid>
</p:column>
</p:dataTable>
<style type="text/css">
.radiolabelOption {
margin-left: 10px;
}
</style>
So this is how it appears in browser-
As we can see, the outputLabel appears to the bottom with respect to radioButton. But i want that to look centre, w.r.t radioButton as shown below -
I tried below lines of code like
style="display:block; text-align:center" OR
style="margin: 0 auto;"
But none of them produces the desired result.
So How to do it?
Give <h:panelGroup> these styles
.panelGroup{
display: flex;
align-items: center;
}

How to use the not selector to target elements inside an ID?

Is it possible to use the not css selector to target all elements except all the elements of type INSIDE (a child of) a class or ID?
Example: target all svg files except the ones inside the widget element:
svg:not(#widget) {
fill: red;;
}
<div>
<svg /> // red
<div id="widget">
<svg /> // not red
<svg /> // not red
</div>
<svg /> // red
</div>
svg {
fill: red;
}
#widget svg{
fill : inherit;
}
<div>
<svg style='width:200px;height:200px;' /> // red
<div id="widget">
<svg style='width:200px;height:200px;' /> // not red
<svg style='width:200px;height:200px;' /> // not red
</div>
<svg style='width:200px;height:200px;' /> // red
</div>
div{
color: black;
}
div:not(#widget){
color: red;
}
<div>
<svg /> // red
<div id="widget">
<svg /> // not red
<svg /> // not red
</div>
<svg /> // red
</div>

UI5 responsive layout controls (create responsive CustomListItem)

I built a List of CustomListItems in a XML View:
<!-- List with CustomListItem (seperate Icon for event) -->
<List class="cTL" id="test-list2" type="Active" headerText="CustomListItems with Icon Control" items="{path : '/products'}">
<CustomListItem title="boom" counter="3" class="cTL-item" tabindex="1">
<content>
<core:Icon tabindex="2" decorative="false"
color="{
path: 'price',
formatter:'.setPrioColor'
}"
src="sap-icon://add"></core:Icon>
<layout:VerticalLayout class="cTL-text">
<layout:content>
<Label color="#333333" class="cTL-text-title" text="Orange"></Label>
<Text maxLines="1" wrapping="true" class="cTL-text-desc" text="Spain this is a long long long text lalalala onetwothree einzweidreivier Spain this is a long long long text lalalala onetwothree einzweidreivier"></Text>
</layout:content>
</layout:VerticalLayout>
</content>
</CustomListItem>
</List>
and I added some custom css, so that it looks just like a StandardListItem:
.cTL .cTL-item.sapMLIB {
padding: 0 1rem 0 1rem;
}
.cTL .sapUiIcon {
font-size: 1.375rem;
vertical-align: 80%;
}
.cTL .cTL-text {
margin: 1rem 0.5rem 0.5rem 1rem;
}
.cTL .cTL-text .cTL-text-title.sapMLabel {
font-size: 1rem;
color: #333333;
}
.cTL .cTL-text-desc {
color: #666666;
}
So it works fine if the browser window is fullscreen, BUT: On the Screenshot you can see the List with StandardlistItems above and the CustomListItems below. .. They are not responsive! Which Layout element would you recommend to get it behave like the Standardlistitem (shorten the Text and responsive alignment)?
I would wrap the content in a HBox, and both the icon and the additional layout (which I prefer to be a VBox instead of a VerticalLayout) in their own, centered VBox:
(removed all properties except for the important ones):
<List>
<CustomListItem>
<content>
<HBox justifyContent="Start" fitContainer="true">
<VBox justifyContent="Center">
<core:Icon />
</VBox>
<VBox justifyContent="Center">
<Label />
<Text />
</VBox>
</HBox>
</content>
</CustomListItem>
</List>
In our team, we replace the VBox and HBox with sap.ui.layout.Grid control. This will allow your layout to be responsive and work in IE9.
https://sapui5.hana.ondemand.com/sdk/explored.html#/sample/sap.ui.layout.sample.GridInfo/preview

How to add style to h:panelGrid

I have a panel grid with two columns and I want to align the right column text in the center and the left column text to the left.
I try to play with it over and over but still it’s not working
<pe:layoutPane position="south" resizable="false" closable="false" statusbar="true" spacing="0">
<h:panelGrid columns="2" styleClass="left,centered" width="100%">
<h:outputText value="DEV"/>
<h:panelGroup>
<h:outputText value="Developed by "/>
<h:outputLink id="link1" value="mailto:to#mm.com" >
<h:outputText value="text" style="text-decoration:underline"/>
</h:outputLink>
</h:panelGroup>
</p:panelGrid>
</pe:layoutPane>
Here is the css:
.centered {
margin: 0px auto;
text-align: center;
}
.left {
float: left;
}
Any idea how could I archive this layout ??
Thanks
you should better use
<h:panelGrid columns="2" columnClasses="left,centered">
...
</h:panelGrid>
greetings!
I found the solution :)
<center>
<h:outputText value="DEV" style="float: left" styleClass="footer"/>
<h:outputText value="xxxxxxx" styleClass="footer"/>
<h:outputLink id="link1" value="mailto:xxxx#xxxx" styleClass="footer">
<h:outputText value="xxx" style="text-decoration:underline" styleClass="footer"/>
</h:outputLink>
</center>

Adding a scrollbar to a firefox extension's sidebar

I'm trying to add a scrollbar to a firefox extension so that it displays when the window is too small.
I'm having issues with having the scrollbar span the entire range from top to bottom of the sidebar and only having it displayed when the window is too small.
One extension that has the functionality I would like is the sage extension, however searching through the CSS and XUL, I'm unable to figure out how it works.
XUL File
<vbox flex="1" id="main" align="center" pack="end" maxwidth="300">
<spacer height="10"/>
<image id="logo" maxwidth="300"/>
<spacer height="20"/>
<vbox id="button" flex="1">
<button id="a-button" label=""/>
<spacer height="20"/>
<listbox id="listbox1" width="300" maxwidth="300" rows="6">
<listhead id="list-header">
<listheader label=""/>
</listhead>
</listbox>
<spacer height="20"/>
</vbox>
<tabbox id="details-box" maxwidth="300">
<tabs id="tabs">
<tab id=a"-label" label="" style="text-align: center;"/>
</tabs>
<tabpanels>
<vbox>
<button id="another-button" label="" />
</vbox>
</tabpanels>
</tabbox>
<spacer height="20"/>
<vbox maxwidth="300">
<description id="message" style="display: none;">
<!-- updated with ajax -->
<html:h1 id="header"/>
<html:p id="body"/>
</description>
</vbox>
<spacer flex="10"/>
</vbox>
<spacer flex="10"/>
</page>
Relevant CSS
/* Main */
{
padding: 0;
margin: 0;
}
#sidebar {
background-color: #fff;
font: 10pt "arial", "sans-serif";
line-height: 11pt;
}
vbox#main {
padding-left: 20px;
padding-right: 20px;
/* min-height: 600px; */
min-width: 330px;
overflow-x: hidden;
overflow-y: auto;
}
How it currently looks
Example Screenshot http://img203.imageshack.us/img203/7209/screenshot20100805at201.png
Desired effect in Sage Extension
Sage Relevant Screenshots http://img193.imageshack.us/img193/9206/sageexample.png
The problem is that vbox#main was not the only child node of . I also had a panel in there which would popup based on some action.
By moving the panel inside of vbox#main, vbox#main would span the entire space of the sidebar.

Resources