[Lift] Problems with ReplaceOptions on a ajaxSelect-based selectbox

129 views
Skip to first unread message

Dick Hirsch

unread,
May 12, 2010, 4:07:18 AM5/12/10
to Lift
Hi,

I'm having trouble using a ReplaceOptions on a ajaxSelect-based
selectbox.

ReplaceOptions adds the new option correctly but then the functions
called on ajax-based on-change event aren't being fired. Do I need to
rebind the ajaxSelectbox?

I call 'ReplaceOptions' like this:

def selectPools = ("0", S.?("base_pool_msg_choose_pool")) ::
(user match {
case Full(u)=> Privilege.findViewablePools(u.id).map(
p => (p.toString, AccessPool.find(p).get.getName)).toList
case _ => Nil
})

if(privilegeSaved && user.isDefined) {
Distributor !
Distributor.AllowUserInPool(user.get.id.is, p.id.is)
logger.info("ACCESS: " + S.?
("base_pool_msg_new_pool",name))
SetValById(theInput, "") &
ReplaceOptions("edit_pool", selectPools, Full("0")) &
DisplayMessage("messages", <b>{S.?
("base_pool_msg_new_pool",name)}</b>, 3 seconds, 2 seconds)

The Ajax selectbox is used in a bind.

bind("edit", in,
"pool" -%> ajaxSelect(adminPools, Empty, p => {pool = p;

poolId.set(p.toLong);
redisplay() //
redisplay pooluser and pool detail
},
"id" ->
editPoolName),

Thanks,

D.

Co-Project Lead / Apache ESME
http://cwiki.apache.org/confluence/display/ESME/Index

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

ZsJoska

unread,
Jun 7, 2010, 4:31:29 PM6/7/10
to Lift
Hi,

I'm hitting the same limitation.

What could be the solution here?
I'm thinking on several possible ways:
- How could we add the new keys to the verification list?
- fix lift code that ReplaceOptions to update automatically the
verification list
- lift could provide an untrustedAjaxSelect in SHtml
- I remember some problems related to html select during DOM
manipulation. Would work to replace the select entirely with Replace
and a new ajaxSelect?

Regards,
Jozsef
> Co-Project Lead / Apache ESMEhttp://cwiki.apache.org/confluence/display/ESME/Index

David Pollak

unread,
Jun 7, 2010, 4:40:23 PM6/7/10
to lif...@googlegroups.com
Use SHtml.untrustedSelect to support changing the items on the client.

There's no ajaxUntrustedSelect at this point, but you can write one yourself (and please open a ticket for this feature and we'll add it post 2.0).
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Charles White

unread,
Mar 21, 2017, 1:17:48 PM3/21/17
to Lift
7 years later and this bug is still there.

Antonio Salazar Cardozo

unread,
Mar 21, 2017, 1:27:00 PM3/21/17
to Lift
To make sure you understand how your post has come across, Charles, you've:

 - Misidentified a missing feature as a bug.
 - Made an extremely rude-sounding remark that implies you expect volunteers to work on
   something you consider important instead of things they consider important.
 - Bubbled up a 7-year-old thread to bring up this expectation.
 - Failed to look into the situation to see that ajaxUntrustedSelect has in fact been implemented
   as David said it would be.

Here is ajaxUntrustedSelect. It's been in Lift since 2.5-M1 in 2012 (5 years ago). If you'd like to try
asking a question nicely about any issues you're having with it or any other part of Lift, please do so
in a new thread and we'll be happy to help.
Thanks,
Antonio

Tyler Weir

unread,
Mar 22, 2017, 10:47:31 AM3/22/17
to Lift
And it's his only post.

Not putting his best foot forward sadly.

Charles White

unread,
Mar 22, 2017, 8:27:42 PM3/22/17
to Lift
Antonio,

I truly apologize for the rude post, was not meant to be that way. I am trying to find a solution to a problem and am having difficulties. 
ReplaceOptions is not a missing feature, it is or at least appears to be a bug. I have some menus that interact with Ajax fine and then when I call ReplaceOptions on the menu, the ajax calls no longer work. Unfortunately for Lift, it is difficult to find much good documentation, for example, with ReplaceOptions, this is one of the few posts I could find.

Once again, I apologize and will be more careful in the future.

Charles

Antonio Salazar Cardozo

unread,
Mar 22, 2017, 8:34:15 PM3/22/17
to Lift
Hey Charles,
Many thanks for the apology. I completely understand getting frustrated, as well as
the additional frustrations that can sometimes be caused by the fact that Lift's
documentation has a lot of room for improvement. For what it's worth, we know it's
a problem, but a lot of us are very strapped for time.

To your particular issue, if you could start a new thread and provide some code
on how you're binding the select box and how you're invoking ReplaceOptions,
we'll try our best to help out, either on how you can make that option work or on
what some alternatives might be. It will be easiest if you post an example project,
but just the binding for the select box + the callback that uses `ReplaceOptions`
might be a good enough starting point.
Thanks,
Antonio

ti com

unread,
Mar 23, 2017, 3:15:13 AM3/23/17
to Lift
seems the lift community attitude hasn't changed much over the years :(


--
--
Lift, the simply functional web framework: http://liftweb.net
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antonio Salazar Cardozo

unread,
Mar 23, 2017, 9:24:42 PM3/23/17
to Lift
If not changing means calling out posts that come across as rude, explaining
why they come across as rude, still responding to the question at hand, and
offering assistance for any other questions provided they are asked nicely, then
you are correct, it hasn't changed much.

This community has always been clear about what's expected of participants
enforced these norms, and I hope we continue to for a long time to come.

If you have a specific complaint about this particular interaction, I'll be happy to
hear it and address it to the best of my ability. While I was rather frustrated with
other matters when I wrote the original reply, I revisited it once I was in a better
mood and didn't find it to be inappropriate.
Thanks,
Antonio
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages