Using the selected values in slush bucket to query

samadam
Kilo Sage

Hi,

I have a slush bucket to select values of locations. i want to feed the selected values to a query in client script. I used the following but it doesn't pull the values.

I have the slush bucket defined: <g:ui_slushbucket name="sb" left_header="Available" right_header="Selected">

var values = sb.getValues(sb.getRightSelect());

What could be wrong?

1 ACCEPTED SOLUTION

Did you try: var values = sb.getValues(getRightSelect());

Without the second sb in it


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

11 REPLIES 11

samadam
Kilo Sage

Thank you, I tried this but getting error:

ERROR: Cannot read property 'getRightSelect' of null

I defined in html:

<g:ui_slushbucket name="sb" left_header="Available" right_header="Selected">
<j:while test="${v_user.next()}">
<option value="${v_user.sys_id}" title="${v_user.name}"> ${v_user.name} </option>
</j:while>
</g:ui_slushbucket>

I have the values in left that I am adding to right.

 

Try using this in client script:

  var varName = 'sb';

      var values = varName.getRightSelect();


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

samadam
Kilo Sage

Tried that and used the exact code they had in the other thread and I get the error.

So in the post I referenced, he gets the exact error you mention then goes on to explain how he fixed it. I'm just not that versed in slushbucket to know what it all means, but from what I gather, he says the name you define for the slushbucket in HTML which you did as "sb" is then defined within the scope of the client script...which doesn't make sense why using straight up sb or assigning it to a variable doesn't work for you...hmm


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Did you try: var values = sb.getValues(getRightSelect());

Without the second sb in it


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!