Populate ListBox B based on the value selected in ListBox A

To err is to be human, to help each other is joy. Tell your Compiere needs in your own words. Let's figure out together.

Moderator: azaharizaman

Populate ListBox B based on the value selected in ListBox A

Postby neuron » Sat Oct 14, 2006 8:13 pm

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. :)
neuron
 
Posts: 4
Joined: Sat Oct 14, 2006 8:03 pm

Postby red1 » Sat Oct 14, 2006 8:26 pm

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.
red1
Site Admin
 
Posts: 2753
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby neuron » Sat Oct 14, 2006 9:11 pm

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?
neuron
 
Posts: 4
Joined: Sat Oct 14, 2006 8:03 pm

Postby red1 » Sat Oct 14, 2006 11:29 pm

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.
red1
Site Admin
 
Posts: 2753
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby neuron » Mon Oct 16, 2006 6:56 pm

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
neuron
 
Posts: 4
Joined: Sat Oct 14, 2006 8:03 pm

Postby red1 » Mon Oct 16, 2006 9:40 pm

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
red1
Site Admin
 
Posts: 2753
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby neuron » Tue Oct 17, 2006 12:35 am

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)
neuron
 
Posts: 4
Joined: Sat Oct 14, 2006 8:03 pm


Return to Ask RED1 personally

Who is online

Users browsing this forum: No registered users and 2 guests