Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6075135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:27:37+00:00 2026-05-23T10:27:37+00:00

iam getting very frustating problem when i have to show the value from result

  • 0

iam getting very frustating problem when i have to show the value from result of createNativeQuery in Hibernate,my code is like this:

public List<Rmerchant> getListMerchantbyMasterMerchanttest(){
        List<Rmerchant> lstMerchant=em.createNativeQuery("select merchant_name,merchant_email,merchant_status from rmerchant where master_merchant_id=123")

                .getResultList();
        return lstMerchant;
    }

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:

<?xml version="1.0" encoding="UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./test"?>
<?init class="com.nsia.doku.escrow.controller.testController"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
    <window id="test" xmlns:n="native" title="test" border="normal" position="center" apply="com.nsia.doku.escrow.controller.testController">
        <listbox  model="@{test$composer.lstMerchant}"
                vflex="true">
                <auxhead>
                    <auxheader colspan="3" class="topic">EDS Status</auxheader>
                </auxhead>
                <listhead>
                    <listheader label="Merchant Name"  align="center"/>
                    <listheader label="merchant email" align="center" />
                    <listheader label="merchant status"  align="center" />

                </listhead>
                <listitem self="@{each=lstMerchant}">
                    <listcell label='@[lstMerchant}' />
                    <listcell label='@{lstMerchant}' />
                    <listcell label='@{lstMerchant}' />
                </listitem>
            </listbox>

    </window>

</zk>

if the value is like what i write,the listcell will be like this:

merchant name                                  merchant email                                
[merch001, jhjhjh, null]                       [merch001, jhjhjh, null]                      
[fahmi0090908789788, fahmi@gmail.com, null]    [fahmi0090908789788, fahmi@gmail.com, null] 

if the code i change in listitem like this:

<listitem self="@{each=lstMerchant}">
                    <listcell label='@[lstMerchant[0]}' />
                    <listcell label='@{lstMerchant[1]}' />
                    <listcell label='@{lstMerchant[2]}' />
                </listitem>

                or 
<listitem self="@{each=lstMerchant}">
                    <listcell label='@[lstMerchant["0"]}' />
                    <listcell label='@{lstMerchant["1"]}' />
                    <listcell label='@{lstMerchant["2"]}' />
                </listitem>

                or 
                <listitem self="@{each=lstMerchant}">
                    <listcell label='@[lstMerchant["merchant_name"]}' />
                    <listcell label='@{lstMerchant["merchant_email"]}' />
                    <listcell label='@{lstMerchant["merchant_status"]}' />
                </listitem>

                or

                every lstMerchant i change with each

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?

i used to create web using icefaces,if in icefaces,i just have to place this tag in cell:

currentRow[0] but in Zk,i havent found it..

im sorry for my bad english and this newbie question..thanks..:D

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:27:38+00:00Added an answer on May 23, 2026 at 10:27 am

    ok as i promise,the thing only i have to do is implements ListitemRenderer,and add the code like this to method render:

    public void render(Listitem li, Object data) throws Exception {
            Object[] obj=(Object[]) data;
            new Listcell((String) obj[16]).setParent(li);
            new Listcell((String) obj[17]).setParent(li);
            new Listcell((String) obj[22]).setParent(li);
            new Listcell((String) obj[0]).setParent(li);
            new Listcell((String) obj[1]).setParent(li);
            new Listcell((String) obj[2]).setParent(li);
            new Listcell((String) obj[3]).setParent(li);
            new Listcell((String) obj[18]).setParent(li);
            new Listcell((String) obj[19]).setParent(li);
            new Listcell((String) obj[20]).setParent(li);
            new Listcell((String) obj[21]).setParent(li);
            new Listcell((String) obj[4]).setParent(li);
            new Listcell((String) obj[5]).setParent(li);
            new Listcell((String) obj[6]).setParent(li);
            new Listcell((String) obj[7]).setParent(li);
            new Listcell((String) obj[8]).setParent(li);
            new Listcell((String) obj[10]).setParent(li);
            new Listcell((String) obj[15]).setParent(li);
            new Listcell((String) obj[12]).setParent(li);
            new Listcell((String) obj[13]).setParent(li);
            new Listcell((String) obj[14]).setParent(li);
            new Listcell((String) obj[23]).setParent(li);
            new Listcell((String) obj[24]).setParent(li);
            new Listcell((String) obj[25]).setParent(li);
    
    
        }
    

    the index is based on your column in your nativequery..

    and in .zul page you only have to do this:

    <listbox  model="@{dokureport$composer.lstTrans}"
                    vflex="true" itemRenderer="@{dokureport$composer.itemRenderer}">
    

    itemRenderer tag add default value itemRenderer and the model is list based on your controller..thanks for all of your response and sorry for my bad english..thanks..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a string hash like this: string content = a very long
I am getting this error but only very occasionally. 99.9% of the time it
I am getting very frustrated because I cannot seem to figure out why Collections
I am getting a very non specific error when trying to connect to SQL
I am getting this error now that I hit version number 1.256.0: Error 4
I am getting this error when trying to run internet information services on a
I am getting a JSONException complaining about a very deep nesting (more than 30).
I haven't been able to find a very good way of getting 10 random
I am getting this exception when I attempt to access an object that is
I am getting this error when I try to query the database and write

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.