0

Listheader onClick event result's in change of listheader image assigned.

asked 2011-03-14 01:38:51 +0800

yaryan997 gravatar image yaryan997
210 2

Hello ZK team members .. I am developing one application in that I am displaying my all records in Listbox using itemrenderer. now when I am doing sorting i am having on problem.. Actually Initially when the list is to be loaded it shows me all record with the specified order by value that's ok.

When LIstbox load it runs the Desc order by query. something like this.

Hibernate: select eo.me_id as clg_seller_id, eo.me_seller_name, (select count(distinct eo1.offer_id) from ecc_offer eo1 where eo1.me_id = eo.me_id and eo1.me_seller_name = eo.me_seller_name) as auctions, (select sum(case when end_date>sysdate then 1 else 0 end) from ecc_offer eo1 where eo1.me_id = eo.me_id and eo1.me_seller_name = eo.me_seller_name) as active_auctions,  (select sum(eo2.sold) from ecc_offer eo2 where eo2.me_id = eo.me_id and eo2.me_seller_name = eo.me_seller_name) as sold, sum(case when (va.answer = 1 or va.answer = 3) and (v.code_check_result = 1 or v.code_check_result = 2) then 1 else 0 end) as auth_ok, sum(case when (va.answer = 1 or va.answer = 3) and v.code_check_result = 3 then 1 else 0 end) as auth_ko, sum(case when(va.answer = 2 or v.interrogation_type = 3 or v.interrogation_type = 4) and (v.code_check_result = 1 or v.code_check_result = 2) then 1 else 0 end) as info_ok, sum(case when (va.answer = 2 or v.interrogation_type = 3 or v.interrogation_type = 4) and v.code_check_result = 3 then 1 else 0 end) as info_ko, sum(case when v.serial_number is null and v.interrogation_type is null and v.verification_id is not null then 1 else 0 end) as invalid,  decode (sum(case when (va.answer = '1' or va.answer = '3') and v.code_check_result>0 then 1 else 0 end),0,0,round(((sum(case when v.code_check_result = 3 and (va.answer = '1' or va.answer = '3') then 1 else 0 end) + (sum(case when v.serial_number is null and v.interrogation_type = 0 then 1 else 0 end)))  / sum(case when (va.answer = '1' or va.answer = '3') and v.code_check_result>0 then 1 else 0 end))*100)) as auth_fakes, sum(case when v.interrogation_type = 1 or v.interrogation_type = 2 then 1 else 0 end) as pre_auth from ecc_offer eo left join verification v on eo.me_id = v.me_id and eo.offer_id = v.offer_id left join verification_answer va on v.verification_id = va.verification_id and question_id = 1 left join verification_code_details vcd on vcd.serial_number = v.serial_number  and v.service_id in(10,14,15,16,17,21,22,23,26) and eo.me_id = 2 group by eo.me_id, eo.me_seller_name having count(v.verification_id) > 0  Order by  2 desc 

when it runs listbox listheader should show me the down.gif image on its header. and When user clicks on the listheader it executes the below query

Hibernate: select eo.me_id as clg_seller_id, eo.me_seller_name, (select count(distinct eo1.offer_id) from ecc_offer eo1 where eo1.me_id = eo.me_id and eo1.me_seller_name = eo.me_seller_name) as auctions, (select sum(case when end_date>sysdate then 1 else 0 end) from ecc_offer eo1 where eo1.me_id = eo.me_id and eo1.me_seller_name = eo.me_seller_name) as active_auctions,  (select sum(eo2.sold) from ecc_offer eo2 where eo2.me_id = eo.me_id and eo2.me_seller_name = eo.me_seller_name) as sold, sum(case when (va.answer = 1 or va.answer = 3) and (v.code_check_result = 1 or v.code_check_result = 2) then 1 else 0 end) as auth_ok, sum(case when (va.answer = 1 or va.answer = 3) and v.code_check_result = 3 then 1 else 0 end) as auth_ko, sum(case when(va.answer = 2 or v.interrogation_type = 3 or v.interrogation_type = 4) and (v.code_check_result = 1 or v.code_check_result = 2) then 1 else 0 end) as info_ok, sum(case when (va.answer = 2 or v.interrogation_type = 3 or v.interrogation_type = 4) and v.code_check_result = 3 then 1 else 0 end) as info_ko, sum(case when v.serial_number is null and v.interrogation_type is null and v.verification_id is not null then 1 else 0 end) as invalid,  decode (sum(case when (va.answer = '1' or va.answer = '3') and v.code_check_result>0 then 1 else 0 end),0,0,round(((sum(case when v.code_check_result = 3 and (va.answer = '1' or va.answer = '3') then 1 else 0 end) + (sum(case when v.serial_number is null and v.interrogation_type = 0 then 1 else 0 end)))  / sum(case when (va.answer = '1' or va.answer = '3') and v.code_check_result>0 then 1 else 0 end))*100)) as auth_fakes, sum(case when v.interrogation_type = 1 or v.interrogation_type = 2 then 1 else 0 end) as pre_auth from ecc_offer eo left join verification v on eo.me_id = v.me_id and eo.offer_id = v.offer_id left join verification_answer va on v.verification_id = va.verification_id and question_id = 1 left join verification_code_details vcd on vcd.serial_number = v.serial_number  and v.service_id in(10,14,15,16,17,21,22,23,26) and eo.me_id = 2 group by eo.me_id, eo.me_seller_name having count(v.verification_id) > 0  Order by  2

that's when the above ascending query run's the listbox listheader image should change to up.gif . .

please help me to solve my problem.

Best Regards
Yogendra

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-03-14 02:37:47 +0800

samchuang gravatar image samchuang
4084 4

Hi

Could you post a runnable sample code for helping others to debug ?

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2011-03-14 01:38:51 +0800

Seen: 248 times

Last updated: Mar 14 '11

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