Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
9 replies
Subscribers
7 subscribers
Views
2372 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Afternoon all, I have an odd issue with a dynamic gridLayout. Th
garethm
over 8 years ago
Afternoon all,
I have an odd issue with a dynamic gridLayout.
The grid has a dynamic number of both rows and columns, with total and subtotal rows and most of the time this is working - however..........
when there is only 1 row of data I am getting an error of:
"Rule '?' has 1 parameters, but instead passed 3 parameters."
I understand the error, but not how to solve it......
For 1 data row the a!applyComponents is returning:
{Total row
SubTotal row
data row}
and this leads to the error - with the 3 rows being the 3 parameters in the error above.
HOWEVER
If there are 2 datasets:
{
{Total row,
SubTotal row,
data row},
{data2 row}
}
is being correctly rendered with 4 rows in the grid.
Does anyone have any ideas why this is happen... and more importantly how to solve it!
Thanks in advance
Gareth
OriginalPostID-158868
OriginalPostID-158868
Discussion posts and replies are publicly visible
0
abhi.jana
Appian Employee
over 8 years ago
I'm unfamiliar with your design, but you may find this SAIL recipe for Editable grid using applycomponents to construct the rows useful to compare with your own implementation. The example in the recipe works fine with a single row of data.
forum.appian.com/.../SAIL_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 8 years ago
Are you able to simplify your SAIL form and attach it to this post?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garethm
over 8 years ago
Abhi,
The design is already using a!applyComponents, both for defining the columns and then populating the rows, and when there is more than 1 row of data this works correctly.
The issue is when the sub-rule (used by in the applycomponents) that returns a single array of multiple rows, the grid errors.
If there are multiple row, of raw data, the grid populates correctly - including the 'triple' row that on its own is the problem.
I will see if I can create an example and add it to this thread as the code being used is complex
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garethm
over 8 years ago
Attached is a simple application with 1 interface and 1 expression that duplicates what is happening in my actual environment.
There are 2 datasets, 1 with a 2 arrays of data which works correctly, and 1 which only has 1 data array which results in the error
exampleGridLayout.zip
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 8 years ago
Hi Gareth
I've seen this before.... problem is I can't remember how I got round it last time! I assume you can test the length of the array, if there is only one row just run the gridRows expression with a fixed index of 1 and without the applyComponents - this works in your test app, not sure about your actual design though.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garethm
over 8 years ago
Hiya Tim,
If count(dataset) = 1 I am calling the rule without the applycomponents and that was taking care of the problem, however, in my real world, the dataset is split into sections defined by a non-displayed field, with the sections separated by a subtotal row.
As long as at least 1 of these sections contains 2 or more rows the grid renders.
When there is only 1 data row in each of the sections, the issue is occurring.
A little digging later and (using the example attached above)
the dataType returned from rule!exampleGridRows is:
Dataset1 = Type 1233 (RowLayout?list) and count() = 4
Dataset2 = Type 197 (List of Variant) and count() = 1
Something seems wrong here in the way a!applyComponents is being applied.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 8 years ago
Thanks for the example app. I have created a ticket with Engineering for this issue (AN-62333)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garethm
over 8 years ago
Abhi - Thanks, but I will also raise a support ticket referencing this thread as it is affecting our live environment and needs speedy resolution.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 8 years ago
For the record, the workaround would be to wrap the applycomponents in a cast() to type!RowLayout?List
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel