Have navigation links in table for each row - angular-mdl

I am trying to figure out if its possible to register links in the Table component of angular2-mdl.
Idea is that one column will contain the anchor to the component user needs to go to.
Normally this would be easy on html as you use [routerLink]="" on anchor or button, but is it possible to generate this in the TS file and pass it to the table element?

remove the [] from the routerLink element and insert your variable.
like:
Dynamic routerLink value from ngFor item giving error "Got interpolation ({{}}) where expression was expected"

Related

Dynamic text in master page of Birt report

Can dynamic text be entered into a header or footer of a master page?
I have placed dynamic text into a grid which then sits in the master page footer, this doesn't work and gives error:
ReportDesign (id = 1):
+ Invalid javascript expression: ReferenceError: "row" is not defined. (<inline>#1)
When I test the expression in the footer of the report layout itself this works.
Please see the expression below:
if( BirtComp.lessOrEqual( row["Aggregation"], "1,500.00" )){"user1.jpg"}
else if (BirtComp.greaterThan(row["Aggregation"], "1,500.00")){ "user2.jpg"}
The easiest way to use dynamic text in the master page is as follows:
Optional, but recommended: Create a dataset "MasterPage" which selects the dynamic data that you need.
Create a grid in the page footer (and/or header) of the master page.
Bind the grid to the dataset "MasterPage".
Use dynamic text items and data items inside the grid as you like.
Important:
The grid uses only the first row returned by your dataset.
Thus, it is best practice to create the dataset in such a way that it will return exactly one row.
This means that BIRT aggregation functions won't work here.
If your "MasterPage" dataset is JDBC based, you can of course use SQL aggregation functions like SUM, COUNT etc.
It is not possible to access "the current first record for the current page" this way: The "MasterPage" dataset returns one record for the whole report.

download data from website using uipath RPA

I have automated the login and getting to the downloading page where i have some pdf's which i want to download. These pdf's are dynamic ,sometimes there are 10 sometimes 100 ,it changes everyday.i want to download those pdf's .
please find the attached image
Here i want to download the pdf by clicking each elements in column 3(hyperlink highlighted in blue colour) ,the number of rows in the table is dynamic.how can i do it using UIPATH.
From the top of my head, without knowing the application you are working in I see a few different approaches you can try:
Approach 1: Extract table as Data Table
Perhaps you can extract the table as a Data Table, enumerate the rows and find the individual link selectors you then can pass to a click activity.
Approach 2: Dynamically manipulating the selector
Use UIExplorer to find the selector of the link in the third column. Typically the attribute idx is the unique identifier. You can construct your own variable idx and in a while loop increment this variable while passing it to a click-activitys selector: "<your normal selector here someAttr="something" idx="+idx.ToString+"/>
This way, when the click fails with selector not found you will be at the last row of the column and you can exist the while loop.
Approach 3: Using Find Children
Another approach is to use the Find children activity on the column or table to get the children, i.e. the rows. You need to know which filter to use, it is basically the selector.
Find children outputs a IEnumerable<UIElement> you can iterate and pass to a click activity
The shared image is a perfect case of scraping a table from Web page which can be done through UiPath's Data Scraping Wizard, refer this tutorial. This will convert your html table into DataTable. This Data Scraping Wizard will take care of dynamin number of rows as well as the pagination (if exist).
Later, you've to iterate the DataTable (ForEach activity) and hit the link to download PDF files.

Dynamically add and remove items in multiple places in Vue

I have a page written in Vue, where there is a table with 3 columns as shown below:
https://i.stack.imgur.com/Ox7gn.png
Each column is a whole entity, and each row are the properties of the entities.
At the bottom of each column, there is a group of buttons for each column.
What I want to do is to append some additional attributes (strings) to possibly more than one properties of an entity when a button is clicked, like below:
https://i.stack.imgur.com/lnUzt.png
And when another button is clicked, more strings are appended.
When a button is clicked again, the corresponding properties will be removed. For example, if the "a" button in the second image was clicked, the table will revert to the first image.
Since there are many properties (around 10), I don't want to hard code all the strings as div's under each and every property and render them conditionally using v-show/v-if.
I have also thought about storing an array of the number of active buttons and re-render the whole table when any button is clicked. (The reason why the whole table has to be re-rendered is because each individual rows are rendered with a for-loop, so I cannot just modify a single element in a row.) But this does not seem very natural, and I believe there should be a better solution.
Is there a good way to do it?

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']

The responsetext from ajax page not displaying in intended position

Im my code i get a value from an ajax page , but it is displayed in a different position than i wish to display. I would like to display it in,..
<tr><td>hello</td></tr>
<tr id="showajax"><td>Ajax Value is:</td><div id="ajaxhide"></div></tr>
here the ajax value returned is displayed somewhere else.
I had used document.getElementById('ajaxhide').innerHTML=xmlhttp.responseText; inside javascript properly also.
The ajax value returned is like this
echo '<td>'."Thanks".'</td>';
Well the first thing is you're trying to dynamically resize the table. It would be better to create the cell as empty to start with and then update the content.
You've also got some invalid syntax with <div id="ajaxhide"></div> floating outside of any table cells but inside a table row. It's not just that it will fail validation and each browser may treat it differently, but also that when you're making the content change you're trying to insert a cell inside the div (which isn't technically allowed) which is inside a row (which also isn't technically allowed).
The solution is to use:
<tr id="showajax"><td>Ajax Value is:</td><td id="ajaxhide"></td></tr>
Now to make the AJAX update:
document.getElementById('ajaxhide').innerHTML=xmlhttp.responseText;
A word of warning on Internet Explorer
IE considers COL, COLGROUP, TABLE, TBODY, TFOOT, THEAD and TR to be read only. This means you can update a cell (TD, TH) but not the whole row and not the whole table. In your above example you're not trying to do that... but just be aware of the limitation if your design changes.

Resources