如何从AMX页面的MAF表单布局(只读表单)中获取价值? [英] How to get value from MAF form layout(read-only form) from amx page?

查看:65
本文介绍了如何从AMX页面的MAF表单布局(只读表单)中获取价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有只读表格.如果用户按是"按钮,我想删除与任务ID相关的表格.但是我无法捕获taskid的值以将其发送到我的java类.我怎样才能做到这一点?我正在尝试执行此操作,但由于无法从表单布局中获取价值而无法删除.

I have read-only form. I want to delete form related to task id, if user press Yes button . But i am not able to capture value of taskid to send it to my java class. How can i achieve this? I m trying to do this but not able to delete because i am not getting value from the form layout.

我想知道如何通过具有actionListener =#{closeTask.click}"的yes按钮将taskid(value =#{bindings.taskId.inputValue}")的值发送到我的Java类.

I want to know how to send value of taskid(value="#{bindings.taskId.inputValue}") through yes button having actionListener="#{closeTask.click}" to my java class.

这是我的amx页面.

Here is my amx page.

<?xml version="1.0" encoding="UTF-8" ?>

<amx:view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:amx="http://xmlns.oracle.com/adf/mf/amx"

          xmlns:dvtm="http://xmlns.oracle.com/adf/mf/amx/dvt">

  <amx:panelPage id="pp1" >

    <amx:facet name="header">

      <amx:outputText value="Task Details" id="ot1"/>

    </amx:facet>

    <amx:facet name="primary">

      <amx:commandButton id="cb1" action="__back"/>

    </amx:facet>

    <amx:facet name="secondary">

      <amx:commandButton id="cb2"/>

    </amx:facet>

    <amx:validationGroup id="group2">

      <amx:panelFormLayout id="pfl1">

        <amx:panelLabelAndMessage label="#{bindings.taskId.hints.label}" id="plam2">

          <amx:outputText value="#{bindings.taskId.inputValue}" id="ot3"

                          rendered="#{bindings.taskId}"/>

        </amx:panelLabelAndMessage>

        <amx:panelLabelAndMessage label="#{bindings.taskType.hints.label}" id="plam1">

          <amx:outputText value="#{bindings.taskType.inputValue}" id="ot2"/>

        </amx:panelLabelAndMessage>

        <amx:panelLabelAndMessage label="#{bindings.taskName.hints.label}" id="plam3">

          <amx:outputText value="#{bindings.taskName.inputValue}" id="ot5"/>

        </amx:panelLabelAndMessage>

      </amx:panelFormLayout>

    </amx:validationGroup>







    <amx:commandButton text="DELETE" id="cb3"   inlineStyle="left:150px;"  >

    <amx:validationBehavior id="validationBehavior2" group="group2"/>



     <amx:showPopupBehavior popupId="popup1"

                                align="topStart" alignId="pp1" type="action" decoration="anchor" id="spb1"/>



                                 </amx:commandButton>

  </amx:panelPage>

   <amx:popup id="popup1"



              animation="slideUp"

              backgroundDimming="on"

              autoDismiss="true">

    <amx:commandButton text="No" id="cb4" action="__back"/>

    <amx:outputText value="Are you sure?" id="ot4"/>

   <amx:commandButton text="Yes" id="cb5"  actionListener="#{closeTask.click}" />          FROM HERE I AM GETTING THE ISSUE.

    </amx:popup>

</amx:view>

推荐答案

有几种方法可以访问java类中的绑定值. 首先尝试使用closeTask.click方法:

there are few ways to access bindings value in java class. First try inside closeTask.click method:

        ValueExpression ve =
        AdfmfJavaUtilities.getValueExpression("#{bindings.taskId.inputValue}", String.class);
    String taskId = (String) ve.getValue(AdfmfJavaUtilities.getELContext());

或者,您可以添加propertylistener来在按钮中传递temp变量:

Alternatively you could add propertylistener to pass temp variable in your button:

<amx:commandButton text="Yes" id="cb5">
   <amx:setPropertyListener from="#{bindings.taskId.inputValue}" 
     to="#{viewScope.YourBean.valueHolder}" type="action" id="spl5"/>
            </amx:commandButton> 

并在更改vauleHolder时调用closeTask.click: 在YourBean.java中:

And call closeTask.click when vauleHolder is changed: in YourBean.java:

private String valueHolder; //declare var

  public void setValueHolder(String valueHolder) {
  this.valueHolder = valueHolder;
  closeTask.click(valueHolder) // call your method here with passed taskid
}

希望对您有帮助.

这篇关于如何从AMX页面的MAF表单布局(只读表单)中获取价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆