Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to Show the value in listbox where the value is from createNativeQuery Result on ZK?
    text
    copied!<p>iam getting very frustating problem when i have to show the value from result of createNativeQuery in Hibernate,my code is like this:</p> <pre><code>public List&lt;Rmerchant&gt; getListMerchantbyMasterMerchanttest(){ List&lt;Rmerchant&gt; lstMerchant=em.createNativeQuery("select merchant_name,merchant_email,merchant_status from rmerchant where master_merchant_id=123") .getResultList(); return lstMerchant; } </code></pre> <p>this is the simpe query because in advance i have to create more complex query like using count,and many function in query,and my code in ZK zul page like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./test"?&gt; &lt;?init class="com.nsia.doku.escrow.controller.testController"?&gt; &lt;zk xmlns="http://www.zkoss.org/2005/zul"&gt; &lt;window id="test" xmlns:n="native" title="test" border="normal" position="center" apply="com.nsia.doku.escrow.controller.testController"&gt; &lt;listbox model="@{test$composer.lstMerchant}" vflex="true"&gt; &lt;auxhead&gt; &lt;auxheader colspan="3" class="topic"&gt;EDS Status&lt;/auxheader&gt; &lt;/auxhead&gt; &lt;listhead&gt; &lt;listheader label="Merchant Name" align="center"/&gt; &lt;listheader label="merchant email" align="center" /&gt; &lt;listheader label="merchant status" align="center" /&gt; &lt;/listhead&gt; &lt;listitem self="@{each=lstMerchant}"&gt; &lt;listcell label='@[lstMerchant}' /&gt; &lt;listcell label='@{lstMerchant}' /&gt; &lt;listcell label='@{lstMerchant}' /&gt; &lt;/listitem&gt; &lt;/listbox&gt; &lt;/window&gt; &lt;/zk&gt; </code></pre> <p>if the value is like what i write,the listcell will be like this:</p> <pre><code>merchant name merchant email [merch001, jhjhjh, null] [merch001, jhjhjh, null] [fahmi0090908789788, fahmi@gmail.com, null] [fahmi0090908789788, fahmi@gmail.com, null] </code></pre> <p>if the code i change in listitem like this:</p> <pre><code>&lt;listitem self="@{each=lstMerchant}"&gt; &lt;listcell label='@[lstMerchant[0]}' /&gt; &lt;listcell label='@{lstMerchant[1]}' /&gt; &lt;listcell label='@{lstMerchant[2]}' /&gt; &lt;/listitem&gt; or &lt;listitem self="@{each=lstMerchant}"&gt; &lt;listcell label='@[lstMerchant["0"]}' /&gt; &lt;listcell label='@{lstMerchant["1"]}' /&gt; &lt;listcell label='@{lstMerchant["2"]}' /&gt; &lt;/listitem&gt; or &lt;listitem self="@{each=lstMerchant}"&gt; &lt;listcell label='@[lstMerchant["merchant_name"]}' /&gt; &lt;listcell label='@{lstMerchant["merchant_email"]}' /&gt; &lt;listcell label='@{lstMerchant["merchant_status"]}' /&gt; &lt;/listitem&gt; or every lstMerchant i change with each </code></pre> <p>is not working,aka the listitem show to row but the value is null,,iam so confuse about this problem,maybe somebody can help me?</p> <p>i used to create web using icefaces,if in icefaces,i just have to place this tag in cell:</p> <p><code>currentRow[0]</code> but in Zk,i havent found it..</p> <p>im sorry for my bad english and this newbie question..thanks..:D</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload