Form.pm
:
sub renderForDisplay { my ( $this, $meta ) = @_;I've been using these changes for nearly a year. I would probably just
my $templates = $this->{session}->templates; $templates->readTemplate('formtables');
my $text = ''; my $rowTemplate = $templates->expandTemplate('FORM:display:row'); foreach my $fieldDef ( @{ $this->{fields} } ) { my $fm = $meta->get( 'FIELD', $fieldDef->{name} ); next unless $fm; my $fa = $fm->{attributes} || ''; if ($fa =~ /S/) { next unless ( $fm->{value} ); # suppress if no value. RCL 2009-03-25 } unless ( $fa =~ /H/ ) { my $row = $rowTemplate;
# Legacy; was %A_TITLE% before it was $title $row =~ s/%A_TITLE%/\$title/g; $row =~ s/%A_VALUE%/\$value/g; # Legacy $text .= $fieldDef->renderForDisplay( $row, $fm->{value} ); } }
next if ($fa =~ /H/)
for the H attribute instead of starting a block, but it is about the same.
-- RaymondLutz - 17 Feb 2010
Parsing the formfield attributes has always been underused. So making more use of it is a good thing. However, I'd prefer to parse the attrs somewhat more safer, more rationalized. For now checking for a specific char in it is quite ad hoc. Let's make it a proper comma-separated list, then split it and check for any flags in it. Without, I have to add myself to ConcernRaisedBy unfortunately.
The proposal is missing a DateOfCommitment.
-- MichaelDaum - 17 Feb 2010
We have two attributed today. hidden and mandatory. H and M. And the syntax is HM or H or M or none.
Bad yes, but reality. We must not break compatibility for this.
Then I will raise the concern.
-- KennethLavrsen - 17 Feb 2010
Lets move on with a comma seperated list and mark no-delimitter-concatenation as deprecated. Since we have 23 letters left, there is no need to hurry the deprecation.
-- OliverKrueger - 17 Feb 2010
Note, that we've got a lower case h
attribute: not documented but there for ages. We better get these things out of the morgue.
-- MichaelDaum - 17 Feb 2010
I absolutely need the attributes field to be properly split by commas for a future WYSIWYG formfields implementation to work in a flexible, maintainable way...
In fact I can see now that my intended use of attributes column will probably introduce much breakage, if people are scanning for an individual char.
I need to be able to count on the attributes column being used/abused much the same as we do in the type column.
-- PaulHarvey - 18 Feb 2010
I've been wrapping IFs around form fields in my templates for ages - this would be a great feature! That is, assuming compatibility isn't hosed.
Paul - are you suggesting that the code be re-factored to accept single chars for backwards compatibility, but switch to comma-separated lists moving forward?
-- AaronFuleki - 19 Feb 2010
I have no problem with the additional attribute. I have a problem with the implementation.
I hope an attributes column could look something like:
M, EDITOR=TinyMCEPlugin+styles+headings+lists, HOver in the Type column, would be a policy for the HTML2TML part that did something like this:
textarea, tml=strict+notablesSo my concern is that the proposed code will not be compatible with my planned usage of the attributes field. -- PaulHarvey - 19 Feb 2010 I've removed my concern. As usual it was out of scope for the proposal in question. -- PaulHarvey - 20 Feb 2010 Moved some brainstorming about coming up with a new way to do DataForm definition topics at BrainstormingDataFormDefinitions. The take-home point was written by CrawfordCurrie:
Currently the attribute column consists of a number of non-space characters, and is scanned using-- PaulHarvey - 20 Feb 2010 After some adventurous BrainstormingDataFormDefinitions - which is really beyond 1.1 scope - I am wondering if we can't just create an attributes parser (well, it would just return an array split by comma) and extend the FormFieldDefinition API. We could create a special case for MH and HM forms (where the new syntax is supposed to be M,H or H,M). What would it break? -> plugins using the old API. What else? -- PaulHarvey - 20 Feb 2010 In FlexFormPlugin's RENDERFORDISPLAY there is an hideempty parameter to do that. Bringing this feature to the core should not be that hard. However the CommittedDeveloper never followed up. Parking. -- MichaelDaum - 20 Jul 2021m/M/
andm/H/
. Thus the syntax of the baseattributes
column can be defined as a set of single-character boolean attributes separated by \W*. If we take that as the "compatibility baseline" then we have absolutely no scope for more sophisticated syntax in that column (I have seen "Mandatory Hidden" in that column before now). So, I can't see any alternative to adding a new column, to support the extended attribute syntax Paul is proposing.
TopicSummary | Introduce new attribute for data field to allow hiding empty fields |
CurrentState | ParkedProposal |
CommittedDeveloper | RaymondLutz |
ReasonForDecision | None |
DateOfCommitment | |
ConcernRaisedBy | MichaelDaum |
BugTracking | |
RelatedTopics | |
PlannedFor |