简体   繁体   English

如何从.jsf页面adf 12c中的函数获取返回值?

[英]How can I get returned value from function in .jsf page adf 12c?

I am calling a function on page load (.jsf page programmatically) and it's working fine, but function is returning (0 or 1) string value. 我在页面加载(以编程方式编写.jsf页面)时调用了一个函数,并且运行良好,但是函数返回的是(0或1)字符串值。 I want to show or hide buttons based on returning value in jsf page. 我想根据jsf页面中的返回值显示或隐藏按钮。

How can I get returning value on .jsf page? 如何在.jsf页面上返回值?

How can I apply logic of show and hide based on returning value? 如何根据返回值应用显示和隐藏的逻辑?

Here is how I am calling function on page load 这是我在页面加载时调用函数的方式

<f:metadata>
        <?audit suppress oracle.ide.xml.validation-error?>
        <f:event type="preRenderView" listener="#{backingBeanScope.backing_login.viewPrivilidge('Program')}"/>
</f:metadata>

Here is the code of button on which i want to apply logic 这是我要在其上应用逻辑的按钮的代码

 <af:button text="Supplier" id="b4" inlineStyle="width:190px;"
            destination="Supplier_Setup.jsf" icon="#{resource['images:supplier.png']}"/> 

I am using .jsf page in adf 12c. 我在adf 12c中使用.jsf页面。

Be careful with the use of Rendered. 使用“渲染”时要小心。 Rendered = false prevents any markup from being generated for that component. Rendered = false阻止为该组件生成任何标记。 That means you can't simply set rendered = true on the component and expect it to appear - it won't. 这意味着您不能简单地在组件上设置rendered = true并期望它出现-它不会。 In this case you have to refresh a containing layout manager to get it to render. 在这种情况下,您必须刷新包含的布局管理器以使其呈现。 You probably want Visible=false here, then the markup is generated for the component and setting visible = true will make the component appear. 您可能希望在此处使用Visible = false,然后为组件生成标记,将visible == true设置将使组件出现。

Rendered is often reserved for secure components where you do't want the markup in the page source at all. Rendered通常是为安全组件保留的,这些组件根本不需要页面源中的标记。

only you need to call function in render attribute of that tag where you want to apply logic 只有您需要在要应用逻辑的标记的render属性中调用函数

<af:button text="Supplier" id="b4" inlineStyle="width:190px;"
            rendered="#{backingBeanScope.backing_login.viewPrivilidge('Program') == '1'}"           destination="Supplier_Setup.jsf" icon="#{resource['images:supplier.png']}"/> 

"#{backingBeanScope.backing_login.viewPrivilidge('Program') == '1'}" .......... if your returning value is equal to '1' then it will render otherwise it will not render “#{backingBeanScope.backing_login.viewPrivilidge('Program')=='1'}” ..........如果您的返回值等于'1',则它将呈现,否则将不呈现

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从JSF / ADF验证器获取旧值? - How to get old value from JSF/ADF validator? 我如何从j2ee webapp将pdf文件保存在oracle 12c数据库中 - How can i save a pdf file in oracle 12c database from j2ee webapp WebLogic 12c上的JSF 2中的Stackoverflow错误 - Stackoverflow error in JSF 2 on WebLogic 12c Oracle ADF 12c 中的条件必填字段 - Conditional Required field in Oracle ADF 12c Oracle Database 12c:如何从包含搜索中获取结果索引 - Oracle Database 12c: How to also get the result index from a contains search 如何使用jdbc数据源在Weblogic 12C中实现容器管理的身份验证? - How can I implement container managed authentication in Weblogic 12C using a jdbc data source? WebLogic 10.3.6 升级到 12c,从 JSF 1.1 迁移到 1.2 会导致错误,特别是在尝试查找 JSF 1.2 库时 - WebLogic 10.3.6 Upgrade to 12c, Migration from JSF 1.1 to 1.2 results in errors specifically when trying to find the JSF 1.2 library JSF 2 - 如何使用JSF EL从web.xml获取上下文参数值? - JSF 2 - How can I get a context-param value from web.xml using JSF EL? Weblogic 12c中如何处理异常? - How are exceptions handled in Weblogic 12c? 从jsf页返回的实体保留为空值 - the entity returned from the jsf page is persisted with a null value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM