hillborne Posted May 23, 2011 Posted May 23, 2011 Hi All, I know you shouldn't be using repeating fields for data since it complicates things but I'm guessing it's okay to use them in user interface aids. What I have right now is a layout that somewhat resembles a webpage. As you can see in the top half of the attachment, there are 12 product images numbered 1-12. The upper right of the image shows that you are seeing page 1 out of 26. Originally, the client was happy to have these arbitrary 1-12 numbers as visual aids for a customer to call out "I like #3 and #9" and then those products could be added to their 'like list' that you see on the right. After reviewing the first page, you can go to the next page which would show another 12 products like in the bottom half of the attachment. Now, the client wants the numbers to be incremented per page so it's not confusing for the customer. So on page 2, the numbers should go from 13-24 and so on. The relevant fields I have right now are 2 globals: g_PageNumber and g_Matrix (which is the number of boxes, so 12) From my research on the forum, I think I need to use some form of repeating calculation and possibly Extend() and GetRepetition as well as in Layout mode to show only repetition 1/12, 2/12, 3/12, of the field etc. but I just don't know the right way to go about pulling it all together. If you can help me understand the proper way to use repeating values, I'd greatly appreciate it. Thanks!
comment Posted May 23, 2011 Posted May 23, 2011 Try a repeating calculation field = Get ( CalculationRepetitionNumber ) + Extend ( gMatrix ) * ( Extend ( gPageNumber ) - 1 ) See also; http://fmforums.com/forum/topic/71939-getting-more-out-of-filtered-portals-4horizontal-portal/
hillborne Posted May 23, 2011 Author Posted May 23, 2011 Hi Comment, It works! And more importantly, I understand how it works. Thank you for sharing your knowledge with me. I took a look at your horizontal portal example and it looks very nice...and efficient! However, contrary to your name, it will take me some time to figure out what everything does and how the filter and script interact. I regret to say that my portals are presently filtered like this: PROD::__kP_Product_ID = GetValue ( prod_PROD__grid::g_FoundProdIDs_t ; (zGLOBALVALUES::g_Portal_Matrix_n * zGLOBALVALUES::g_Portal_Page_n - 9) ) I have a self join of the Product table based on a global field of script-populated PrimaryIDs. I couldn't figure out a way to abstract out the incrementing value. No biggie, I guess, but I know it's not the 'right' way. Thanks, again, Comment. Try a repeating calculation field = See also; http://fmforums.com/forum/topic/71939-getting-more-out-of-filtered-portals-4horizontal-portal/ Get ( CalculationRepetitionNumber ) + Extend ( gMatrix ) * ( Extend ( gPageNumber ) - 1 )
comment Posted May 23, 2011 Posted May 23, 2011 I regret to say that my portals are presently filtered like this: PROD::__kP_Product_ID = GetValue ( prod_PROD__grid::g_FoundProdIDs_t ; (zGLOBALVALUES::g_Portal_Matrix_n * zGLOBALVALUES::g_Portal_Page_n - 9) ) I am afraid you have lost me there (no idea what the field names mean). Suppose you have a list of IDs. The IDs to show on the current page can be calculated as = MiddleValues ( listOfIDs ; pageSize * ( pageNumber - 1 ) + 1 ; pageSize ) You could use the result as the matchfield for the relationship, or filter the portal to show records where: not IsEmpty ( FilterValues ( ID ; MiddleValues ( listOfIDs ; pageSize * ( pageNumber - 1 ) + 1 ; pageSize ) ) ) 1
hillborne Posted May 23, 2011 Author Posted May 23, 2011 More evidence of your expertise...even without all the info, you can make some very insightful suggestions! I will try to implement this on a test relationship and see how it works. Superb, thanks! I am afraid you have lost me there (no idea what the field names mean). Suppose you have a list of IDs. The IDs to show on the current page can be calculated as = MiddleValues ( listOfIDs ; pageSize * ( pageNumber - 1 ) + 1 ; pageSize ) You could use the result as the matchfield for the relationship, or filter the portal to show records where: not IsEmpty ( FilterValues ( ID ; MiddleValues ( listOfIDs ; pageSize * ( pageNumber - 1 ) + 1 ; pageSize ) ) )
Recommended Posts
This topic is 5273 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now