Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
SkyForum

Registered:
Posts: 38
Reply with quote  #1 
I am trying to create a list box that allows multiple selections to assign multiple roles to a single user and it just does not work for me.

Following the information I found in the help page, it tells me I need to initialize a static key id list to get it to work. I cannot do this because items are added and removed from the role table and are ever changing.

If I leave the Initialize set to URL=(key-id) it populates the box with all the choices from my role table and it even allows me to select multiples. However, all it does is process the first choice in the list. 

I think I need to change the savebutton_click event from the default save data on page to custom but have no idea what is required to cause it to loop back through and pick up all the selections. 

As you can tell, I do not do this professionally and I could use a little direction. Adding these roles one at a time is a real PITA. 

I have included a quick little image of my table relationships to help you understand. I have one table called properties and I have learned over time that when I refer to the table as "properties", it causes all kinds of grief. [biggrin]

Thanks ahead of time and please, don't assume I know where to put anything, especially snipets of code. you will have to explain in detail. 


[tablerelationship]

__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
vmnz

Registered:
Posts: 32
Reply with quote  #2 
Is the list box control paramount for you to have there?

Your DB tables relationship looks like many-to-many, and can be easily created using ISD template with checkboxed grid page (i.e. Edit Record page). It might look similar, but easier to control and save. Something like:

Capture.png 

SkyForum

Registered:
Posts: 38
Reply with quote  #3 
From what I see here I would have to change the entire theme for my site. I do not wish to do that.

I wish I would have known about the loss of functionality before I chose the modern theme to build on. 

Thanks for your help. 

__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,929
Reply with quote  #4 
I don't think Listbox multiselect will work the way you want it, regardless of the theme being used. However, there are options and alternatives that you need to do some dirty works. I will no longer attempt to explain further because it requires more than a code snippet.  

Cheers,
Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

SkyForum

Registered:
Posts: 38
Reply with quote  #5 
Of course not. It might be my lack of skill but I can't really think of too many ways one would expect a listbox multiselect option to work. I am not overly pushy about it though and would very much settle for it to work just one way, any way. 

Of course that would be kinda like expecting a permanent license to last more than 1 year, now wouldn't it. 

You need not worry about it Jimi, I won't bother you about it again. 

Enjoy your day. 

__________________
As you get older, your patience begins to wane. As a result, you become the "Grumpy Old Guy".  At 60 years of age I have become this guy. I am now faced with the dilemma of an old dog learning new relationship tricks to survive. [rolleyes]
pinbot

Avatar / Picture

MVP Consultant
Registered:
Posts: 952
Reply with quote  #6 

I gotta agree that using a checklistbox would be preferable.  

With your multi-select list if someone is editing an existing user and accidentally clicks a role, it will unselect all the previously selected roles.   


Similar forum question.  I've done it this way in the past myself (list all roles, on save, delete from many-to-many table and then only add the checked ones).

http://sjc.ironspeed.com/post/multiselect-quick-select-or-listbox-6410359#gsc.tab=0


But now this is directly supported since 10.1:

http://www.ironspeed.com/products/New-Features-V101.aspx#gsc.tab=0

2017-05-10_8-19-58.jpg 





__________________
C. Bryan Patrick II
Iron Speed Designer MVP Consultant
Pseudo Consulting
vmnz

Registered:
Posts: 32
Reply with quote  #7 
Quote:
Originally Posted by SkyForum
From what I see here I would have to change the entire theme for my site. I do not wish to do that.

I wish I would have known about the loss of functionality before I chose the modern theme to build on.


That functionality has nothing to do with themes. Can work regardless of what theme is used.
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,929
Reply with quote  #8 
Hi Bill,
If it still doesn't work according to this as referred by Bryan (Pinbot): http://www.ironspeed.com/products/New-Features-V101.aspx#gsc.tab=0

Just ensure that PrpertyRoles.idPropertyRoles is an IdentityColumn-AutoIncrement type.

Take note also that this solution does not require ListBox control but just a simple Master(Users) and Many-To-Many (Properties) form with no additional code needed to work.

Cheers,
Jimi J   
 

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Download Iron Speed Designer

Terms of Service Privacy Statement