Jump to content

What is the problem is this code


molla2005b

Recommended Posts

i have a frame as Component (TFindAccountFrame)
this frame contain a combobox named cmbAccount
I want to move the focus from a control to
cmbAccount by Enter key

but this code note work : frmOrder.FindAccountFrame.cmbAccount.focus();

How I can get the right name of cmbAccount in specialkey evevt.

 

thanks

Link to comment
Share on other sites

i made similar thing .. for me works:

 

 

 

(MainForm.FCurrentFrame1 as Tmy_frame_name).uniedit .. set focus

 

 

 

 

FCurrentFrame1 is TUniFrame

 

 

i load frames with:

procedure TMainForm.InsertFrame1(Name: string);   
begin
      if FFrameName1 <> '' then FreeAndNil(FCurrentFrame1);
      FFrameName1:=Name;
      FCurrentFrame1:=TUniFrameClass(FindClass(Name)).Create(self);
      FCurrentFrame1.Align:=alClient;
      FCurrentFrame1.Parent:=display;//uniscrollbox1;
Link to comment
Share on other sites

Thanks all

my problem in javascript code

finally I slove it by this code

 s:='function specialkey(sender, e, eOpts) '+
    ' { '+
    '  if (!(e.shiftKey) && (e.getKey() == 13))'+
    '  {   '+
    '       e.stopEvent();  '+
    '     '+FindAccountFrame.cmbAccount.JSName+'.focus();'+
    '  }'+
    ' }';

 cmbType.ClientEvents.ExtEvents.Values['specialkey']:=s;

but why frmOrder.FindAccountFrame.cmbAccount.focus(); not work?

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...