0

Show title in borderlayout North

asked 2017-06-10 07:51:15 +0800

onsir gravatar image onsir
132 2

updated 2017-06-14 03:05:43 +0800

cor3000 gravatar image cor3000
6280 2 7

hello,

how to shown text in north title borderlayout, while is split ? Example I want to display the customer code.

i have code like this, but it did not work. this my code :

    <?xml version="1.0" encoding="UTF-8"?>
    <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" root="./win" ?>
    <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
    <zk xmlns="http://www.zkoss.org/2005/zul"
    xmlns:h="http://www.w3.org/1999/xhtml"
    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">

    <style>
    </style> 

    <script>
      <![CDATA[
         jq("@west,@north,@east,@south").each(function(){
        var zLayout = zk.Widget.$(this);
        if(zLayout.$n("cap")!=null){
           var word = jq(zLayout.$n("cap")).text();
           zLayout.$n("colled").title = word ;
        }
    });
    ]]></script>

<window id="win" hflex="true"  border="normal" sizable="true" 
        maximizable="true" apply="${PLANController}">
    <tabbox id="tb" height="800px" >
      <tabs id="tabs">
        <tab/>
    </tabs>
    <tabpanels>
       <tabpanel >
         <panel framable="false" height="760px">
         <panelchildren>
         <borderlayout>
           <west size="100%" border="0" splittable="true">
              <grid height="750px">
                 <columns><column label=""/></columns>
                 <rows>
                    <row>
                       <borderlayout height="740px">
                          <north id="@north" title="Profile" maxsize="250" size="30%" 
                                 splittable="true" collapsible="true" >
                            <grid>
                               <columns> <column width="100px" /><column/> </columns>
                               <rows>
                                 <row>
                                     <div align="left">
                                        <label value="Customer code"/>
                                     </div>
                                     <hbox>
                                        <textbox id="txtCustCode"  cols="5"  />
                                        <textbox id="txtCustName"  cols="40" />
                                     </hbox>
                                  </row>
                               </rows>
                              </grid>
                           </north>
                           <center border="0">
                           </center>
                         </borderlayout>
                    </row>
                   </rows>
                  </grid>
               </west>
             </borderlayout>
           </panelchildren>
         </panel>
       </tabpanel>
     </tabpanels>
    </tabbox>
  </window>
</zk>

Thank you very much.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-06-14 03:39:50 +0800

cor3000 gravatar image cor3000
6280 2 7

Unfortunately your code example mixes many things and your attempts show that you clearly don't understand the script you are trying to integrate.

So I cleaned up your layout in order to concentrate on what's relevant and also simplified script to apply the title to the "colled" region.

Here the example showing this in action: http://zkfiddle.org/sample/fr08p/1-set-collapsed-title-to-layout-region

Using this approach you can decide which north/south layout region should be affected. Whenever you apply the w:onBind listener the script will execute for only that widget and apply the title.

Robert

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
2 followers

RSS

Stats

Asked: 2017-06-10 07:51:15 +0800

Seen: 21 times

Last updated: Jun 14 '17

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