Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read formControlRange Value after pressing a button
#3
(05-01-2020, 02:26 PM)Alexandre Machado Wrote: In this same form, add a hidden field to the Form's HiddenField property as:

formControlRange=abcd


in this case, "abcd" is the default value. you can leave it empty too. The name must match the id of the input control.

When the form gets submitted, formControlRange will be one of the request fields, which can be obtained as usual from the WebApplicaiton.Request.Params object.

don't work. Result value is the default .
Changed Value not update to IW_formControlRange Field.
....................................
Hidden Field  name must be IW_formControlRange.
....................................
object IWForm2: TIWForm2
  Left = 0
  Top = 0
  Width = 979
  Height = 438
  RenderInvisibleControls = True
  AllowPageAccess = True
  ConnectionMode = cmAny
  ExtraHeader.Strings = (
   
      '<style>'#13#10'.bootstrap-select.show-tick .dropdown-menu .selected sp' +
      'an.check-mark'#13#10'{'#13#10'  left: 10px;'#13#10'}'#13#10'.bootstrap-select.btn-group' +
      ' .dropdown-toggle .filter-option'#13#10'{'#13#10'    display: inline-block;'#13 +
      #10'    overflow: hidden;'#13#10'    text-align: left;'#13#10'    white-space: ' +
      'normal;'#13#10'    width: 100%;'#13#10'    word-wrap: break-word;'#13#10'}'#13#10'.boots' +
      'trap-select .filter-option'#13#10'{'#13#10'  white-space: normal;'#13#10'}'#13#10'</styl' +
      'e>')
  HiddenFields.Strings = (
    'IW_formControlRange=abc')
  Background.Fixed = False
  LayoutMgr = IWBS4LayoutMgr1
  HandleTabs = False
  LeftToRight = True
  LockUntilLoaded = True
  LockOnSubmit = True
  ShowHint = True
  JavaScript.Strings = (
   
      '$(document).ready(function(){$('#39'[data-toggle="tooltip"]'#39').toolti' +
      'p();});')
  DesignLeft = 2
  DesignTop = 2
  object IWBS4Region2: TIWBS4Region
    Left = 56
    Top = 24
    Width = 825
    Height = 353
    Css = ''
    HeightRender = False
    Text = ''
    WidthRender = False
    BSRegionType = bs4rtContainer
    object IWBS4Button1: TIWBS4Button
      Left = 32
      Top = 176
      Width = 200
      Height = 25
      CustomAsyncEvents = <
        item
        end>
      ScriptInsideTag = False
      OnAsyncClick = IWBS4Button1AsyncClick
      IconOnRight = False
      Caption = 'ReadSlideValue'
      ModalKeyboardEscape = False
      Tooltip.Delay = 0
      Tooltip.Trigger = 'focus hover'
    end
    object IWBS4Region1: TIWBS4Region
      Left = 32
      Top = 35
      Width = 713
      Height = 121
      Css = ''
      HeightRender = True
      RawText = True
      Text =
        '<label for="formControlRange">Example Range input</label>'#13#10'<inpu' +
        't type="range" min="1" max="100" value="20" class="form-control-' +
        'range" id="IW_formControlRange">'
      WidthRender = True
    end
  end
  object IWBS4LayoutMgr1: TIWBS4LayoutMgr
    Left = 704
    Top = 216
  end
end
-------------------------------------
unit Unit2;

interface

uses
  Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, IWVCLComponent,
  IWBaseLayoutComponent, IWBaseContainerLayout, IWContainerLayout,
  IWBS4LayoutMgr, Vcl.Controls, IWVCLBaseControl, IWBaseControl,
  IWBaseHTMLControl, IWControl, IWBS4CustomControl, IWBS4CustomInput, IWBS4Input,
  Vcl.Forms, IWVCLBaseContainer, IWContainer, IWHTMLContainer,
  IWHTML40Container, IWRegion, IWBS4Cal, IWBS4CustomRegion, IWBS4InputForm,
  IWBS4Controls, IWBS4Flexbox, IWBS4Region, IWBS4Button,
  IWHTMLTag;

type
  TIWForm2 = class(TIWAppForm)
    IWBS4LayoutMgr1: TIWBS4LayoutMgr;
    IWBS4Region2: TIWBS4Region;
    IWBS4Region1: TIWBS4Region;
    IWBS4Button1: TIWBS4Button;
    procedure IWBS4Button1AsyncClick(Sender: TObject; EventParams: TStringList);
  private
  public
  end;

implementation

{$R *.dfm}

procedure TIWForm2.IWBS4Button1AsyncClick(Sender: TObject;
  EventParams: TStringList);
var
  S,N: String;
  oApp: TIWApplication;
begin
  S:='';
  N:='IW_formControlRange';
  oApp:=WebApplication;
  oApp.ShowMessage(oApp.Request.Params.Text);

  if oApp.Request.HasField(N)then
    oApp.ShowMessage(oApp.Request.GetQueryFieldValue(N))
  else
    oApp.ShowMessage(N+' Not Found.');
end;


initialization
TIWForm2.SetAsMainForm;

end.
-----------------------------------------------------
callback=IWBS4BUTTON1.DoOnAsyncClick IW_Action= IW_ActionParam= IW_AjaxID=15883695805240 IW_FormClass=TIWForm2 IW_formControlRange=abc IW_FormName=IWForm2 IW_height= IW_Offset= IW_SessionID_=CNPgn5l~BnnMewHiSRvX2G7BU~W IW_TrackID_=1 IW_width= IW_WindowID_= modifiers= which=0 x=43 y=15
------------------------------------------------------
Reply


Messages In This Thread
RE: How to read formControlRange Value after pressing a button - by newsanti - 05-01-2020, 10:01 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)