How can I create datatable which displays record as the following:
| | SECOND |
| ONE | THIRD |
| | FORTH |
| | FIFTH |
e.g one to many. Can you help me?
There's no way to achieve it with Primefaces, AFAIK. You could use a subtable instead to do something like:
| ONE |
| SECOND | THIRD || FORTH || FIFTH |
Or even use a rowExpansion utility, which I usually use for most of my one to many cases.
If your requirement is to match exactly what you ask for, you could always go with a pure JSF implementation instead and try to style it using Primefaces CSS stylesheets.
Using subtable you can display 1 to N relation data like:
| ONE | SECOND |
| | THIRD |
| | FORTH |
| | FIFTH |
For that you need repeat ONE in each line, but display (rendered) it for first line only. See result using RichFaces
Related
My data looks like below. I have Groups that I share topics each day. We do this randomly based on need.
| | Topic 1 | Topic 2 | Topic 3 | Topic 4 | Topic 5 | Topic 6 | Topic 7 | Topic 8 | Topic 9 |
|---------|---------|---------|---------|---------|---------|---------|---------|---------|---------|
| Group 1 | | 19-apr | 30-apr | | | | | | |
| Group 2 | 18-apr | 25-apr | | | | | | | |
| Group 3 | | | | | 19-apr | 30-apr | | | |
| Group 4 | 18-apr | 25-apr | | | | | | | |
| Group 5 | | | | | | | 19-apr | 30-apr | |
| Group 6 | | | 25-apr | | | | | | |
| Group 7 | 18-apr | 25-apr | | | | | | | |
For our metrics & analysis, we need a list of groups per date on a different sheet. We like to know which all groups were engaged a given day. Like below
Can somebody please help me how I can get this done with only using formulas and without macros?
I believe this can somehow be handled on Index Matching or look-ups.
You could definitely do this with macros. You can do something similar without macros; it may not be precisely what you were looking for because it will leave blank space where groups were not addressed.
Method 1
Here is the formula I used and a picture of the sheet it is in:
=IF(IFERROR(MATCH(L$4,$B6:$H6,0),FALSE),INDEX($B$5:$B$13,MATCH($K5,$B$5:$B$13,0),1),"")
The idea is that if you have absolute references alongside your list of groups per date, then you can use index and match to fill in that group's name, but only if Match finds that precise date code in that group's row from the previous table. If you place an equivalent formula in the first cell, you can drag it out to the rest of the array.
The formula I used is not the only way to do this, but if you know Index and Match, then it should make sense to you.
Method 2
A more convoluted method would be to use image references. With these, it is possible to make the report precisely what you asked for on a separate sheet.
Suppose you took Method 1 and separated each column out into a different table. Nearly the same formula inside the cells below the date heading, except that you enclose the heading reference in int() as shown below. Create one table for each of N dates, where N is the number of days you want to monitor at once. Then when you want the summary to show you different dates, you go to each table and change the heading, and filter out blanks.
formula:
=IF(IFERROR(MATCH(INT($L$2),$B4:$H4,1),FALSE),INDEX($B$4:$B$11,MATCH($K3,$B$4:$B$11,1),0),"")
The below image shows what I mean by one table for each date:
Then you insert an image. Doesn't matter what image; could be a screenshot of anything. Click on that image, then click into the formula bar. Then highlight the table column you want it to represent. Below is a screenshot of how to to that:
Now place that picture on its own sheet in the workbook. Place each date table on its own sheet in the workbook. The reason you do this is: if you filter a table, everything else overlapping the filtered rows outside the table will also be hidden. You move tables to separate sheets to prevent them from hiding each other.
Finally, arrange your pictures into the order you like, filter the blanks out of the tables, and your images will be exactly what you were looking for:
Again, this is a little convoluted because if you want the report to show you new date summaries, you would have to change the headings on every table. Then you would have to go to each table and refresh it's filter. This is where macros usually come in.
Assume range A1:J8 housed your Source table, and L1:P8 housed the Date/Group Output
1] In L2, copied across :
=IFERROR(1/(1/AGGREGATE(15,6,$B$2:$J$8/($B$2:$J$8>K$2),1)),"")
2] In L3, copied across to P3 and all copied down :
=IF(L$2="","",IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($A$2:$A$8)/($B$2:$J$8=L$2),ROW(A1))),""))
You can use the following formula to get a list of dates from a table:
=IFERROR(AGGREGATE(15,6,($B$2:$J$8/($B$2:$J$8*(COUNTIF($A$15:A15,$B$2:$J$8)=0)))*$B$2:$J$8,1),"")
To get a list of groups by date, use the following:
=IFERROR(INDEX($A$1:$A$8,AGGREGATE(15,6,(1/(B$15=$B$1:$J$8))*ROW($B$1:$J$8),ROW(A1))),"")
We are creating Gherkin feature files for our application to create executable specifications. Currently we have files that look like this:
Given product <type> is found
When the product is clicked
Then detailed information on the product appears
And the field text has a value
And the field price has a value
And the field buy is available
We are wondering if this whole list of and keywords that validate if fields are visible on the screen is the way to go, or if we should shorten that to something like 'validate input'.
We have a similar case in that our service can return a lot of 10's of elements for each case that we could validate. We do not validate every element for each interaction, we only test the elements that are relevant to the test case.
To make it easier to maintain and switch which elements we are using, we use scenario outlines and tables of examples.
Scenario Outline: PO Boxes correctly located
When we search in the USA for "<Input>"
Then the address contains
| Label | Text |
| PO Box | <PoBox> |
| City name | <CityName> |
| State code | <StateCode> |
| ZIP Code | <ZipCode> |
| +4 code | <ZipPlus4> |
Examples:
| ID | Input | PoBox | CityName | StateCode | ZipCode |
| 01 | PO Box 123, 12345 | PO Box 123 | Boston | MA | 12345 |
| 02 | PO Box 321, Whitefish | PO Box 123 | Whitefish | MN | 54321 |
By doing it this way, we have a generic step "the address contains" that uses the 'Label' and 'Text' to test the individual elements. It is a neat and tidy way to test a lot of potential combinations - but it probably depends on your individual use case - how important all of the fields are.
You only need to validate the ones that provide business value, which is probably all of them. I would avoid using tech terms like "field" because it isn't related to a behavior. Al Mills is right on for using the tables.
I'd word it like this:
Scenario Outline: Review product details
Given I find the product <Type>
When I select the product
Then detailed information on the product appears including
| Description | <Description> |
| Price | <Price> |
And I can buy the product
Examples:
| Type | Description | Price |
| Hose | Rubber Hose | 31.99 |
| Sprinkler | Rotating Sprinker | 12.99 |
The words I chose are behaviors or whats, not technical implementations or hows.
I am preparing for a class project and I am using LibreOffice (version 4.2.0 - Win32) to create the title page of my report. In sWriter, I created a 1 row, 2 column table that I pulled down so it spans the length of the page (essentially resembling a left and right sided frame in (x)html. In the left cell, I inserted a small table with filled cells for aesthetic purposes. At the moment, the title page looks like the following:
___________________
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
|____|____________|
I am trying to modify the structure so it looks like the following:
___________________
| | | |
| | | |
| |___| |
| | |
| | |
| | |
| | |
| | |
| | |
|____|____________|
My intention is to insert a small image in the cell located on the border. I have tried merging cells but I cannot select "across" the border and inserting a new row doesn't work either. I assume that is due to the way the table was initially constructed, i.e., dragged to the bottom of the screen.
Any constructive feedback would be appreciated.
Thanks,
~Caitlin
The solution depends on your needs, especially the content of the right "column".
If there's no text or other content that should appear besides the picture, the simplest solution would be just to insert the picture in the left "column" and drag it to its final position. Notice that the "wrap" options apply only to the left column where the image is anchored, so if you try to enter text starting at the upper left corner of the right "column", it will "collide" with the picture.
If you want to put content into the right "column" starting at the right border of the image, you should modify the table layout. I'm sure you can insert a new column, but it will appear at the bottom of the page (or even on the next page). Instead, you could split the single table row into two rows, using Menu Table -> Split cells:
Next, you can split the left cell in the first row, so the first row has three cells. Finally, hold CTRL+SHIFT and drag the right cell border of the first cell to the left (CTRL+SHIFT makes sure that moving the border only affects the current, first row). Now, the table should look like this:
___________________
| | | |
| | | |
|__|___|__________|
| | |
| | |
| | |
| | |
| | |
| | |
|____|____________|
Another solution would be to get completely rid of the table that covers the entire page. If you want to put some design content into the left "column", just add a frame, move it to its place, and enter the content. To keep the main content out of the left "column's" area, adjust the left margin (in Menu Style -> Page). Now, just add the picture to the main content and drag it to its place.
I am editing a wiki file and would like to add a new column in between of two existing columns.
| *No* | *Issue* | *File* | *Status* |
| 1 | blah | foo | open |
| 2 | blah1 | foo1 | close |
Say, I want to insert a new column between the 3rd and 4th columns above. If I could search for the fourth match of the | character in a given line, I could replace that with | |. But how one can do that in Vim?
The end result would look like so:
| *No* | *Issue* | *File* | | *Status* |
| 1 | blah | foo | | open |
| 2 | blah1 | foo1 | | close |
How about recording a macro into register q by entering qq3f|a|<ESC>q in command mode (ESC means pressing the Escape key). Now you can apply this macro to each line by :%norm#q.
Additional bonus:
With this pattern you can add more complex actions, for example replicate the first column as column 3 (if cursor is at first column):
qqf yf|;;;p0q
Oh, and the answer to your question: Search 4th occurrence of | on a line is done by 3f| (if the cursor is at position 0 and on a | character as in your example).
Consider the following substitution command.
:%s/\%(.\{-}|\)\{4}\zs/ |/
:%s/\(|[^|]*\)\{3\}/&| /
Which means: on each line (%), find three occurrences (\{3\}) of a string that starts with | followed by any number of non-| ([^|]*), and replace that with itself (&) followed by |.
You can call sed in vim as a filter:
:%!sed 's/|/| |/4'
I m using LWUIT in J2ME. I want to create list with 5 column and multiple row. How can done this.? I want to add data on list,and data is come from Network? plz help me. I attached my desire output image. Thanks in advance.
Eg
shape | cut | color | clarity | carats
round | o | i | i1 | 1.000
abc | w | u | s | 2.300
-- | -- | - | - | -----
-- -- - - ----
--
I suggest you use a Table and not a List.
If you want a List you can use the new Container list (see the Grid Demo in the Scrolling portion of the LWUIT demo).