Agent skill
jsf-ajax
JSF AJAX update rules for the HMIS project. Use when working on AJAX updates, p:commandButton update attributes, PrimeFaces AJAX callbacks, partial page rendering, or debugging AJAX update failures. Critical rules to prevent silent AJAX failures.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/jsf-ajax
SKILL.md
JSF AJAX Update Guidelines
Critical Rules
- AJAX UPDATE RULE: NEVER use plain HTML elements (div, span) with id attributes for AJAX updates - use JSF components (
h:panelGroup,p:outputPanel) instead - RENDERED ATTRIBUTE RULE: NEVER use
renderedon plain HTML elements - JSF ignores it; useh:panelGroup layout="block"instead - COMPONENT REFERENCES: Use
p:resolveFirstComponentWithIdfor updates:update=":#{p:resolveFirstComponentWithId('componentId',view).clientId}" - NO CSS/jQuery SELECTORS: NEVER use
@(.class),@(#id),@parentinupdateorprocessattributes. Use@this,@form, explicit IDs, or:#{p:resolveFirstComponentWithId(...)}
Wrong vs Correct
<!-- WRONG - Plain HTML, AJAX silently fails -->
<div id="stockSelection">
<!-- content -->
</div>
<p:commandButton update="stockSelection" />
<!-- CORRECT - JSF component, AJAX works -->
<h:panelGroup id="stockSelection">
<div><!-- content --></div>
</h:panelGroup>
<p:commandButton update="stockSelection" />
Updating Growl/Messages
The growl component is in template.xhtml outside forms. Use absolute ID with colon prefix:
<!-- CORRECT -->
<p:commandButton action="#{bean.save}" update="myTable :growl" />
<!-- WRONG - Do NOT use CSS selectors -->
<p:commandButton update="@(.ui-growl)" />
JSF Components for AJAX Updates
h:panelGroup- Lightweight wrapper, no HTML outputp:outputPanel- PrimeFaces panel, renders as<span>or<div>h:div- Renders as HTML<div>h:form- For updating entire form sectionsp:panel- Full-featured panel with header/footer
Debugging
- Check browser console for JavaScript errors
- Verify target element is a JSF component (not plain HTML)
- Use browser dev tools to confirm JSF-generated id
- Test with
h:panelGroupwrapper if updates fail - Check component hierarchy - nested components affect id resolution
For complete reference, read developer_docs/jsf/ajax-update-guidelines.md.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?