zanona Posted September 19, 2017 Share Posted September 19, 2017 How do I pass parameters via url creating new page? In the demo example, that's it! http://localhost:8077/?button=BB&edit=AA But I would have to call it a new form, it can not be the mainform! EX: http://localhost:8077/myforms2/?Button=BB&edit=AA Thansk's Zanona Link to comment Share on other sites More sharing options...
leandroavila74 Posted September 19, 2017 Share Posted September 19, 2017 How do I pass parameters via url creating new page? In the demo example, that's it! http://localhost:8077/?button=BB&edit=AA But I would have to call it a new form, it can not be the mainform! EX: http://localhost:8077/myforms2/?Button=BB&edit=AA 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 More sharing options...
billyChou Posted September 22, 2017 Share Posted September 22, 2017 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now