Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] - Handling multiple listboxes

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] - Handling multiple listboxes
 Login/Join
 
Gold member
posted
Hi,

I have hands on in handling two listboxes, one in the left and one in the right.

I have a requirement where I have 4 listboxes in the left and if I select the items from the listboxes and press the right >>, it moves to the final listbox.

Now I find it difficult to move the values from the final listbox to respective left listboxes when I press <<.

Please someone guide on this.

This message has been edited. Last edited by: Ramya,


WebFocus 7702
HTML
 
Posts: 73 | Registered: January 02, 2012Report This Post
Member
posted Hide Post
I have implemented the same with the two listbox in the left(leftlistbox1, leftlistbox2) and one in the right(finallistbox).

What I did, is just capture the id of selected value listbox(the one whose in the left) and then pass that value to the final listbox(in the right).


Steps:
1) Select the value from the left listbox and capture the id of that listbox at onchange event
listbox_name=$(this).attr('id');

2) On clicking >> button just append that selected listbox id to the value with '~' separated and move it to the final listbox

var newOption = new Option(); // Create a new instance of ListItem
newOption.text = Source.options[Source.options.selectedIndex].text;
newOption.value = Source.options[Source.options.selectedIndex].value+'~'+listbox_name;

3) Now select the value from the final listbox(in the right) and at onchange event, separate the value and id with '~' separated

var e = document.getElementById('finallistbox');
var dflSel = e.options[e.selectedIndex].value;
var value=dflSel.indexOf('~');
listbox_name=dflSel.substring(value+1, dflSel.length);

4) On clicking << button just check into which listbox the value should move

if(listbox_name=='leftlistbox1')
MoveItem('finallistbox', 'leftlistbox1');
else if (listbox_name=='leftlistbox2')
MoveItem('finallistbox', 'leftlistbox2');

You can implement the same with 4 list boxes in the left. I also have the implemented HTML, if you require, just share me your personal id.


WebFOCUS 7.7 , 8.0, 8.1
Windows 7
Excel, PDF, HTML
 
Posts: 13 | Registered: May 31, 2016Report This Post
Gold member
posted Hide Post
Dear Ruchica,

Thanks so much. Its really helpful.Would feel better if you can share me the HTML also. My personal ID is ramyagopi88@gmail.com

Thanks,
Ramya


WebFocus 7702
HTML
 
Posts: 73 | Registered: January 02, 2012Report This Post
Gold member
posted Hide Post
Hi Ruchica,

The code you have sent me worked good.

I have dropped you an email saying its not working fine for 3 listboxes and this morning I have done some modifications and its working fine.

Now I am into one more challenge.

Moving values from listbox1 to target, listbox2 to target and listbox3 to target is fine.

Now the challenge is, selecting values from all the three listboxes and making it move to target in a single click.

If anyone has any idea, please come up with.


WebFocus 7702
HTML
 
Posts: 73 | Registered: January 02, 2012Report This Post
Gold member
posted Hide Post
Hi All,

Finally got them working.

I have introduced the array concept and kept appending the array with values I selected from multiple listboxes and finally populated the target listbox with array values.

Thanks all for your help.


WebFocus 7702
HTML
 
Posts: 73 | Registered: January 02, 2012Report This Post
Master
posted Hide Post
Edit your first post to add the text "Solved" to subject line.
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Member
posted Hide Post
Hi Ramya,
Edit your first post as 'Solved'.
 
Posts: 13 | Registered: May 31, 2016Report This Post
Platinum Member
posted Hide Post
Good One Ruchika.


WebFocus 8104,8204
Excel/PDF/HTML/HTMLTABLE/XML/ALPHA/GIF file/GRAPH/Active technologies
 
Posts: 186 | Location: INDIA | Registered: July 11, 2013Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] - Handling multiple listboxes

Copyright © 1996-2020 Information Builders