40
Views
10
Comments
Solved
How can I join web block container to another container simultaneously?
Question

Bookings Assignment: Assignment #9.

My difficulty is to insert the web block container in the picture into the already existing table that displays (LastName, FirstName, RoomNumber...Check In). It ends up in a single cell. What is a possible implementation that would allow the tables to line up correctly? A tip about the logic also would be nice in terms of displaying only the records that are filtered correctly from the preparation in the initial table :) . I do not quite get how you can share preparations between different tables.


Bookingstaishanj.oml

Rank: #1051
Solution

Hi Raphael,

A TableRecords component works like a ForEach where the first line normally should be something unrepeatable (header) and the second line is something that will be processed each time a record is fetched in its SourceRecord:

Print 'Header Row': using labels for each column

For each record in SourceRecord {

     Print 'Row': something using the columns of the current record

     Next Record

}

Sure there are many ways to use this component. Here is a simple example.


If you just want to insert a column for FullName, the only thing you have to do is:

(thinking) if each time a row is built from a new record fetched in my source record (the Aggregate or RecordList you point to TableRecords) I have available all attributes from that one. So, just insert an expression concatenating first and last names directly on the column. Use the header to insert the label (e.g. Full Name) and use the second line to insert that expression.

I hope I was helpful!

mvp_badge
MVP
Rank: #91

Hi Raphael,


The web block for full name format was defined bit wrong. Please check the  attached .oml solution


Hope this helps you.


Regards,

Benjith Sam

Bookingstaishanj.oml

Rank: #1051
Solution

Hi Raphael,

A TableRecords component works like a ForEach where the first line normally should be something unrepeatable (header) and the second line is something that will be processed each time a record is fetched in its SourceRecord:

Print 'Header Row': using labels for each column

For each record in SourceRecord {

     Print 'Row': something using the columns of the current record

     Next Record

}

Sure there are many ways to use this component. Here is a simple example.


If you just want to insert a column for FullName, the only thing you have to do is:

(thinking) if each time a row is built from a new record fetched in my source record (the Aggregate or RecordList you point to TableRecords) I have available all attributes from that one. So, just insert an expression concatenating first and last names directly on the column. Use the header to insert the label (e.g. Full Name) and use the second line to insert that expression.

I hope I was helpful!

Rank: #1051

You don't need to use a For Each component and You don't need to implement a list either.

I have tried to explain that when the page is generated in the server to deliver to your browser the final table, including the header and the rows of your SourceRecord, it works like a ForEach.

I suggest you just to insert an expression (concatenating First and Last names) in your main screen (where the TableRecords is) as explained. 

Benjith Sam has suggested you do that. I have tried to explain how things work.

Rank: #1051

If you want, try to explain to us what you need, with mockups, drawings, etc and perhaps I could drive you using OutSystems.

Rank: #4013

Ok let me be a little more precise. 


The initial problem of how to fit one container with a series of values (Names in this case) next to another table was solved by creating a web block that was 'only' an expression and not an entire table records. For example:


This makes it possible to place the widget block inside a single cell of the table on the home page. As follows: 



My problem Wilbert Carpi  is with the logic to get the correct 'incremented' value for the GuestName variable. It only generates the same name over and over now. For example: 

I am new to Outsystems and the Aggregate idea. So that in order to create the NameFormat web block I created a preparation that generates the Bookings Table (Id, FirstName, LastNmae, CheckInDate...). From this preparation I attempt (This is where the problem is) to get the current value of the BookingId in the other aggregate that shows the Guest checking in today information GetCheckinBookingInfo aggregate. I then look up the BookingId value in the Bookings Table and Assign the Expression variable GuestName to the name associated with that Id. This is done as below:


How can I get the correct value for the BookingId 'each time' (A sort of For Loop like you mentioned) so that it displays only the names of the guests checking in today? I will have to use this block in other pages. Therefore it should get data from its own preparation I think.