App Inventor Listpicker, Select specific text - textselection

I need to get a specific section of text from the listpicker results. So far I can get the item I select to appear in an alert box. I need to set a specific part of that listpicker selection for mysql delete.
example: 24 - 1234567 - DTV - 25-02-2015
I need to use the '24' as this is a row id from my sql db. I can then insert this into my blocks and add to php script to delete that row.
Block Code so far for listpicker:
http://imgur.com/gallery/iw755Z3/new

One possibility is to create 2 lists in your Web.GotText event: list cpetypelistpicker to display in the listpicker as you already have and a second list with only the rowids, let's call that list listRowIds.
In the for each in list loop of the Web.GotText event add additionally:
Then in the Listpicker.AfterPicking event just select the corresponding item from the second list using the Listpicker.SelectionIndex like this

Related

update Select list with two dates

I'm new on apex and I have this basic question.
I have two datepickers and a select list that depends on those datetimepickers. I need to update the query that fills up the Select List when any datetimepickers change. How can I do that?
Navigate to List of values group of properties.
One of them is the Cascading LOV Parent Item(s) property. Enter names of those datepicker items in there, e.g.
:P1_DATE_FROM, :P1_DATE_TO

How to click on Web Table column's Web Button in following case?

I have one web table, in this I want to delete particular record by clicking on record's delete button.
I got the value of row but I am not able to perform click on web button of particular row and also there is 2 buttons in one column.
How to click on delete icon of particular row?
You need to set a reference to the item within the specific row and then click on it - something like this:
Set oLink = Browser("myBrowser").Page("myPage").WebTable("myTable").ChildItem(iRow,8,"Link",0)
oLink.Click
You will potentially need to amend the "Link" and the number 8 in your own code. iRow represents the row you are trying to interact with.
Essentially what this code does is set an object reference to the first item of type "Link", in column 8 of the table, then uses a Click event to select it. If your delete icon is a WebButton, then replace "Link" with "WebButton" for example. The final 0 in the command tells UFT to select the first element matching the object type - you might need 1 if your two icons are in the same column of the table.
Let me know if that helped.

Using XPath to locate on a button within a table

I have a table with several columns. The first column contains unique data, the 5th contains three buttons (Edit, Assignments and Delete).
I would like to use an XPath expression to locate on the edit button for one of the rows by indentifying the row using the unique data from column one (think that made sense).
I have built some expressions which will allow me to locate on the first column and edit button independantly as follows:
//td[text()='Managers']
and
tr[2]//button[text()='Edit']
The closest I can get to doing what I want is:
//td[text()='Managers'] | //tr[2]//button[text()='Edit']
...However this will locate on the data/button in column 1 AND 5 at the same time, what I want is just for the button in column 5.
The reason I want to do it this way, is so later I can pass in 'Managers' as a varaible in order to select the row (as its unique and meaningful data), and then press the edit button in a different column on that row.
Hope this makes sense!
Thanks
The question isn't very clear as posted, especially because I can't see any relevant part of the HTML. But if I understand this correctly, you can try to select the row that has Manager in it then get corresponding Edit button like so :
//tr[.//td='Managers']//button[.='Edit']

Add textboxes in last row of gridview

I am working on Windows Form app using C#. I have a gridview on my form that will contain 5 columns for Sr No, Item Name, Item Price, Item Qty and Item Amount. I want to have a set of five textboxes in the last row of my gridview so that I can enter my required values there and then upon entering the last value, the wholw row comprising of all the five items should get added to the gridview and again the last row should contains that set of textboxes for a newer entry. How can I achieve this?
Also is it possible to have the entries made in the gridview itself? I need to fetch entries from DB and after the user is done, the gridview entries will be stored again in the DB.
Please note that my app is WPF but for ease I have used Windows Form for just this Window.

How to populate dynamically generated select boxes with ajax

I haven't been able to find a solution for the particular problem I'm having with this project. I need to the following: dynamically add rows to a table that contain two select boxes AND use ajax to auto-populate the select options of the 2nd select box, based on the value of the first select box... in the respective table row (that was dynamically added on the fly by some js).
Still with me?
I can easily populate, dynamically, a select drop-down using ajax/javascript based on the value of the first drop-down, in the first row. I can even populate three or more select boxes in the same row, using ajax/js functions to load each additional select. Yet, this is not my goal.
Here's what I have... My form contains a simple table with 3 columns. First is a checkbox, the second is the "State" select box and the third column is the "City" select box. I have two buttons above the table that allow me to "Add Row" and "Delete Row". Mind you, the first row (which is programmed-in), works perfectly for loading the city names of a state using ajax.
Upon clicking the Add Row button, I'm able to create the second row dynamically, which contains the checkbox, state select and city select fields. The state select is populated based on the innerHTML content of the original column, but the city select is obviously null because it is expecting ajax to fill it. Note: the names and ID names of these fields are iterative... city_id, city_id_1, city_id_2, city_id_3 and so on... so I have that uniqueness to work with.
My problem lies in the fact that when I select a state from the 2nd or 3rd (and so on) rows, only the firstcity select changes. Why? Because the js/ajax processing function says to operate only on the element with name "city_id"!! Which is the name of the city select box in the first row.
I have not (yet) found a way to dynamically pass the name of the element I need updated to the onreadystate ajax function. When I've needed to populate two or three select boxes in a row (same row), I've had to have complementary ajax functions for each drop-down - which are static, mind you... but what if I create the element dynamically?? I can't pre-program that many functions into my page... or must I?
If you have any ideas on how to accomplish this I would be soo damn appreciative!!!
Thanks!
var i=1; // put here the number of the column being added now.
var x=document.getElementById("city_id_"+i);
// populate x

Resources