Files
skidus f705cd11b9 feat: implement advanced bidirectional field referencing and cross-module path resolution
- Core Logic Enhancements:
    - Implement bidirectional field referencing between <FIELDS>, <LAYOUT>, and <TITLES> tags in .frml files, enabling seamless navigation from definitions to usages and vice versa.
    - Add robust support for AJAX-OPTION field mapping:
        - SRC attribute: Links to field definitions within defs/ajax.xml datasets.
        - TARGET attribute: Links to local field definitions within the same form.
    - Implement global grid resolution: GRID-ID now searches across the current file and all recursively included files (<INCLUDE>).
    - Enhance deep recursive search for fields/sections within nested tags like <SECTION>, <ROW>, and <FIELD-LIST>.

- Path Resolution & Helpers (DynFormPathUtils):
    - Added support for module-relative paths starting with # (mapping to view/frm/).
    - Added support for cross-module paths starting with / (mapping to WEB-INF/app/module/{module}/view/frm/).
    - Implemented auto-correction for common keyboard typos (Thai 'ิ' instead of /).
    - Added specialized helpers for locating ajax.xml and included files within the framework's structure.

- Smart Completion Enhancements:
    - Added context-aware completion for TARGET and SRC fields in AJAX update-fields.
    - Enabled global GRID-ID completion by scanning all included resources.
    - Improved dataset completion to include both local and AJAX-defined datasets.

- Test Resources:
    - Added a comprehensive set of real-world examples (bdgt04, bdgt05, bdgt06) in DevResources/full-examples/ to validate complex cross-module and master-detail scenarios.
2026-04-10 12:56:04 +07:00

52 lines
2.0 KiB
Plaintext

<%@ page import="org.apache.commons.codec.*" %>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/app/system/dynf/dynfSysInfo.jsp" %>
<!-- =========================================================================================== -->
<h1 class="page-header"><%=pageItemInfo.getProgTitle()%></h1>
<%
String _formId = "bdgt-0403020/general";
try {
String data = factory.rqsCtx.getParameter("data","");
if (!data.isBlank()) {
data = JUtils.decBase64(data);
data = URLDecoder.decode(data, CharEncoding.UTF_8);
boolean isEditMode = factory.rqsCtx.isPostParam("add") || factory.rqsCtx.isPostParam("edit") || factory.rqsCtx.isPostParam("view");
JSONObject jsData = new JSONObject(data);
String type = jsData.getString("type");
String acmCode = jsData.getString("acm_code");
String projId = jsData.getString("proj_id");
if (isEditMode && type.equals("rutn")) {
_formId = "bdgt-0403020/routine";
} else if (isEditMode && type.equals("mngt")) {
_formId = "bdgt-0403020/manage";
} else if (isEditMode && type.equals("eqpt")) {
_formId = "bdgt-0403020/equipt";
} else if (isEditMode && type.equals("cnst")) {
_formId = "bdgt-0403020/construct";
}
dynForm = new DynForm(application, request, response, "bdgt04", _formId);
dynForm.setFormOwner(request.getRequestURL().toString());
dynForm.setFormvar("ACM_CODE",acmCode);
dynForm.setFormvar("PROJ_ID",projId);
} else {
dynForm = new DynForm(application, request, response, "bdgt04", _formId);
}
dynForm.setFormvar("STM_CODE",factory.user.getUSER_DEPT_CODE());
if (dynForm.workIn(WorkMode.Editing)) {
factory.pageCtx.addWidget(DynConstants.PageWidget.FileBox);
%><%@ include file="/WEB-INF/app/system/dynf/dynfDataEdit.jsp" %><%
} else {
%><%@ include file="/WEB-INF/app/system/dynf/dynfDataList.jsp" %><%
}
} catch (Exception ex) {
factory.setRestCode("ERROR");
factory.setRestMsg(ex.getMessage() + "\n" + JUtils.stackToString(ex,16));
logger.error(ex.getMessage(),ex);
}
%>