Jump to content
UBot Underground

Writing conditions with UI buttons


Recommended Posts

I am wanting to build conditional buttons based upon the selection of a dropdown. I used an if statement but that didn't work. I don't even know if this is possible but I thought I would try.

 

ui window("Search Settings") {
   ui drop down("Chose Country", "US,UK", #country)
   if("{#country}=US") {
       then {
           ui button("US Ebay Category Numbers ") {
               navigate("http://listings.ebay.com/_W0QQfclZ1QQloctZShowCatIdsQQsocmdZListingCategoryList", "Wait")
           }
       }
       else {
           ui button("UK Ebay Category Numbers ") {
               navigate("http://listings.ebay.co.uk/_W0QQloctZShowCatIdsQQsacatZQ2d1QQsalocationZlicQQsocmdZListingCategoryList", "Wait")
           }
       }
   }
   ui text box("Top Level Ebay Category Number to be Searched. 0 is all categories", #categoryToSearch)
}

Link to post
Share on other sites

thanks for the feedback.

 

I'm trying to make it so based upon a selection of the drop down a button shows up in the menu.

 

So if they select US then the US button shows up and if they select UK then the UK button shows up for them to click on if they want.

Link to post
Share on other sites

What is going to happen after they click the US or UK button is it going to do a search?

Or is it some option process that the end user should be able to choose whether they want to happen

or not?

 

A solution I have used for a need for a dynamic UI i.e. thing changing based upon user selection

is to us an if statement combined with the load html command. So if US is true then load the HTML

with the US checkbox in the browser. If checked you can use that to

trigger the commands that you want to run. Just remember you have to scrape the attribute of the

check box to to trigger the commands. Something like IF---->SCRAPE ATRIBUTE---->CHECKED =$true.

 

The only drawback is yo have to make a set of commands for each one of your original dropdown/selection items.

 

James

Link to post
Share on other sites

What is going to happen after they click the US or UK button is it going to do a search?

Or is it some option process that the end user should be able to choose whether they want to happen

or not?

 

 

Thanks for the help on this James.

 

If the user chooses UK then a button appears for them to click. When they click the button it navigates them to the UK ebay category listings page.

Link to post
Share on other sites

the way its shown from willywonka or blumi is correct.

 

the way your wanting to do it you would need to use ui html panel or ui html window

 

and use a combination of html and javascript

onclick

 

and have it execute a defined command

 

ok, thanks. I don't have dev so I don't have those available to me. I think I got something working now with the above suggestions.

Link to post
Share on other sites
  • 1 month later...

the way its shown from willywonka or blumi is correct.

 

the way your wanting to do it you would need to use ui html panel or ui html window

 

and use a combination of html and javascript

onclick

 

and have it execute a defined command

 

Unclear...

 

From Javascript, how does one execute uBot code?

 

From uBot, how does one execute javascript?

 

Thank you...

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...