Jump to content
UBot Underground

How would I emplement this code with html ui


Recommended Posts

I am making my user interface and have run into a problem. The following code works perfect, but I am not entirely sure how to utilize a similar function with the html panel ui component. Is there a way to use both the html panel and a ui component? Problem is when I use html panel for my ui the non html panel ui components disappear.

on load("Tab Loaded") {
    clear list(%CampaignList)
    clear table(&ListOfCampaigns)
    add list to list(%CampaignList, $get files("{$special folder("Application")}/Campaigns", "No"), "Delete", "Global")
    add list to table as row(&ListOfCampaigns, 0, 0, %CampaignList)
}

ui drop down("Choose A Campaign", &ListOfCampaigns, #campaign)

This will get all my campaign files in a folder, and display them in a dropdown menu. 

Link to post
Share on other sites

Its not, and I already have html code for the forms I need filled out. Quite a few options on the forms, so I was kind trying to avoid redoing them each with the ui components. I think I try a workaround in the morning and see if it works. Thanks for the info though.

Link to post
Share on other sites

OK got it workin, here is how I did it is anyone is interested.

on load("Tab Loaded") {
    clear list(%CampaignList)
    clear table(&ListOfCampaigns)
    add list to list(%CampaignList, $get files("{$special folder("Application")}/Campaigns", "No"), "Delete", "Global")
    set list position(%CampaignList, 0)
    loop($list total(%CampaignList)) {
        set table cell(&ListOfCampaigns, $list position(%CampaignList), 0, "<option value=\"{$list item(%CampaignList, $list position(%CampaignList))}\">{$list item(%CampaignList, $list position(%CampaignList))}</option>")
        set list position(%CampaignList, $eval($add($list position(%CampaignList), 1)))
    }
}
ui html panel("<div class=\"SelectCampaign\" id=\"wrapper\">
	<select class=\"dropdown MyVariable MyVariableselect\" id=\"MyVariable\" variable=\"{#campaign}\">
		{&ListOfCampaigns}
	</select>
</div>", "")

  • Like 1
Link to post
Share on other sites

This is the correct way to populate a drop down in ubot now:

ui html panel("<select variable=\"#Selected_Item\" list=\"#Options\" list-fillwith=\"options\"></select>
<button onclick=\"ubot.runScript(\'Select Item()\')\">Select</button>", 100)
set(#Options, "Item 1,Item 2,Item 3,Item 4,Item 5, ", "Global")
define Select Item {
    alert(#Selected_Item)
}

Hope that helps!

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...