【问题标题】:How to save selected checkbox values and get it as checked when we move to the next page and come back to checkbox page当我们移动到下一页并返回复选框页面时,如何保存选定的复选框值并使其选中
【发布时间】:2019-01-22 10:04:26
【问题描述】:

我有一个带有复选框列的报告查询,在这里,当我们检查了一些值并总结时,它将在下一页移动,在第二页有一个返回选项,当我单击返回按钮时,它必须检查先前已检查并显示为已检查的值。

如何在 apex 中处理这个问题

我的报告查询:

SELECT DISTINCT APEX_ITEM.checkbox (1, ASSOCIATED_PARTY_ID) Select_Checkbox,
                FIRST_NAME || LAST_NAME AS Associated_Party,
                EMAIL AS Associated_Party_Email,
                associated_party_id,
                EMPLOYMENT_STATUS,
                LOCATION AS Current_Location,
                CITY || STATE_PROVISION AS City_State_Provision,
                MANAGER
  FROM ASSOCIATED_PARTIES
 WHERE associated_party_id IN (SELECT associated_party_id
                                 FROM matters_associated_parties
                                WHERE matter_id = :P10_MATTER_ID);

【问题讨论】:

  • 如果复选框已提交(如您所说),那么当您返回该页面时,它应该保持选中,所以......您不必做任何事情.

标签: oracle11g oracle-apex-5 oracle-apex-5.1


【解决方案1】:

您可以在前进时将选中的复选框 (ASSOCIATED_PARTY_ID) 保存在 Apex_collection 中。

如果用户返回,您可以从集合中加载所选的。

【讨论】:

    【解决方案2】:

    如果您转到另一个页面并返回旧页面,则选择将在那里。 p_checked_values =>:p604_blc_id 它是一个顶点项目,它将存储accociated_pa​​rty_id

    【讨论】:

      【解决方案3】:
              <pre>
              apex_item.checkbox2(p_idx => 1,
              p_value => blc.blc_id,
              p_attributes => 'class="blc_id" id="f01_'|| rownum|| '"',
              p_checked_values =>:p604_blc_id,
              p_checked_values_delimiter => ',')"Select All",
      
      
              <input type="checkbox" onclick="$f_CheckFirstColumn(this)" id="check_all"/>
      
      
      
      
              // Created by parthiban on 11-5-2016
      
              var
              //Checkbox that was changed
              $checkBox = $(this.triggeringElement),
              //DOM object for APEX Item that holds list.
              apexItemIDList = apex.item(this.affectedElements.get(0)),
              //Convert comma list into an array or blank array
              //Note: Not sure about the "?" syntax see: http://www.talkapex.com/2009/07/javascript-if-else.html
              ids = apexItemIDList.getValue().length === 0 ? [] : apexItemIDList.getValue().split(','),
              //Index of current ID. If it's not in array, value will be -1
              idIndex = ids.indexOf($checkBox.val())
              ;
      
              //If box is checked and it doesn't already exist in list
              if ($checkBox.is(':checked') && idIndex < 0) {
              ids.push($checkBox.val());
              }
              //If box is unchecked and it exists in list
              else if (!$checkBox.is(':checked') && idIndex >= 0){
              ids.splice(idIndex, 1);
              }
      
              //Convert array back to comma delimited list
              apexItemIDList.setValue(ids.join(','));
      
              </pre>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-01-25
        • 2019-09-09
        • 2011-08-24
        • 2021-05-17
        • 2014-11-22
        • 2018-12-07
        • 1970-01-01
        相关资源
        最近更新 更多