无锡朝阳网站建设,滁州网站开发公司电话,网络公司名字大全,企业网站货物查询怎么做在我以前的文章中#xff0c;我答应展示如何为智能值列表创建ADF声明性组件。 因此#xff0c;我将创建一个包含三个元素的组件#xff1a;标签#xff0c;输入文本和值的组合框列表。 那很容易。 我在工作空间中创建了一个单独的ADF ViewController项目#xff1a; 在此项… 在我以前的文章中我答应展示如何为智能值列表创建ADF声明性组件。 因此我将创建一个包含三个元素的组件标签输入文本和值的组合框列表。 那很容易。 我在工作空间中创建了一个单独的ADF ViewController项目 在此项目中打开“创建JSF声明性组件”向导 新的声明性组件smartLovDef应该至少具有三个属性用于标签的一些字符串用于输入文本的属性绑定和用于组合框值列表的LOV绑定 该向导创建元数据文件declarativecomp-metadata.xml和smartLovDef.jspx文件我们可以在其中放置组件的内容 smartLovDef.jspx的源代码如下所示 ?xml version1.0 encodingUTF-8?
jsp:root xmlns:jsphttp://java.sun.com/JSP/Page version2.1xmlns:fhttp://java.sun.com/jsf/corexmlns:hhttp://java.sun.com/jsf/htmlxmlns:afhttp://xmlns.oracle.com/adf/faces/richjsp:directive.page contentTypetext/html;charsetUTF-8/af:componentDef varattrs componentVarcomponentaf:panelLabelAndMessage label#{attrs.label} idplam1af:panelGroupLayout idpgl1 layouthorizontalaf:inputText value#{attrs.attrBinding.inputValue}required#{attrs.attrBinding.hints.mandatory}columns#{attrs.attrBinding.hints.displayWidth}iddeptid partialTriggersdepartmentNameIdautoSubmittrue simpletrue/af:inputComboboxListOfValues iddepartmentNameIdpopupTitleSearch and Select: #{attrs.lovBinding.hints.label}value#{attrs.lovBinding.inputValue}model#{attrs.lovBinding.listOfValuesModel}columns#{attrs.lovBinding.hints.displayWidth}shortDesc#{attrs.lovBinding.hints.tooltip}partialTriggersdeptidsimpletrue/af:inputComboboxListOfValues/af:panelGroupLayout/af:panelLabelAndMessageaf:xmlContentcomponent xmlnshttp://xmlns.oracle.com/adf/faces/rich/componentdisplay-namesmartLovDef/display-nameattributeattribute-namelabel/attribute-nameattribute-classjava.lang.String/attribute-classrequiredtrue/required/attributeattributeattribute-nameattrBinding/attribute-nameattribute-classjava.lang.Object/attribute-classrequiredtrue/required/attributeattributeattribute-namelovBinding/attribute-nameattribute-classjava.lang.Object/attribute-classrequiredtrue/required/attributecomponent-extensioncomponent-tag-namespacecscomponent/component-tag-namespacecomponent-taglib-uri/componentLib/component-taglib-uri/component-extension/component/af:xmlContent/af:componentDef
/jsp:root 下一步是将组件部署到ADF库中。 我们必须为CSComponents项目添加新的部署配置文件 然后将项目部署到库中 下一步是在资源面板中定义到CSComponents项目的部署路径的文件系统连接 之后我们必须选择要使用新组件的项目在我的情况下为ViewConroller然后向其中添加CSComponents.jar库 现在我们可以在页面中使用smartLovDef组件并将其从组件面板中拖动 在我们的jspx页面中源代码将如下所示 cscompLib:smartLovDef label#{bindings.DepartmentId.label}attrBinding#{bindings.DepartmentId} lovBinding#{bindings.DepartmentName}idsld1/ 参考 JCG合作伙伴提供的 ADF声明性组件示例 ADF实践博客上的Eugene Fedorenko。 翻译自: https://www.javacodegeeks.com/2012/03/adf-declarative-component-example.html