Dear All,
please help, I get a problem where I need to add color to a specific area at coordinates.
actually my question is similar to this question [http://forum.zkoss.org/question/81041/question-with-imagemap-and-zk/](http://forum.zkoss.org/question/81041/question-with-imagemap-and-zk/)
but because there is not some response, so I write again here. Sample of what I mean like this [http://www.jqueryscript.net/demo/Simple-jQuery-Plugin-For-Highlighting-Image-Map-Maphilight/docs/demo_usa.html](http://www.jqueryscript.net/demo/Simple-jQuery-Plugin-For-Highlighting-Image-Map-Maphilight/docs/demo_usa.html)
> **I make in ZK like this:** > **Java Code :**
public class MapLight extends GenericForwardComposer {
public void doAfterCompose(Component comp) throws Exception {
Clients.evalJavaScript("$("+siteMap.getUuid()+").maphilight();");
}
}
**source :**
jquery.min.js ==> download [here](https://drive.google.com/folderview?id=0BzG5dK4bhHYEfmhQNFI0SW1MS2FPdlQzZnBRUkxVYjM0aUJJRWRGYURCbkFXNkpNbF9OU2M&usp=sharing)
jquery.maphilight.min.js ==> download [here](https://drive.google.com/folderview?id=0BzG5dK4bhHYEfmhQNFI0SW1MS2FPdlQzZnBRUkxVYjM0aUJJRWRGYURCbkFXNkpNbF9OU2M&usp=sharing)
thank you,
tn harisman
↧
[ask] adding imagemap component with color area
↧
Static resources in Component Jar
I have created a maven project of custom components, this jar is included as a dependancy in my ZK Web project.
I am trying to include static CSS for the project (for components with no javascript) as per the brief outline on this page:
http://books.zkoss.org/wiki/ZK_Component_Development_Essentials/Packing_as_a_Jar
How does zk know to include the CSS generated when the project is included in a ZK WEB project ? Currently my resources directory of my component project looks like this:
web
foo
bar
css
zk.wcs
macro.css.dsp
other.css.dsp
less
macro.less
other.less
My zk.wcs :
My styles in macro.css.dsp are not applied when using the component project in my web zk project however...
↧
↧
Control the jasperreport component
Hi,
It was a while since I wrote here... many things changed since then and ZK continues to be a outstanding product.
Well, my question : is there a way to control which buttons and options are shown in the jasperreport component while the pdf is shown on screen. For example, turn off the Save option, etc
Best Regards,
Yamil
↧
Id attribute set in zul code doesn't reflect in html code?
I have to make my code as per ADA(Americans disability act) specifications:
one of the specification is :-
Use label elements to associate text labels with form controls.
Provide a description for groups of form controls using fieldset and legend elements.
Use the title attribute to identify form controls when the label element cannot be used.
Ensure that all id values are unique on a web page.
In simple words i have to associate my label element with my input element,
for this I have to add a "`for="input_ element_ id`"" attribute in my label.
But my problems is that zk generates its own id in html code and doesn't use the id specified in the zul code:
below is the zul code for a textbox:-
and here is the HTML code generated for the same:-
here `id="t_19"` but in zul code i had specified `id="password"`,so I can't use `for="id"` in label.
any one help on this?
↧
How do package dependencies work
I have a setup a maven project for my custom zk components, these are organised into packages each with a zk.wpd file. Just after some clarification on how the package depends keyword works in the zk.wpd file:
1. if you list a package in the depends statement, does it pickup its dependencies. For example if foo.bar.base listed zul as a dependency does that mean I don't list it above.
2. Do packages include child packages ? So if I list zul as a depends, dows that include its children eg. zul.wgt etc.
Thanks for your help.
↧
↧
Style customization for div on ZK 7
I am trying to customize following zul
Test
The mo_header is defined in style.css
.mo_header {
font-family: "Times New Roman";
font-size: 30px;
font-weight: bold;
}
this customize is not being take effected. as the div is output as
Test
My question is how to customize this div tag.
thank you inadvance for your help!
Wilson
↧
ZK 3.0.3 Multiple File Upload
The Application we use has an old version of ZK, 3.0.3 to be specific. We have a requirement wherein we have to select multiple files(1000 files to be exact) in a folder and upload it to the server. With the current version which we are using multiple file selection is not allowed. Is there any way we can do achieve this may be Javascript. I know I can implement an Applet but it creates lot of security issues. Is there any way I can select the folder rather than a file using Browse and in the background will iterate and upload all the files once I get the path to the folder. There is no option of upgrading Zk to ZK6+ in near future.
Any ideas will be helpful.
↧
Navbar(navitem) onClick not working on Tablet
There was a fix for this in 7.0.1, but it is not working for me in 7.02 or 7.03.
Anyone else having this issue ?
↧
Are yearbox and monthbox include zk core (zul tag)
Good morning zk society,
this my humble question :
Are yearbox and monthbox include zk core (zul tag) ?
if the answer == No, I will ask again, why that
thank all.
↧
↧
Refreshing Image with setContent
Hi, I have a Java generated Window with a toolbar and a org.zkoss.zul.Image displayed.
When a button is pressed I load a new picture from server and when I set the content (setContent(AImage) method) the image is refreshed once and not again. I am using the same picture to make it work.
I read the topic "forum.zkoss.org/question/7496/refreshing-image-in-zk/" but I need to use setContent and not setSrc. But maybe my picture is cached by the browser too.
Can you help me to find a solution or a "work around" ?
Here is what I do :
myButton.addEventListener(Events.ON_CLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
myPicture= myService.recupPhotoById("11303");
myWindow.setTitle(myPicture.getTitle());
AImage img = ImageUtils.convertEncodeStringToImage(myPicture.getPhoto());
((Image) divImg.getFirstChild()).invalidate();
((Image) divImg.getFirstChild()).setContent(img);
}
Thank you
↧
after dragging error message bubble i got exception (You cannot access components belong to other desktop)
hi ,
i am facing a problem . i have a zul page with input fields with validation .when i hit save without entering in fields it show error message to belongs to each input-Field
.But some time intentionally i drag the error bubble to my navigation
panel which is in another zul file (Parent zul(without any VM just native code for navigation) file which include other zuls) then press cancel instead of save .when again i try to access same page it show error message ( You cannot access components belong to other desktop ) . I have bind page with MVVM config . (Or any One can help me by giving idea how to make error Messagebox (z-errorbox) not dragable)
----------
***Error Track given Below***
org.zkoss.zk.ui.UiException: You cannot access components belong to other desktop
at org.zkoss.zk.ui.AbstractComponent.checkDetach(AbstractComponent.java:411) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.AbstractComponent.checkParentChild(AbstractComponent.java:1075) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.AbstractComponent.setParent(AbstractComponent.java:968) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.AbstractComponent.removeChild(AbstractComponent.java:1305) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.AbstractComponent$ChildIter.remove(AbstractComponent.java:2926) ~[zk-7.0.0.jar:7.0.0]
at java.util.AbstractList.removeRange(AbstractList.java:571) ~[na:1.8.0_05]
at java.util.AbstractList.clear(AbstractList.java:234) ~[na:1.8.0_05]
at org.zkoss.zul.Combobox.syncModel(Combobox.java:318) ~[zul-7.0.0.jar:7.0.0]
at org.zkoss.zul.Combobox.onInitRender(Combobox.java:351) ~[zul-7.0.0.jar:7.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05]
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2730) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2658) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1765) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1550) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1260) ~[zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:603) [zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:485) [zk-7.0.0.jar:7.0.0]
at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:494) [zk-7.0.0.jar:7.0.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) [servlet-api.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119) [spring-orm-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) [spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) [spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) [spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) [spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) [spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.57]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [catalina.jar:7.0.57]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) [catalina.jar:7.0.57]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.57]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [catalina.jar:7.0.57]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.57]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) [catalina.jar:7.0.57]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) [tomcat-coyote.jar:7.0.57]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) [tomcat-coyote.jar:7.0.57]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [tomcat-coyote.jar:7.0.57]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_05]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.57]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
↧
ZK Lifecycle : doAfterAllComponentsComposed ?
Hi,
is there a method I can override to get a "doAfterAllComponentsComposed" functionality? At the moment, I am trying to create a highly flexible application (where I can't even rely on the structure, as it might change for some cases) which requires to exchange some includes based on GET-Parameters, etc.
The basic idea is to first create the page (using includes atm) based on GET-Parameters, etc. and then apply the composers to initialize the whole interactivity. But at the moment, these two things seem to bring some problems together...
I first tried to replace components in the doAfterCompose method, but this leads to the problem that Component a gets composed, Component b adds a forward to a and then a gets replaced with a_2 - but b's forward still points at a.
So I next tried to replace the src attribute of include tags in the doBeforeCompose method, which at least prevents the creation of a completely, but also here, the doAfterCompose of some composers is called before some other composers even reach doBeforeCompose, leading to the problem that they try to access a component that doesn't event exist yet.
So, is there a method I can call to do my initialization and be sure that all components on the tree have already been composed? Of course I could, for example, send an event from the root component and listen for that in all composers to do the initialization, but somehow that smells wrong.
Does anyone have a good and clean way to do something like this?
Regards,
Flo
↧
How to create a component that wraps multiple other components?
I'm looking for advice on which direction I should go with this. I suspect that making a ZK component will be the best choice but I don't initially see how to make that all happen.
Scenario:
I'd like to find a way to refer to a date range component that acts in this manner:
- Holds a pair of <datebox> fields (From and To) that would allow for range values that don't overlap with each other.
- This component could be added to a page multiple times. (i.e. Tenant1 move-in date range; Tenant2 move-in date range; etc)
My initial guess would be that I can make a <daterange> component and define it in the lang-addon.xml file as simply a wrapper around two <datebox> components. As I look at that file, however, it looks like I will need to do more javascript coding than what I first thought. Am I going in the right direction with this?
Thanks in advance.
↧
↧
onClick and OnDoubleClick in a single Component
How i can use onClickEvent and onDoubleClickEvent at the same time in a Window??
↧
Listening to XHTML Component onClick Event
Hi,from this example Im Trying to Listen onClick event from XHTML component insidel zul file .but I always getting an error.
@command('fromHtml');'' Token Parsing Error: Lexical error at line 22, column 2. Encountered: "c" (99), after : "@":
here my .zul
and here my Java VM class :
public class PractiveVM{
@command
public void addItem(){
System.out.println("From XHTML components");
}
}
any suggestion ?
Regards,
Klepon
↧
Is there any way to get the Caret position from Input Elements ?
Hello Everyone,
I want to get the Caret position of the data inputed in the Input Elements (XulElements or Components).
Is there any way to get the Caret position from the data inputed ?
I want to manipulate data on KeyEvent So if there is any way Please do let me know.
Thank you.
↧
ZK, AngularJS and Pure HTML Template
Just want to share my personal research, I've tried to create ZK Components with AngularJS (and just a rough POC), use .html file as component template, should be easier to maintain/customize dom elements and style of a component.
[Online Demo](http://screencast.com/t/nlLsNdbV8A)
[Full Project (with ZK 7.0.1)](https://github.com/benbai123/ZK_Practice/tree/master/Integrate/AngularJS/CreateComponentWithAngular)
and
[My Blogspot Post](http://ben-bai.blogspot.tw/2014/04/zk-angularjs-and-pure-html-template.html)
↧
↧
Change component style more efficient
Hi people,
I need to create a very complex window, with a lots of labels, textboxes and buttons filled with data from a database.
Also each of these components must have a different style (background, foreground, font, border etc.) depending on the
data when loading. So far so good! My problem is to change a single style property without deconstructing and reconstructing
the style-string again. May be a textbox style is:
_textBox.setStyle("background-color:#123456;font-family:open sans light;font-size:123;color:#654321");
If I want to change the font-size for example, I could split the string at ";", check for "startsWith("font-family"),
split again at ":" and so on. After all I have to construct the style string again and set the property. Well, I could store
style-strings parallel in a hashmap, but when changing a single style has to take effect on multiple components, there is a lot of checking,
looping, hashing etc. Also I'm afraid to blow up the performance and memory budget!
Is there a more efficient way to change a single style of a component? Direct access to the CSS-parser or a helper Class?
↧
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
↧
New component not rendering properly
Hello,
I am new to ZK Framework and I am trying to create my own Component/Widget. I have followed ZK_Component_Development_Essentials documentation and have created a component and have been unable to answer the following questions:
1) Is the mold output simple html or zul components?
Considering the output, I say that it's pure html.
2) Why does the server render an older version of the component, even though I changed the mold completely? (Note: it doesn't always happen)
As an example: I was rendering a piece of text followed by a red div of 50px by 50px, then changed to borderlayout and it was rendering the old version.
3) Why doesn't it render my component properly?
Instead of a borderlayout with the name on top and the other 2 attributes in the east and west corner, i get the first two attributes on the first line, with no spacing between them and the last one on the second one.
Note: As this is my first post ever, I do not know and could not find a way to post the mold and zul as they are (that's why i added the \ - they were not visible ). If anyone knows how, please do share how.
Here is the code:
Java class:
public class Model extends XulElement {
private static final long serialVersionUID = 1L;
private String name;
private String aid;
private String job;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAid() {
return aid;
}
public void setAid(String aid) {
this.aid = aid;
}
public String getJob() {
return job;
}
public void setJob(String job) {
this.job = job;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException {
super.renderProperties(renderer);
render(renderer, "name", name);
render(renderer, "aid", aid);
render(renderer, "job", job);
}
}
The JavaScript class:
zk.$package('example.model');
example.model.Model = zk.$extends(zk.Widget, {
name: '',
aid: '',
job: '',
getName: function(){
return this.name;
},
setName: function(newName){
if(this.name!=newName){
this.name=newName;
if(this.desktop){
this.$n().innerHTML = zUtl.encodeXML(name);
}
}
},
getAid: function(){
return this.aid;
},
setAid: function(newAid){
if(this.aid!=newAid){
this.aid=newAid;
if(this.desktop){
this.$n().innerHTML = zUtl.encodeXML(aid);
}
}
},
getJob: function(){
return this.job;
},
setJob: function(newJob){
if(this.job!=newJob){
this.job=newJob;
if(this.desktop){
this.$n().innerHTML = zUtl.encodeXML(job);
}
}
}
});
The mold:
function(out){
out.push('<\div',this.domAttrs_(),' width="300px" height="100px"',
'<\borderlayout width="100%" height="100%">',
'<\north height="50%">',
this.getName(),
'<\/north>',
'<\east width="50%">',
this.getAid(),
'<\/east>',
'<\center>',
'<\west width="50%">',
this.getJob(),
'<\/west>',
'<\south>',
'<\/borderlayout>',
'<\/div>'
);
}
The zul page:
<\window title="Hello World!!" border="normal" width="200px"><\modelexample name="Stan" aid="Tae-kwon-do" job="Dancer"><\/modelexample ><\/window>
↧