Page 1 of 1

Populate ListBox B based on the value selected in ListBox A

PostPosted: Sat Oct 14, 2006 8:13 pm
by neuron
Hi there!

I have two list boxes (drop downs) on a tab. Say one is A and other is B.
I want to Populate ListBox B based on the value selected in ListBox A.

If I use sql validation while defining the Reference for ListBox B, It works but only at the start of the tab only once. I want the listBox B to be populated every time the value ListBox A is changed.

If I have to use CallOut then how to populate the ListBox B (Reference Type) from within the CallOut.

Thanks in Advance. :)

PostPosted: Sat Oct 14, 2006 8:26 pm
by red1
After u use the Callout, u may have to refresh to get the new value. I dont think this webstart works like Ajax does for Web UI. That may take some time in the ADempiere project.

Using Callout to change the value of another field is shown in my tutorial Callout.pdf. As a Callout updates a value in the DB, it wont be shown on screen until refresh.

PostPosted: Sat Oct 14, 2006 9:11 pm
by neuron
red1 wrote:After u use the Callout, u may have to refresh to get the new value. I dont think this webstart works like Ajax does for Web UI. That may take some time in the ADempiere project.

Using Callout to change the value of another field is shown in my tutorial Callout.pdf. As a Callout updates a value in the DB, it wont be shown on screen until refresh.


First things first! thank you for prompt reply :)

Well my question is not about Web UI, it is about Windows UI.
I had a bird's eye view of your callout tutorial. In case I need to use CallOut, then the question is how to populate a listBox from CallOut?

PostPosted: Sat Oct 14, 2006 11:29 pm
by red1
Its a challenging scenario u posed there - populating a list box dynamically? So that when u pull down it has values due to the values entered in another field? Well, that can be done. Your callout will have to seek and populate the AD_Validation value by searching the right record id. Back of my head i say it can be done. But still u have to refresh the screen to make it appear in the list.

I am refering to Ajax UI cos it is known to be able to do that easily.

PostPosted: Mon Oct 16, 2006 6:56 pm
by neuron
red1 wrote:...populating a list box dynamically? So that when u pull down it has values due to the values entered in another field?...


Yes you got my point. This is what I was trying to ask. Ok, now the question is, if I don't want to do it in callout, is it possible without it?

Let me summarize now!

There is a ListBox; A
There is another ListBox; B
I Select a Value from A.
I want ListBox B to change its contents based upon the contents of A.

Can I make it work without using CallOut? If yes, HOW?

In Case of CallOut (as you have mentioned earlier); can I find any example already developed in core compiere modules? I want to copy their methond

PostPosted: Mon Oct 16, 2006 9:40 pm
by red1
AS i said, its a straightforward callout to set the value at the right record in the Ad_ValidationList (not sure of exact table).

About displaying, i got a further idea here. Why dont u use two tabs instead of one?

The second tab holds the target list field. When u input the values in tab one, then u go to next tab, voila! that tabs hold the fresh values in its list.

Just an idea.. There are more... no stopping u from trying further.

gud luck!

red1

PostPosted: Tue Oct 17, 2006 12:35 am
by neuron
red1 wrote:About displaying, i got a further idea here. Why dont u use two tabs instead of one?


This is what i am doing already :) . Anyways! thank you for valuable suggestions. I shall give them a try! 8)