0

How to get value from fckeditor?

asked 2015-08-27 03:45:21 +0800

stanley1991 gravatar image stanley1991 flag of China
11 2
https://www.facebook.com/...

updated 2015-09-01 01:16:52 +0800

Hello guys,I use fckeditor in ZUL just as following:


<?xml version="1.0" encoding="UTF-8"?>
<window apply="org.zkoss.bind.BindComposer"
xmlns="http://www.zkoss.org/2005/zul"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd" 
viewModel="@id('win') @init('org.zkforge.petshop.controller.SellerModel')">

<include src="banner.zul" height="20%"/>
<div align="center">
    <div id="pane1" width="650px" align="left" visible="@bind(win.flagShowPanel)">
        <grid>
            <columns>
                <column width="250px"/>
                <column/>
            </columns>
            <rows>
                <row spans="2"><div align="center"><label style="font-weight:bold;" value="宠物信息"/></div></row>
                <row>目录:
                    <listbox mold="select" rows="1" model="@bind(win.products)" selectedItem="@bind(win.product)" emptyMessage="No product found!">
                        <template name="model">
                            <listitem>
                                <listcell label="@bind(each.name)"></listcell>
                            </listitem>
                        </template>
                    </listbox>
                </row>
                <row>*宠物昵称: 
                    <textbox id="petName" value="@bind(win.item.name)"/>
                </row>
                <row>*简述(最多3行):
                        <fckeditor id="desc" customConfigurationsPath="/seller.js" 
                        toolbarSet="seller" height="100px" value="@bind(win.item.description)"/>
                </row>
                <row>*价格(RMB): 
                    <decimalbox id="price" format="##,##0.00" value="@bind(win.item.price)"/>
                </row>
                <row>
                    <hbox>*宠物图片: 
                        <button id="imageBtn" label="上传" onUpload="@command('upload',upevent=event)" upload="true"/>
                    </hbox>
                    <image id="picture" width="100px" height="77px" onClick="@command('showImage')" style="cursor:pointer" content="@bind(win.picture)"/>
                </row>
            </rows>
        </grid>
        <label style="font-size:xx-small" value="Required fields are designated by a *"/>
        <div align="right">
            <button label="Next >>" onClick="@command('next')"/>
        </div>
    </div>

    <div id="pane2" width="650px" align="left" visible="@bind(!win.flagShowPanel)">
        <grid>
            <columns>
                <column width="250px"/>
                <column/>
            </columns>
            <rows>
                <row spans="2"><div align="center"><label style="font-weight:bold;" value="Information about yourself"/></div></row>
                <row>*名字:   
                    <textbox id="firstName" value="@save(win.item.contactInfo.firstName)"/>
                </row>
                <row>*姓氏: 
                    <textbox id="lastName" value="@save(win.item.contactInfo.lastName)"/>
                </row>
                <row>E-Mail: 
                    <textbox id="email" value="@save(win.item.contactInfo.email)"/>
                </row>
                <row>*街道: 
                    <textbox id="street" cols="50" value="@save(win.item.address.street1)"/>
                </row>
                <row>*城市: 
                    <textbox id="city" value="@save(win.item.address.city)"/>
                </row>
                <row>*省份: 
                    <textbox id="state" value="@save(win.item.address.state)"/>
                </row>
                <row>
                    <vbox>
                    请输入验证码(区分大小写)
                    <captcha id="captcha" length="4" noise="true"/>
                    </vbox>
                    <vbox>
                    <textbox id="verify" maxlength="4" value="@bind(win.verify)" />
                    <button onClick="captcha.randomValue()" label="点击刷新"/>
                    </vbox>
                </row>
            </rows>
        </grid>
        <label style="font-size:xx-small" value="标记  *  元素必填。"/>
        <div align="right">
            <button label="<< Previous" onClick="@command('prev')"/>
            <button label="Submit" onClick="@command('submit')"/>
        </div>
    </div>
</div>
</window>
delete flag offensive retag edit

Comments

Where comes the win from? Is this a reference or your viewmodel?

chillworld ( 2015-08-27 06:33:50 +0800 )edit

I bind the value of zul and model with annotations in MVVM pattern.The 'win' is the id of current page just like this : viewModel="@id('win') @init('org.zkforge.petshop.controller.SellerModel')

stanley1991 ( 2015-08-27 06:53:10 +0800 )edit

possible to edit your question and put the whole zul there?

chillworld ( 2015-08-27 09:16:06 +0800 )edit

Dear chillworld,I often see you in this community. As a newcomer of ZK framework,I need to learn much for job. Do you have facebook or anyother social communication account? If possible,I want to make a friend with you so that we can discuss ZK problems more often and improve my poor English. ^-^

stanley1991 ( 2015-08-27 09:57:08 +0800 )edit

see mine profile :)

chillworld ( 2015-08-27 11:15:14 +0800 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2015-08-28 06:08:53 +0800

cor3000 gravatar image cor3000
4571 2 7
ZK Team

updated 2015-08-28 06:09:24 +0800

just to add a solution from the otherwise initially hidden comments:

using the latest version 4.4.6.2 helped

the latest versions are available

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-08-27 03:45:21 +0800

Seen: 47 times

Last updated: Sep 01 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More