WW-3429 Add configurable checkbox hidden field prefix#1570
Open
lukaszlenart wants to merge 1 commit intomainfrom
Open
WW-3429 Add configurable checkbox hidden field prefix#1570lukaszlenart wants to merge 1 commit intomainfrom
lukaszlenart wants to merge 1 commit intomainfrom
Conversation
Add struts.ui.checkbox.hiddenPrefix constant to allow configuring the checkbox hidden field prefix, addressing HTML validation warnings about double underscores while maintaining backward compatibility. Changes: - Add STRUTS_UI_CHECKBOX_HIDDEN_PREFIX constant to StrutsConstants - Add default value __checkbox_ to default.properties - Update Checkbox component to inject and pass prefix to templates - Update CheckboxInterceptor to use configurable prefix - Update simple/checkbox.ftl and html5/checkbox.ftl templates - Update CheckboxHandler in javatemplates plugin - Add tests for configurable prefix functionality - Fix bug in CheckboxHandler where value was incorrectly prefixed Configuration example: struts.ui.checkbox.hiddenPrefix=struts_checkbox_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
struts.ui.checkbox.hiddenPrefixconstant to allow configuring the checkbox hidden field prefix__checkbox_maintains backward compatibilitystruts_checkbox_or other prefix for HTML5 complianceFixes WW-3429
Changes
StrutsConstants.javaSTRUTS_UI_CHECKBOX_HIDDEN_PREFIXconstantdefault.properties__checkbox_Checkbox.javaCheckboxInterceptor.javasimple/checkbox.ftl${attributes.hiddenPrefix}html5/checkbox.ftl${attributes.hiddenPrefix}CheckboxHandler.javaCheckboxInterceptorTest.javaCheckboxTest.java(javatemplates)Configuration
Default (backward compatible):
No configuration needed - uses
__checkbox_HTML5 Compliant:
Or in
struts.properties:struts.ui.checkbox.hiddenPrefix=struts_checkbox_Test plan
CheckboxInterceptorTest- 12 tests passCheckboxTest(core) - 21 tests passCheckboxTest(javatemplates) - 6 tests pass🤖 Generated with Claude Code