Hi,
I've got a piece of code (JS) that needs to be loaded in my page. Unfortunately, loading this piece of c can take longer and it's preventing the browser from displaying the rest, waiting for the component to load. So I would need something like this:
a) Load the component parallelly, thus not stopping the browser from displaying the page while the component is not yet loaded.
b) Wait for the browser to display the page, then load the component correctly. I tried that with a listener for On_Render events, but it never fired.
What would be a good way to solve that problem?
I already had a look at the LongOperations, but nothing there seems to allow me starting it when a component is shown in the browser - and I don't want to put some arbitrary wait time in there.
Also: Who thought it a good idea to make the comment function not usable for people without x karma? Honestly, copying Stackoverflow seems a really bad idea for a support forum (including paying zk customers) will not have dozens of karma points...
↧
Load component parall in browser
↧
Calling custom component constructor with params from zul
Greetings,
Is there a way to force ZK to call a custom component constructor with parameter instead of always calling the parameterless constructor and setters ?
Let's say I've a customComponent "Cust" that has 2 constructor
private class Cust {
private String label;
public Cust() {
}
public Cust(final String pLabel) {
label = pLabel;
}
public void setLabel(final String pLabel) {
label = pLabel;
}
}
Is there a way for the zul to call the constructor with param instead of the empty constructor and setter when i write the tag like this
↧
↧
Polymorphism and setModel on a custom grid
I'm making a custom grid which overide the default grid.
I want that component to take a custom bean as model.
So I added a custom setModel method which takes the custom bean (which is not a list) as param.
But for some reason the zul always tries to go through the intial setModel and gives me that error :
org.zkoss.zk.ui.UiException: Expects java.util.Set, java.util.List, java.util.Map, Object[], Enum Class, GroupsModel, or ListModel only. class com.myproj.MyCustomBean
So I went with a custom attribut, data.
--------------------------
In setData I'm calling the setModel with a listModelList made from one of the attribut of my custom bean.
Although I've the right number of row created, no data is displayed in them.
I'm guessing the row renderer doesn't take into account the template in my zul.
Is there a way to wire that in java?
↧
upload image file throws java.lang.NullPointerException
ÑÏÖØ: Failed to upload
>>java.lang.NullPointerException>> at org.zkoss.zk.au.http.AuUploader.service(AuUploader.java:110)>> at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:449)>> at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:489)>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
↧
create custom slider with touch event
Have some one a sample for a custom component which reacts on touch events ?
thanks
Stephan
↧
↧
using buttons inside a custom component
Hi Guys,
I'm new to Zk custom component development. I developed my first custom application from here(ben-bai.blogspot.in/2012/08/zk-component-development-tutorial.html).
My requirement is like this. I've created a voice recorder using html5 & zul MVVM. now i want to convert it to a custom component.
This is my zul content
Now i want to convert it to a custom component. But the buttons are html not like zul. so i'm unable to bind the values. Can anyone give me exact steps to achieve creating the above zul as a component?
Also in the js im sending the voice data to VoiceVM using zAu.send().I'd like to achieve that too in my component.Thanks in advance
↧
creating a macro component jar
Hi
Recently i've created a macro component for voice recording. I've placed the files under Macro/Classes/voice.java, Macro/voice.zul,Macro/Script/V_Script.js. Now i want to create a jar for this Marco so that i can just import the jar to my project lib folder and use macro component directly.Is it possible? if yes please explain how
↧
How to Export Timeline Component to PDF??
As I have mentioned above I need a information regarding Export Timeline Component to pdf.
As for as I know only Mesh and Tree Components are possible to Export to pdf. Plz help me regarding this issue.
↧
How to Export Timeline Component to PDF??
As I have mentioned above I need a information regarding Export Timeline Component to pdf.
As for as I know only Mesh and Tree Components are possible to Export to pdf. Plz help me regarding this issue.
Hey Thank you!!!
But my problem is I don't want only String content.I want charts also in PDF.So I am trying to pass complete component to PDF. That is not happening. If I use IText it exports only String content not the charts.Hope you understood my problem.
Thanks again!!!!
↧
↧
Unable to get default printer name while using applet
Hi,
I want to print my file directly from webpage. For that I am using following reference and trying to implement same with ZUL and Composer.
tonny-bruckers.blogspot.in - 2012/11/printing-files-directly-from-web-page.html
ZUL File :-
PrintApplet.class is present inside "WebContent/applet".
public class AppletComposer extends GenericForwardComposer {
private Applet printApplet;
public void doOverrideAfterComposer(Window comp) throws Exception {
}
public void onClick$btnClickMe(Event event) throws Exception {
String Originalstr = "ByteArrayInputStream Example!";
byte[] Originalbytes = Originalstr.getBytes();
ByteArrayInputStream bis=new ByteArrayInputStream(Originalbytes);
printApplet.invoke("print", bis);
}
}
PrintApplet Class :-
public class PrintApplet extends Applet {
public void init()
{
}
public void print(ByteArrayInputStream bis) throws PrintException
{
PrintService service = PrintServiceLookup.lookupDefaultPrintService();
if (service != null) {
DocFlavor psFormat = DocFlavor.INPUT_STREAM.PDF;
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
DocPrintJob job = service.createPrintJob();
Doc pdfDoc = new SimpleDoc(bis,psFormat, null);
job.print(pdfDoc, attributes);
}
}
}
I am able to invoke PrintApplet with this approach but getting Null as service. PrintApplet is working fine with AppletViewer and with normal Java Application but unable to get default printer service while using the above approach.
↧
Getting component value on a zul page
I am trying to get the value of a textbox on a zul page by using some kind of getValue method. I should handle this on the zul page, not on a controller. I need to assign a listbox cell (which is the first cell of the list box below) with a value coming from the textbox.
↧
Strange behaviour of composite component and menupopup
I have one composite component. Its zul is cc.zul
Its corresponding listener is CompositeComp.java
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zk.ui.event.MouseEvent;
import org.zkoss.zk.ui.select.Selectors;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Div;
import org.zkoss.zul.Label;
import org.zkoss.zul.Messagebox;
public class CompositeComp extends Div implements IdSpace {
@Wire
Label lbl;
// Default Constructor.
public CompositeComp(int id) {
Executions.createComponents("cc.zul", this, null);
Selectors.wireComponents(this, this, false);
Selectors.wireEventListeners(this, this);
this.id = id;
lbl.setValue("Hello " + id);
}
public int getCompId() {
return id;
}
//Here is magic happening
@Listen("onClick = menuitem")
public void onSelectMenu(MouseEvent event) {
Messagebox.show(String.valueOf(id));
}
}
I want to show above composite component in my container.zul
Listener Container.java is as follow
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.SelectorComposer;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Div;
public class Container extends SelectorComposer {
@Wire
Div container;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
for (int i = 0; i < 5; i++) {
container.appendChild(new CompositeComp(i));
}
}
}
In listener **Container.java**, I am appending Composite component 5 times. When I right click on any component in screen, and after clicking any menu Messagebox shows value "4" always.
Please help.
↧
Display on resolution 1024x768
hello all,
i have design in notebook with resolution 1366 X 768, and all component showed is ok.
but when i access in computer client with resolution 1024x768, is component not all shown for horizontal design (or not fine shown).
my code like this,
and in zk.xml i add
org.zkoss.zul.tablet.meta.viewport.disabled true
how to i fix it ?
i used zk 7.0.2 CE.
thanks.
↧
↧
Combobox scroll selection into view
How does one cause an item matching typed in characters of a combobox to scroll into view?
Details:
In relation to an earlier question I asked, [AutoCompleteComboBox...](http://forum.zkoss.org/question/85792/autocomplete-combobox-usage-and-requirements/), I am attempting to use a Combobox and ListModelList as follows:
1. The user will type one or more characters into the Combobox.
2. The Combobox will perform what is typically known as type ahead or autocomplete.
3. The matching value will be displayed in the Combobox's textbox.
4. The Combobox's list will scroll to the matching value.
1 thru 3 work fine but 4 does not. That is the Combobox does not scroll to the matching item.
I would expect the scrolling to be on the Combobox but looking at javadocs [ListModelList](http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/ListModelList.html) has a fireSelectionEvent which speaks of the ability to scroll into view. Or rather it speaks of the default which is not to scroll into view and provides no convenient method to change that. I find it odd that scrolling is on the model not the UI element, Combobox.
I have found the static Client.scrollIntoView(Component cmp) which I attempted as
Combobox c = new Combobox();
c.setModel(customers);
c.addEventListener(Events.ON_CHANGING, new EventListener(){
@Override
public void onEvent(InputEvent event) throws Exception {
Clients.scrollIntoView(c.getSelectedItem());
}
});
But that does not work.
Help is appreciated. Thank you
↧
Reload the data into a windows
Hello I reload the data in a window in aprticolare I have a forEach loop hce I view a list of items and I would like to reload the data when the value of an item.
How can I do?
window
id="winDashboard"
apply="it.xxx.xxx.controller.dashboard.DashboardController"
border="normal"
width="95%"
height="95%"
minheight="400"
sclass="sysWin"
mode="overlapped"
contentStyle="overflow:auto"
position="center"
closable="true"
sizable="true"> Matricola : ${each.utente.matricola}
↧
Colorbox Bug?
Hi,
I got a [colorbox](https://www.zkoss.org/javadoc/latest/zk/org/zkoss/zkex/zul/Colorbox.html) and want to track the change of color.
So I read the [Component Reference](https://www.zkoss.org/wiki/ZK_Component_Reference/Input/Colorbox) and it says:
**Supported Events: onChange => Event:** [InputEvent](https://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/InputEvent.html)
So I added an Eventlistener (see example @[ZKFiddle](http://zkfiddle.org/sample/18dpoau/1-colorbox-input-event-bug))
colorbox.addEventListener(Events.ON_CHANGE, new EventListener() {
@Override
public void onEvent(InputEvent event) throws Exception {
System.out.println(event.getPreviousValue() +" => " +event.getValue());
}
});
**java.lang.ClassCastException: org.zkoss.zk.ui.event.Event cannot be cast to org.zkoss.zk.ui.event.InputEvent**
Is this a bug?
↧
Radio and checkbox focus styling
Hi there!
I'm trying to make some styling on radio and checkbox, when they are in focus state.
I tried with css, using the pseudo element before and the selector :focus like this example in zkfiddle.org/sample/114ju54/2-Focus-styling-on-checkbox-and-radio. This solution only works in Google Chrome, and not in Firefox or IE.
How I can archive this feature, working in all browsers?
In my perspective this feedback is very useful for users, when they are filling big forms, and the tab button is used to pass to the next field. ZK team do you consider add this focus feedback in one upcoming release?
Waiting for one reply,
Thanks!
↧
↧
Custom mold for checkbox, how to force reload of cached resources in browser?
Hi everybody,
I've created added a custom mold for the checkbox, to make it render as a toggle switch:
toggle 1.0 xul/html checkbox checkbox toggle mold/checkbox-toggle.js css/checkbox-toggle.css
How can I force the browser to reload the neccessary resource (I think its zk.wpd), without turning off the whole caching of web resources? I always experience a client side error telling me, the mold is not available. Once I press Ctrl-F5, it all works fine - but thats not an option for our users. Any help?
Thanks,
Charles
↧
unable to set style to DecoratingComponent
I have created a HtmlNativeComponent("button"), when I apply style to this component for the first time it works fine, but when I re-try to apply style to it without re-loading page, then the component doesn't remain HtmlNativeComponent component rather it changes to StubComponent and even after getting the object of StubComponent and applying style to it doesn't sets the style to button.
Here is the code for that
ActionMenuGroup menuGroup = (ActionMenuGroup) component;
if (menuGroup != null) {
menuGroup.setGroupStyle(style);
if(menuGroup.getFirstChild() instanceof HtmlNativeComponent){
HtmlNativeComponent child = (HtmlNativeComponent) menuGroup.getFirstChild();
child.setStubonly(false);
child.setDynamicProperty("style", style);
}else if(menuGroup.getFirstChild() instanceof AbstractComponent){
AbstractComponent child = (StubComponent) menuGroup.getFirstChild();
child.setAttribute("style", style);
}
}
Is there any way to do this.
↧
Zk.pwd loading issue giving 502 proxy error
I want to edit the page - When I click on Edit button and new page page will be loaded but it is taking time to load. When I check on developer tools I got the issue that zk.pwd/zk.comet is taking time to load.I am sharing screenshot in which it is mentioned that it is failed to load the resources. What does it mean? why I am getting 502 proxy error in loading edit details.I am not able to figure out the issue

Can you elaborate why I am getting this issue?
↧