I am using zk combo box with template and having 18500 data to load, but when I try to load that much data, I got proxy error 502:: it is taking too much time to load the data. I am using the below code
Can anyone help me out to resolve that issue so that larger data can be loaded without any performance issue?
↧
Combobox issue :Taking time to load
↧
Datebox, set attribute
I only need year and month,How do i set it? calendar show only the year and month
↧
↧
programmatically generate and bind component
So, I want to click on the div which activates maisAutor method and add a new component. But the problem is that I want to bind each textfield with a separated search that I will use in the place of the ??????? at restricoes.add(Restrictions.eq("nuCpf", ???????));Nome | |
@Command
@NotifyChange({"publicacaoAutorList"})
public void maisAutor() {
// publicacaoAutorList.add(new EduPublicacaoAutor(selectedPublicacao));
publicacaoAutorList.add(new EduPublicacaoAutor(selectedLivro));
}
@Command
public void buscaAutor() {
List restricoes = new ArrayList();
EduPessoa pessoa = new EduPessoa();
restricoes.clear();
restricoes.add(Restrictions.eq("nuCpf", ???????));
pessoaList = pessoaListService.getList(restricoes);
if(pessoaList.size() > 0) {
pessoa = pessoaList.get(0);
}
if (pessoa != null) {
EduAutor autor = new EduAutor();
restricoes.clear();
restricoes.add(Restrictions.eq("pessoa", pessoa));
autorList = autorListService.getList(restricoes);
if(autorList.size() >0) {
autor = autorList.get(0);
}
// autorList.add(selectedAutor);
if (autor != null) {
EduPublicacaoAutor publicacaoAutor = new EduPublicacaoAutor();
restricoes.clear();
restricoes.add(Restrictions.eq("autor", autor));
publicacaoAutor.setAutor(autor);
// publicacaoAutor.setIdPublicacao(selectedLivro);
// publicacaoAutorList.add(publicacaoAutor);
Messagebox.show(autor.getLtInstituicao());
}
}
}
↧
custom components attributes autocomplete
Hi, I've been created some custom components and I wanna know if is there a way to create a autocomplete with the custom attributes and how can I do that?
↧
DTD for custom components
I've been created some custom components and DTD, now I wanna apply this DTD on my zul page, how can I do that?
↧
↧
Graphics component still supported in ZK8?
Is the Graphics components still supported in ZK8?
I can't find any reference to other than in old blogs or old version docs
↧
Component definition not found: charts in [LanguageDefinition: xul/html]
Hi, I have this problem:
Component definition not found: charts in [LanguageDefinition: xul/html]
I have to do some extra settings for using the trial version?
I have zkcharts 2.1.1 and zk 8.0.1.1
I don't have use Maven
Thanks
↧
ZK 5.0.11 After setting value on a widget via 'w:onClick', how does one make the widget to send its value to the component, so that it can be used in a composer?
Hello,
I have w:onClick on a button which executes a custom javascript and sets value of a different widget:
i.e. `this.$f('is123').setValue( javascript_computation );`
After the javascript finishes and I inspect the value of 'id123' in a composer, the value is unchanged.
In version 3.6.5, I used `comm.sendEvent`, however that is unavailable in version 5.
Thanks for your help.
↧
Internationalization properties for custom component
hi all
I'm creating a simple custom component and i want define inside this component a labels.properties for i18n. I don't know how achieve this.
I want to write in the zul page of my component, ie mycomponent.zul something like
How can i do this?
My language-addon is
datiDelSinistro xul/html datiDelSinistro com.assimoco.sinistri.componenti.datidelsinistro.zk.DatiDelSinistro div
↧
↧
MouseEvent does not inherit data
I have a custom button component with the following doClick_ in my javascript:
doClick_: function (evt) {
evt.data.enterKeyPressed = this._enterKeyPressed;
this._enterKeyPressed = false;
this.$supers('doClick_', arguments);
},
In the java code of my widget in the service method:
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
final String cmd = request.getCommand();
if (cmd.equals(Events.ON_CLICK)) {
Event evt = Event.getEvent(request);
MouseEvent mevt = MouseEvent.getMouseEvent(request);
The evt variable contains the enterKeyPressed in data, however if I create a MouseEvent the mevt variable has _data of null. It seems the MouseEvent.getMouseEvent(request) strips the data.
Is there a work around for this ? I need to fire a MouseEvent with the data I added on the javascript side.
Thanks.
↧
Composite Component trigger onresize
Hi!
I made one dynamic composite component, which changes his size when I'm interacting with it.
When the page finishes the rendering, the page doesn't require scroll. but after some interactions with my component, the size of my component changes, and the page doesn't detect the new size of the component. How I can make one notification to force the container to readjust the sizes?
In the following image I show one example of this problem:
Waiting one reply,
Thanks,

↧
Access composite components zuml declared inner components
Hi!
I want to develop one component that is one wrapper of the components you place into the zuml tag:
Pratical example:
Now I have my corresponding java class:
public class MyCompositeComponent extends Div {
//How I can access to BOTH COMPONENTS? label and combo?
}
How I can access to all the components that I placed into the composite component?
Waiting one reply,
Regards,
Jaime Vaz
↧
ExcelExporter form Grid only export only first page of data
hallo i am newbie on zk..
i try to export data from grid to excel..
but i have problem..
the problem is only first page,,
any wrong with my code?
this is my code
@Command
public void exportListboxToExcel(@BindingParam("ref") Grid grid) throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ExcelExporter exporter = new ExcelExporter();
Grid newGrid = (Grid) grid.clone();
System.out.println(newGrid.getListModel().getSize()+"size data");
//the data is 20 but only 8 exported.. because only first page exported..
newGrid.setPageSize(10000);
exporter.export(newGrid, out);
AMedia amedia = new AMedia("data.xlsx", "xls", "application/file", out.toByteArray());
Filedownload.save(amedia);
out.close();
}
thanks very much for your help..
↧
↧
Chrome Audio Problem
Hello;
I add audio component in zul
And in Java I add this :
File f = new File("C:\\cartoon001.wav");
AAudio media = new AAudio(f);
audio.setContent(media);
This works in firefox, but does not work in chrome v56..
The controls are greyed..
Can you help me?
ZK Version: 8.0.0, also I tried 7.0.2
Thanks.
↧
Custom Component MVVM, custom properties
Hi, I've created a custom component in ZK8. I'm using data binding just like the MVVM book, but I got this problem: my component has a property like 'customProperty' som
my `zul` is ` `, which is always `null` in `CustomComponent.java`. I need `customProperty` to set some behaviors for my component, but it's not working. Any ideas?
**[Update]**
Sorry, I've been so busy these days.. Well, this is my code
` `
And the java class:
public class Lookupbox extends Bandbox {
private static final long serialVersionUID = 5780997619297491961L;
private Listbox listbox;
private String columns;
@NotifyChange({"listbox", "columns"})
private void init() {
listbox = new Listbox();
Listhead listhead = new Listhead();
if (columns != null) {
String [] column = columns.split(",");
for (String col : column) {
listhead.appendChild(new Listheader(col));
}
}
listbox.appendChild(listhead);
Bandpopup bandpopup = new Bandpopup();
bandpopup.appendChild(listbox);
this.appendChild(bandpopup);
}
public Lookupbox() {
init();
}
public String getZclass() {
return _zclass == null ? "z-lookupbox" : _zclass;
}
public Listbox getListbox() {
return listbox;
}
public String getColumns() {
return columns;
}
@NotifyChange("columns")
public void setColumns(String columns) {
this.columns = columns;
}
}
`columns`property is always `null`. Am I missing some `@NotifyChange()`?
↧
Custom component that extends Textbox does not fire onChange event
I tried to create a very simple custom text by extending existing Textbox component.
The component displayed correctly with bound value. The problem is, when I make change to the input, the browser does not fire onChange event to the server-side. Is this a bug or am I doing something wrong?
This is my code
in lang-addon.xml
>>myzkcomp >>net.bitreplay.Version >1.0-SNAPSHOT >8.0.2.2 > >>xul/html >>>jpatextbox >net.bitreplay.JpaTextbox >textbox > >
in index.zul
>> apply="org.zkoss.bind.BindComposer"> viewModel="@id('vm') @init('test.ctrl.MyVm')">> > >
in MyVm.java
> package test.ctrl;>> public class MyVm {> private String name = "Hooray";>> public String getName() {> return name;> }>> public void setName(String name) {> this.name = name;> }> }
in Version.java
> package net.bitreplay;>> public class Version {> public static final String UID = "1.0-SNAPSHOT";> }
I tried the same thing with Intbox and Combobox. They give me the same problem.
This show the version of ZK I'm using via Gradle build
> compile("org.zkoss.zk:zkbind:8.0.2.2")> compile("org.zkoss.zk:zul:8.0.2.2")> compile("org.zkoss.zk:zuti:8.0.2.2-Eval")> compile("org.zkoss.zk:zkmax:8.0.2.2-Eval")> compile("org.zkoss.zk:zkex:8.0.2.2-Eval")> compile("org.zkoss.zk:zkplus:8.0.2.2")> compile("org.zkoss.zk:zhtml:8.0.2.2")> compile("org.zkoss.zk:zkspring-core:3.2.0")
---- Update ----
Hi chillworld. The system require me to wait for 2 days before I can add answer to my own question so I edit the question to put it.
Sorry, I thought I provided the code for the component already.
This is it
> package net.bitreplay;>> import org.zkoss.zul.Textbox;>> public class JpaTextbox extends Textbox {> }
`binding_annotation_for_a_custom_component` (I have not enough karma to post the link, please google it). I tried adding this annotation to the JpaTextbox class.
> @ComponentAnnotation("value:@ZKBIND(ACCESS=both, SAVE_EVENT=onChange)")
And it works for me. However, it would be very helpful if anyone could kindly explain me why the built-in component "org.zkoss.zul.Textbox" work well without having to have the binding definition in such form of annotation nor in lang.xml (I've looked in the definition of parent classes of Textbox also). Is it just because JpaTextbox is custom so it need different ceremony?
↧
Get Component inner html on server side
Sorry for confusion, I am newbie in ZK...
I create Highchart on my page with wrapper.
Can I get html(svg) contents of this chart on server side, despite it rendered on client by svg engine ?
I need to generate a report on server side, including chart, rendered on client side.
//----------------------This is wrapper class--------------------------//
package org.morphos.zkext.components.highcharts;
import org.morphos.zkext.components.highcharts.events.HChartClickEvent;
import org.morphos.zkext.components.highcharts.events.HChartEvents;
import org.zkoss.zk.au.out.AuInvoke;
import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.impl.XulElement;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* ZK wrapper for HighCharts component.
*/
public class HChart extends XulElement implements IMapConverter {
static {
Util.init();
addClientEvent(HChart.class, HChartEvents.ON_CLICK, CE_IMPORTANT);
}
private static final long serialVersionUID = 1L;
private static final String GLOBAL_SETTINGS = HChart.class.getName() + ".global";
public static class ChartSettings extends Options {
public final ChartOptions chart = new ChartOptions();
public final List colors = new ArrayList();
public final CreditsOptions credits = new CreditsOptions();
public final ExportingOptions exporting = new ExportingOptions();
public final LegendOptions legend = new LegendOptions();
public final LoadingOptions loading = new LoadingOptions();
public final NavigationOptions navigation = new NavigationOptions();
public final PaneOptions pane = new PaneOptions();
public final PlotOptions plotOptions = null;
public final List series = new ArrayList();
public final TitleOptions subtitle = new TitleOptions();
public final TitleOptions title = new TitleOptions();
public final TooltipOptions tooltip = new TooltipOptions();
public final List xAxis = new ArrayList();
public final List yAxis = new ArrayList();
}
public final ChartSettings options = new ChartSettings();
private boolean _running;
public HChart() {
super();
addXAxis();
addYAxis();
setType(PlotType.LINE);
}
public void setDefaultColors(String... colors) {
options.colors.clear();
if (colors != null) {
options.colors.addAll(Arrays.asList(colors));
}
}
public String getType() {
return options.chart.type;
}
public void setType(PlotType type) {
try {
Field field = ChartSettings.class.getField("plotOptions");
field.setAccessible(true);
PlotOptions plotOptions = Util.getPlotType(type.getValue());
plotOptions.type = type.getValue();
field.set(options, plotOptions);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
options.chart.type = type.getValue();
options.series.clear();
}
public Axis getXAxis() {
return options.xAxis.isEmpty() ? null : options.xAxis.get(0);
}
public Axis getYAxis() {
return options.yAxis.isEmpty() ? null : options.yAxis.get(0);
}
public Series addSeries() {
return addSeries(PlotType.valueOf(options.chart.type));
}
public Series addSeries(PlotType type) {
Series series = new Series(type.getValue());
options.series.add(series);
return series;
}
public Axis addXAxis() {
return new Axis(options.xAxis);
}
public Axis addYAxis() {
return new Axis(options.yAxis);
}
public void run() {
init();
invoke("_run", toMap());
_running = true;
}
public boolean isRunning() {
return _running;
}
public void clear() {
_running = false;
options.series.clear();
invoke("_clear", null);
}
public void redraw() {
if (_running) {
invoke("_redraw", null);
} else {
run();
}
}
private void init() {
if (shouldInitialize()) {
invoke("_init", new GlobalSettings().toMap());
}
}
private boolean shouldInitialize() {
Desktop dt = getDesktop();
if (dt != null && !dt.hasAttribute(GLOBAL_SETTINGS)) {
dt.setAttribute(GLOBAL_SETTINGS, true);
return true;
}
return false;
}
@Override
public OptionsMap toMap() {
options.chart.renderTo = getUuid();
return options.toMap();
}
public String getTitle() {
return options.title.text;
}
public void setTitle(String text) {
options.title.text = text;
updateTitle();
}
public String getSubtitle() {
return options.subtitle.text;
}
public void setSubtitle(String text) {
options.subtitle.text = text;
updateTitle();
}
public void export() {
ensureRunning("Exporting");
invokeJS("_export", options.exporting.buttons_exportButton.onclick);
}
public void print() {
ensureRunning("Printing");
invokeJS("_print", options.exporting.buttons_printButton.onclick);
}
private void invokeJS(String func, String js) {
invoke(func, Util.toJS(js));
}
private void invoke(String func, Object arg) {
response(new AuInvoke(this, func, arg));
}
private void updateTitle() {
if (_running) {
OptionsMap map = new OptionsMap();
map.put("title", options.title);
map.put("subtitle", options.subtitle);
invoke("_title", map);
}
}
private void ensureRunning(String operation) {
if (!_running) {
throw new RuntimeException(operation + " requires an active chart.");
}
}
@Override
public String getWidgetClass() {
return "morphosext.Hchart";
}
@Override
public void onPageDetached(Page page) {
_running = false;
super.onPageDetached(page);
}
@Override
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
final String cmd = request.getCommand();
if (cmd.equals(HChartEvents.ON_CLICK)) {
HChartClickEvent event = HChartClickEvent.getHChartClickEvent(request);
//Events.postEvent(HChartEvents.ON_CLICK, this, event);
Events.postEvent(event);
} else
super.service(request, everError);
}
}
↧
↧
How can I add the 'autocomplete' HTML tag to the Textbox component
We would like to give the browser a hint not to save passwords. The recommended way is to the use the autocomplete="off" tag on the input html tag.
Is there a way that one could add / append this option to the html code that is generated by the textbox mold?
Regards
Eddie
↧
MVVM binding for dynamically created Components.
Hi. I have a collection of values of different types, I'm constructing popup dynamically depending on this types. So I've wired parent component, and them I just create components like Textbox, Intbox etc and append them as children in Java.
Is it possible to configure data-bindind with elements of my value collection for brand new components from Java code?
↧
invoke component from different .zul
Hello everyone,
I am trying to execute a Clients.shownotification, which is executed in a component that is in another zul, but it seems that the component did not exist. Both zul are running at the same time and have the same viewModel.
This is my code.
MAIN.ZUL
MENUPANEL.ZUL
TOOLBAR.ZUL
↧