TouchDevelop Deleting text - text

The Issue:
I have two buttons, button "Apple" and button "Cookie".
When I press the "Cookie" button, text should show saying "Cookie" on screen (which it does)
THEN, when I press the "Apple" button, the text should UPDATE to "Apple" instead of "Cookie"
The problem is, with my current code, whenever I press the second button (Apple) -- the original "Cookie" text isn't removed, it appears underneath the "Apple" text.
I'd like the "Cookie" text to be removed from the screen when I press the apple button or any other button (over 10 buttons)
How would I achieve this within touchdevelop?
Current Code:
Assistance is very much appreciated.

Try this project: http://tdev.ly/ydcl.
To change what is displayed when a button is clicked, set a global variable and change its value when on tapped is called. In TouchDevelop, the page display is refreshed automatically so that any changes made when a button is tapped will occur immediately. There is no need to hide or show part of the display; just include that section in an if statement and change the if statement condition when a button is tapped. If you wanted to show one of three possible layouts, use an if statement that tests the value of a string or number for one of three values and changes that value when a certain button is tapped or condition is met.

Related

How to search a text using Enter key in blue prism

I have a search box where I can enter the search text however there is no search button next to it. So we use to press enter button after enter the search text in text box.
Please advise how to handle this in blue prism. I have tried using Global Send Keys however the focus moved out of the search box hence nothing happening
If the mouse focus is inside the text box then you can see a 'X' mark inside it
If I use the global sendkeys then the mouse focus is outside the text box as below
To go about this issue, I would first try to set the focus on the field, by sending a Global Mouse Click Center (not just focus) to the Textbox.
Next, send the "{ENTER}" or "~" key to the Textbox, using Send Global Keys.
I would assume that if that doesn't work, you have spied the container of the Textbox, not the Textbox itself somehow.
Alternatively, as a last resort you can also choose to send a Javascript command to the webpage, in order to trigger the form submission. This can be achieved by using the Navigate stage on the Application Model's top element (highest in hierarchy).
Good luck!

Radio buttons stop and start working depending on where they are on page

I'm having a strange problem.
I have 3 worksheets that have 2 sets of radio buttons at the bottom of each sheet. On the first sheet, these radio buttons work fine. On the 2nd and 3rd sheet, the radio buttons on the bottom-middle of the page work, but the ones on the bottom-left side of the page do not. When I hover over them the cursor changes appropriately, but when I click on them they just flicker and the button does not fill in.
When I tried remaking the buttons, I found that if the buttons are situated in the middle or right side of the sheet, they work fine, but if I move them over to the left side of the sheet they stop working. It does not seem to be any particular cell line that breaks them (it appears that they consistently stop working in the middle of the M column). When I move them back to the right side of the page, they work again. If I have one button from a particular GroupName filled and move it over to the left, it remains filled and if I click on different button from the GroupName that is situated on the right, the button on the right fills in properly and the button on the left clears properly...I just can't click the button on the left to refill it.
I've tried copying the radio buttons directly from the first sheet (whose buttons are working properly), but that didn't work. I have also copied the formats from the first sheet onto the second sheet, thinking maybe the format of the cells was breaking the radio buttons in some way, but that didn't work either.
Has anyone heard of anything like this happening?
EDIT: I tried putting in a different ActiveX Control (a text box) and it too stops working when it is moved to the left side of the page.

Excel editing command button name not changing

When I am editing command button and I go to the top left corner to change the name of the command button it allows me to edit the text and change it but when I press enter or click somewhere the name of the button keeps reverting back to the original name.
I've tried also tried making sure design mode is selected as well, and the command button and the sheet do not have any protection on either
I'm sure I'm missing something simple.
I had a very similar problem. Solved! My problem was that I would create an ACTIVEX button, and using the properties, give it a customized name (changing CommandButton1 to something much more descriptive)... then later, upon saving and re-opening the excel, some of these buttons (not all) would revert to CommandButtonX.
The whole problem was THE LENGTH OF THE NAME. My names that failed would be around 39 chars or more (somewhere around 39). Using the selection objects pane under the Excel "Find and Select" menu item, I observed the ones that would fail vs succeed.... comparing what I would change in that pane with control properties (Name) and the excel "sheet Name Box" in the upper left area of the sheet screen.
When we have to rename the command button, you can use properties and namebox. But the purpose to change the appearance of button, you have to go to
properties->caption. In caption, you can rename button's appearance.

Toggle a custom icon on an Action Button on Lotus Notes form

When editing the action button properties, it allows an #if statement to flip/flop two choices (lock/unlock). i.e. #If(enlock=1;"Unlock";"Lock") for the "Label" of the action button.
At the bottom of the Action properties, icons can be None, Notes, or Custom. When I select Custom, I want the #if to use either the Locked/Unlocked Notes icons. (actn084.gif and actn085.gif, respectively) Or numbers #62 (locked) and #(I don't know/can't find, the # for the unlock icon).
I've tried formula with the icon number, like in a view, "display as icons" for view column. Using an #if, I've tried the gif on local and server replica's and it didn't give any results.
Please see the example image below.
Image example: http://i.stack.imgur.com/UBac3.png
You have to add actn084.gif and actn085.gif to Resources/Images.
Then, you can use a formula
#If(enlock=1;"actn085.gif";"actn084.gif")
for calculating icon.
As an alternative, you could create two buttons and hide-when them depending on field enlock. You could assign label and icon direct to buttons without formula then.
The hide formula would be enlock=1 for first button and enlock!=1 for the second. In both buttons you would have to add #Command([RefreshHideFormulas]); at the end of your action formula to refresh the action buttons (or Call uiDoc.RefreshHideFormulas for LotusScript action code).

Action Button works differently if added to the DataView

I have a button that calls a Dialog that has a combo box bound to a sessionScope variable. The combo box contains a list of form names that I use to then call an XPage to create a new document. The first value in the forms list is "" so the user needs to select a value. I have a button with the onClick event of:
var c = getComponent("CreateDocDialog");
sessionScope.put("ssSelectedForm","")
c.show();
I have the button and dialog on a customControl with a repeatControl and when the button to open the dialog is clicked the ssSelectedForm is null and the current value of the combo is blank, which is exactly what I want it to be. However, if I add the same button and dialog to a customControl with a dataView control the dialog displays but ssSelectedForm is not null so the combo box displays the last value of ssSelected. I have placed the button outside the dataView, in several of the facets on the dataview, but all with the same results.
Very confusing.
Bill,
I am going to answer the same as my comment since I am pretty confident about what I said.
Go ahead and change the scope from sessionScope to viewScope. I had a similar issue once, and I 'fixed' it by clearing out the sessionScope variable after I used it. This worked, but I realized that it was not necessary, and that by changing to viewScope the lifecycle will be shorter and there was no need to clear out the value when I was done with it.
I don't know why this fails when added to the data view, but if this fixes it that would be all that matters.

Resources