DavidM 3 Posted July 6, 2013 Report Share Posted July 6, 2013 Was this issue ever resolved? I am having this same problem. Quote Link to post Share on other sites
DavidM 3 Posted July 8, 2013 Report Share Posted July 8, 2013 Nobody with an answer? Or is there a workaround? Quote Link to post Share on other sites
VentureOnline 49 Posted July 8, 2013 Report Share Posted July 8, 2013 Nope the UBot staff said that it was just lucky that this ever worked and they have no plans on getting this to work again. You can just use the free file management plugin now though to do this. Quote Link to post Share on other sites
DavidM 3 Posted July 8, 2013 Report Share Posted July 8, 2013 Nope the UBot staff said that it was just lucky that this ever worked and they have no plans on getting this to work again. You can just use the free file management plugin now though to do this. Thanks for the work around! Gonna go try it out now. Quote Link to post Share on other sites
DavidM 3 Posted July 8, 2013 Report Share Posted July 8, 2013 Ok tried it. Works well but the dialog is always going to be a pop up? No way to embed that on the UI HTML Panel? Quote Link to post Share on other sites
VentureOnline 49 Posted July 8, 2013 Report Share Posted July 8, 2013 Nope. We tried getting Eddie and the guys to bring back this feature and they said there are no plans to bring it back. Quote Link to post Share on other sites
DavidM 3 Posted July 8, 2013 Report Share Posted July 8, 2013 Crazy as this seems like basic functionality... Hey Eddie if your reading this PLEASE BRING THIS FEATURE BACK! I need this feature for other bots I am building. Especially for my order automation after I pull data from my DBs. Quote Link to post Share on other sites
LazyBotter 188 Posted July 8, 2013 Report Share Posted July 8, 2013 There is actually a work around, I will post when I gat home! Quote Link to post Share on other sites
UBotDev 276 Posted July 8, 2013 Report Share Posted July 8, 2013 If you need to do that only once, you can do that inside "on load" command (when I gave a feature request for "on load" command I asked specifically for it, so we are able to programatically create UI before it gets loaded), so this is doable since then. Here is the code: on load("Bot Loaded") { clear list(%LIST Options) add list to list(%LIST Options, $list from text("Google,Yahoo,MSN,Bing,eBay,Craigslist,Foxnews,CNN,MSNBC,UBotBuddy", ","), "Delete", "Global") set(#LIST Options ROW, 0, "Global") set(#UI Options, "", "Global") loop($list total(%LIST Options)) { set(#UI Options, $append line to text(#UI Options, "<option value=\"{$list item(%LIST Options, #LIST Options ROW)}\">{$list item(%LIST Options, #LIST Options ROW)}</option>"), "Global") increment(#LIST Options ROW) } } ui html panel("<select variable=\"#VariableOfSelection\" fillwith=\"value\" style=\"width: 220px;\">{#UI Options}</select><br> <div fillwith=\"innertext\" variable=\"#VariableOfSelection\">Ready</div>", 100) set(#UI Var, #VariableOfSelection, "Global")To get it working you will have to re-open UBot Studio or compile a bot for preview. Also notice that I am not using "navigate" command, since that one doesn't work inside "on load" (if you use HTTP post plugin, you can even load that list from URL ). Like this post if it saved your problem. 2 Quote Link to post Share on other sites
LazyBotter 188 Posted July 8, 2013 Report Share Posted July 8, 2013 OK, here is my work around to dynamically update the drop down, NOTE: this will only work with a "Select Box"! Its not perfect but it works! ui html panel("<!DOCTYPE html> <html lang=\"en\"> <head> <meta charset=\"utf-8\"> <meta name=\"generator\" content=\"CoffeeCup HTML Editor (www.coffeecup.com)\"> <meta name=\"dcterms.created\" content=\"Mon, 08 Jul 2013 22:51:56 GMT\"> <meta name=\"description\" content=\"\"> <meta name=\"keywords\" content=\"\"> <title></title> <!--[if IE]> <script src=\"http://html5shim.googlecode.com/svn/trunk/html5.js\"></script> <![endif]--> </head> <body> <table> <tr> <td> <button onclick=\"ubot.runScript(\'Load List()\')\">Load List</button> </td> </tr> <tr> <td> <select variable=\"#Selected_Option\" style=\"width:300px;\" size=\"6\" onclick=\"ubot.runScript(\'Load Option()\')\" > <optgroup label=\"Options\" variable=\"#Options\" fillwith=\"innerhtml\"></optgroup> </select> </td> </tr> </table> </body> </html>", 300) define Load List { set(#Options, "Item 1 Item 2 Item 3 Item 4 Item 5", "Global") set(#Options, "<option>{$replace(#Options, $new line, "</option><option>")}</option>", "Global") } define Load Option { set(#Loaded_Option, #Selected_Option, "Global") set(#Options, $replace(#Options, "<option style=\"background-color:#000; color:#00FFFF\">", "<option>"), "Global") set(#Options, $replace(#Options, "<option>{#Loaded_Option}</option>", "<option style=\"background-color:#000; color:#00FFFF\">{#Loaded_Option}</option>"), "Global") } Carl Quote Link to post Share on other sites
UBotDev 276 Posted July 8, 2013 Report Share Posted July 8, 2013 OK, here is my work around to dynamically update the drop down, NOTE: this will only work with a "Select Box"! Its not perfect but it works!Your solution will only work when you use "size > 1" parameter inside "select" tag; it won't work with normal "select" tag since output variable doesn't get updated with the value, and list is stuck to item 1. Still, it works with "size > 1" because the item is always selected, so it's always forcing UBot variable to the selected value, and I think it's safe to use if you don't mind height. My solution works since HTML for UI is created before UI gets loaded. Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 9, 2013 Report Share Posted July 9, 2013 Use this free plugin http://www.ubotstudio.com/forum/index.php?/topic/13237-free-file-management-plugin-multiple-commands-and-functions/page-3&do=findComment&comment=77674Then use $dropdown dialog.Problem solved. Quote Link to post Share on other sites
DavidM 3 Posted July 9, 2013 Report Share Posted July 9, 2013 If you need to do that only once, you can do that inside "on load" command (when I gave a feature request for "on load" command I asked specifically for it, so we are able to programatically create UI before it gets loaded), so this is doable since then. Here is the code: on load("Bot Loaded") { clear list(%LIST Options) add list to list(%LIST Options, $list from text("Google,Yahoo,MSN,Bing,eBay,Craigslist,Foxnews,CNN,MSNBC,UBotBuddy", ","), "Delete", "Global") set(#LIST Options ROW, 0, "Global") set(#UI Options, "", "Global") loop($list total(%LIST Options)) { set(#UI Options, $append line to text(#UI Options, "<option value=\"{$list item(%LIST Options, #LIST Options ROW)}\">{$list item(%LIST Options, #LIST Options ROW)}</option>"), "Global") increment(#LIST Options ROW) } } ui html panel("<select variable=\"#VariableOfSelection\" fillwith=\"value\" style=\"width: 220px;\">{#UI Options}</select><br> <div fillwith=\"innertext\" variable=\"#VariableOfSelection\">Ready</div>", 100) set(#UI Var, #VariableOfSelection, "Global")To get it working you will have to re-open UBot Studio or compile a bot for preview. Also notice that I am not using "navigate" command, since that one doesn't work inside "on load" (if you use HTTP post plugin, you can even load that list from URL ). Like this post if it saved your problem. Thanks for this work around Ubotdev. I will give it a try as well. @Kreatus - Yes the $dropdown dialog works but aesthetically it bothers me as it's a floating popup that closes everytime you make a selection. Or am I missing a work around with it as well? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 10, 2013 Report Share Posted July 10, 2013 I got it a bit ghetto since there is a flicker but still it works..Essentially you set a blank option at the top and set a variable and fill it with innertext. On the dropdown itself make a onchange="ubot.runScript('scriptName')" and set the variable of the blank option to the variable of the dropdown. The code is a bit messy since I was mashing up part of the code found in this thread and my own but you will get the idea: EDIT: Got rid of the flicker now it looks flawless navigate("http://ubotsandbox.com/ubot-simple-list.php", "Wait") set(#mydropdown, $scrape attribute(<id="links2scrape">, "innertext"), "Global") set(#mydropdown, "<option>{$replace(#mydropdown, " ", "</option> <option>")}</option>", "Global") ui html panel("</form> <select variable=\"#selectOption\" onchange=\"ubot.runScript(\'changeDD\')\" style=\"width: 220px;\" fillwith=\"value\"> <option variable=\"#optionVariable\" fillwith=\"innertext\"></option> <optgroup variable=\"#mydropdown\" fillwith=\"innerhtml\"></optgroup> </select> </form>", 100) define changeDD { set(#optionVariable, #selectOption, "Global") } Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 10, 2013 Report Share Posted July 10, 2013 I tested it a lot and sometimes it would switch back and flicker. So in the define I looped it 10 times to set the variable. This will make it flicker sometimes but it will always display the correct selection at the top instead of sometimes switching back.Still a bit ghetto but better than nothing. Quote Link to post Share on other sites
UBotDev 276 Posted July 11, 2013 Report Share Posted July 11, 2013 The solution that I provided above won't flicker, since it gets rendered on load and it acts like a hardcoded HTML. 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted July 11, 2013 Report Share Posted July 11, 2013 The solution that I provided above won't flicker, since it gets rendered on load and it acts like a hardcoded HTML. I somehow skipped over your post but this solution is for sure better - thanks. Quote Link to post Share on other sites
UBotDev 276 Posted July 11, 2013 Report Share Posted July 11, 2013 I somehow skipped over your post but this solution is for sure better - thanks. The only down side of it is that you can't use browser inside "on load", so you can't get data like that, although I think you should be able to use HTTP post plugin for example (but that was not topic of discussion I think). Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.