Jump to content

Parameters new page


zanona

Recommended Posts

 

How do I pass parameters via url creating new page? In the demo example, that's it!
 
 
 
But I would have to call it a new form, it can not be the mainform!
 
 
Thansk's
 
Zanona

 

You can not do this in unigui
every time you call the url localhost: 8077
will be starting a new session of unigui
and the mainform is created before its form2
what you can is do in the mainform onshow
check these call parameters and so call
the desired form
Link to comment
Share on other sites

1. in Main Form use other form

-------------------------------------

function MainForm: TMainForm;

implementation

{$R *.dfm}

uses
  uniGUIVars, MainModule, uniGUIApplication,  ServerModule, uniGUITheme,

  epo110a3;  //   project  define   epo110a3 in 'epo110a3.pas' {frm_epo110a3: TUniForm},

 

 

2.  in MainForm   UniFormShow event

---------------------------------

 

procedure TMainForm.UniFormShow(Sender: TObject);
var
  sText, sWhere, sKey : string;
  sJson : string;
  i,iCnt : integer;
  sM_src : string;
  sN_yy  : string;
  sYY : string;
  iYY :integer;
  bRet : boolean;
begin

 

  //http://localhost:8077/?button=BB&edit=AA
  //http://localhost:88/?stu_id=K122786910

 
  UniEdit1.Text :=UniApplication.Parameters.Values['sch_id'];
  UniEdit2.Text :=UniApplication.Parameters.Values['stu_id'];
 
 

  // 106.03.23
  //http://localhost:88/?stu_id2=A127337605
  //http://localhost:88/?stu_id2=A129946077

 

  UniEdit2.Text :=UniApplication.Parameters.Values['stu_id2'];
  if (UniEdit1.Text = '') and (UniEdit2.Text <> '' )then
  begin
   
    sUserid   := UniEdit2.Text;
    q_epo110.open;
    q_epo110.Refresh;

    bRet := q_epo110.Locate('n_stu',VarArrayOf([sUserid]),[]);
    if bRet then
    begin
    // OpenForm('Tfrm_epo110a1');
     if sUserid <> 'admin' then
     begin
       // sUserid   := '';
        sUserName := q_epo110.FieldByName('m_stu').Value;
        sUserCid  := q_epo110.FieldByName('c_id').Value;
      
       sWhere := 'n_stu = ' + quotedstr( sUserid ) ;                  // 建立者
     
       frm_epo110a3.q_main.Close;
       frm_epo110a3.q_main.DeleteWhere;
       frm_epo110a3.q_main.AddWhere(sWhere);
       frm_epo110a3.q_main.Open;

       vbStu_fr  := True;  // 由前台進入編輯


     end;
     


     frm_epo110a3.sbtn_dep.Visible := False;
     frm_epo110a3.sbtn_cla.Visible := False;
     frm_epo110a3.sbtn_tch.Visible := False;
     frm_epo110a3.sbtn_spc.Visible := False;
     //frm_epo110a1.UniButton4.Visible := False;      // 圖片

     frm_epo110a3.UniLabel33.Visible := False;

     frm_epo110a3.UniDBEdit12.Visible := False;
     frm_epo110a3.UniDBEdit13.Visible := False;
     frm_epo110a3.UniDBEdit19.Visible := False;
     frm_epo110a3.UniDBEdit29.Visible := False;
     frm_epo110a3.UniDBEdit30.Visible := False;

     //
     frm_epo110a3.UniDBEdit10.ReadOnly := True;
     frm_epo110a3.UniDBEdit11.ReadOnly := True;
     frm_epo110a3.UniDBEdit14.ReadOnly := True;
     frm_epo110a3.UniDBEdit15.ReadOnly := True;
     frm_epo110a3.UniDBDateTimePicker1.ReadOnly := True;
     frm_epo110a3.UniDBComboBox1.ReadOnly := True;

     //--------------------------------------
     frm_epo110a3.tlb_first.Visible := False;
     frm_epo110a3.tlb_prev.Visible := False;
     frm_epo110a3.tlb_next.Visible := False;
     frm_epo110a3.tlb_last.Visible := False;
     frm_epo110a3.tlb_copy.Visible := False;
     frm_epo110a3.tlb_add.Visible := False;
     frm_epo110a3.tlb_upd.Visible := True;
     frm_epo110a3.tlb_del.Visible := False;
     frm_epo110a3.tlb_upd.Visible := True;
     frm_epo110a3.tlb_inq.Visible := False;
     frm_epo110a3.tlb_tool.Visible := False;
     frm_epo110a3.tlb_exit.Visible := False;


     //frm_epo110a1.BorderIcons := [biMinimize,biMaximize];
     frm_epo110a3.BorderIcons := [];

     //frm_epo110a2.ShowModal();
     frm_epo110a3.Show();


     abort;


    end;
  end;


  end;

 

 

// parametter use base64 encoder

 

 

 

post-864-0-67279200-1506051471_thumb.png

post-864-0-33968400-1506051484_thumb.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...