Jump to content

zhyhero

uniGUI Subscriber
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by zhyhero

  1. you need  create form

    procedure TMainForm.UniButton1Click(Sender: TObject);
    var
      x: TUniform1;
    begin
      x := TUniform1.Create(Uniapplication);
      x.Parent := self.UniTabSheet2;
      x.Show;
    end;

     

    form_in_tabsheet.gif.7ed635b16c9e3d643936a7e05750aee9.gif

  2. About call subform, I create it dynamically and show it with callback procedure 

    mainform openbutton event

    fsubform:=Tsubform.create(uniapplication);

    fsubform.show(callback); // or showmodal(callback)  

    you need  a callback procedure in mainform like

    procedure mainform.callback(sender:Tcomponent;aResult:integer);

    begin

    if aResult=mrYes then {do something};

    //if sender is TSubform then TSubform(sender).something;

    end;

    in subform ,you can close subform with code modalresult:=mrYes; {or mrNo,mrCancel ..}

    the execute process is:

     mainform.buttonclick--->subform.create----->subform.show(callback)---->subform.someevent------>subform.modalresult(maybe write in buttonclick)----->mainform.callback

    And no need to enable or disable mainform buttons in subform,do this with callback. 

    I hope this will help you.

     

  3. Try ajaxRequest.

    UniCombobox -> ClientEvents -> ExtEvents -> beforeselect :

    function beforeselect(combo, record, index, eOpts)
    {
      ajaxRequest(combo,'bselect',['index='+index]);
    }

    UniCombobox -> OnAjaxEvent :

    procedure TMainForm.UniComboBoxAjaxEvent(Sender: TComponent;
      EventName: string; Params: TUniStrings);
    begin
      if SameText(EventName,'bselect') then
      begin
        self.ShowToast(Params.Values['index']);
      end;
    end;

  4. I am testing something in scene of dynamic create Frame/Form .

    As a rule,  in one From or Form , we can call jscode  ajaxRequest(sender,"method",[{Params}] ); ,

    and respond to delphi procedure AjaxEvent(Sender: TComponent;  EventName: string; Params: TUniStrings); .

    sender ==>  Ext.getCmp("id"),     id ==> sender.id  (jscode) .

    id of Frame ==> frame.FormRegion.JsId; (pascalcode) .

    if we pass id  of target Frame to source Form ,  then we can call  target frame's method  by 

    begin

      self.unisession.addjs('ajaxRequest(Ext.getCmp("id"),"Method",[{params}])');

    end;

     in source Form .

    same thing with Frame and Frame.

    id of Form ,I can't get , (but we have form.show(callbackproc) and form.showmodal(callbackproc) ).

    So, how to get the JsId of a UniForm ?

     

×
×
  • Create New...