Set focus on combobox

Ok, thanks Jose for the information.


________________________________
From: Jose Gomez <jose@...>
To: vantage@yahoogroups.com
Sent: Thursday, December 1, 2011 10:57 AM
Subject: Re: [Vantage] Set focus on combobox

Most of the Epicor's built in functionality has a setFocus on a specific
control so when you hit New Operation it runs through Epicor's logic and
then sets the focus, EpiNotify happens before the focus is set inside
trans.GetNewJobOper();

Below is the code that Epicor Runs, you can see that it calls the
getNewJobOper Function which at the end calls the SetFocusOnNewJobOper()
which then sets the focus on the operation Number, your only solution is to
add a Button to the Operation Screen which calls the oTrans.GetNewJobOper()
and then after that you move the focus your self with the Focus() method.



private bool getNewJobOper(bool newFromGrid)
{
bool _success = true;
try
{
_success = trans.GetNewJobOper();
if(_success)
{
if(!newFromGrid)
{
// SCR -19339 - set a flag to prevent update being triggered due to
// a view change happening while activing the form
trans.IgnoreUpdate = true;
SetFocusOnNewJobOper();
trans.IgnoreUpdate = false;
}
}
}
catch
{
_success = false;
trans.IgnoreUpdate = false;
}
return _success;
}
public void SetFocusOnNewJobOper()
{
if(this.s_operationSheet.EpiSelectedSheet == "operationList")
{
s_operationSheet.baseDockManager.PaneFromKey("operationList").Activate();
if(this.p_operationList.eugOperationList.ActiveRow != null)
{
p_operationList.eugOperationList.ActiveRow.Cells["OprSeq"].Activate();

p_operationList.eugOperationList.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode,false,false);
}
}
else
{
s_operationSheet.baseDockManager.PaneFromKey("operationDetail").Activate();
p_operationDetail.numOpr.Focus();
}
}





*Jose C Gomez*
*Software Engineer*
*
*
*checkout my new blog <http://www.usdoingstuff.com> *
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez>Â <http://www.facebook.com/josegomez>
 <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
 <http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
 <http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*



On Thu, Dec 1, 2011 at 10:32 AM, tkoch77 <tkoch77@...> wrote:

> **
>
>
> I am trying to set the focus to the operation dropdown on the Job Entry
> form -> Job Details -> Operations -> Detail when a user chooses to add a
> new operation. Currently it defaults to the Opr Numeric editor. I tried
> this bit of code and during debugging it hits the line of code to set the
> focus but it doesn't focus on the dropdown.
>
> Thanks,
>
> Ted
>
> Private Sub edvJobOper_EpiViewNotification(ByVal view As EpiDataView,
> ByVal args As EpiNotifyArgs)
> ' ** Argument Properties and Uses **
> ' view.dataView(args.Row)("FieldName")
> ' args.Row, args.Column, args.Sender, args.NotifyType
> ' NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow,
> NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
> If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
> If (args.Row > -1) Then
> Dim cboOp as Epicor.Mfg.UI.Controls.Combos.OpMasterCombo =
> CType(csm.GetNativeControlReference("98a978ae-10d5-464c-84e1-439a819c0679"),Epicor.Mfg.UI.Controls.Combos.OpMasterCombo)
> cboOp.Focus()
> End If
> End If
> End Sub
>

>


[Non-text portions of this message have been removed]



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

Useful links for the Yahoo!Groups Vantage Board are: ( Note:Â You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.%c2%a0
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links



[Non-text portions of this message have been removed]
I am trying to set the focus to the operation dropdown on the Job Entry form -> Job Details -> Operations -> Detail when a user chooses to add a new operation. Currently it defaults to the Opr Numeric editor. I tried this bit of code and during debugging it hits the line of code to set the focus but it doesn't focus on the dropdown.

Thanks,

Ted

Private Sub edvJobOper_EpiViewNotification(ByVal view As EpiDataView, ByVal args As EpiNotifyArgs)
' ** Argument Properties and Uses **
' view.dataView(args.Row)("FieldName")
' args.Row, args.Column, args.Sender, args.NotifyType
' NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
If (args.Row > -1) Then
Dim cboOp as Epicor.Mfg.UI.Controls.Combos.OpMasterCombo = CType(csm.GetNativeControlReference("98a978ae-10d5-464c-84e1-439a819c0679"),Epicor.Mfg.UI.Controls.Combos.OpMasterCombo)
cboOp.Focus()
End If
End If
End Sub
Most of the Epicor's built in functionality has a setFocus on a specific
control so when you hit New Operation it runs through Epicor's logic and
then sets the focus, EpiNotify happens before the focus is set inside
trans.GetNewJobOper();

Below is the code that Epicor Runs, you can see that it calls the
getNewJobOper Function which at the end calls the SetFocusOnNewJobOper()
which then sets the focus on the operation Number, your only solution is to
add a Button to the Operation Screen which calls the oTrans.GetNewJobOper()
and then after that you move the focus your self with the Focus() method.



private bool getNewJobOper(bool newFromGrid)
{
bool _success = true;
try
{
_success = trans.GetNewJobOper();
if(_success)
{
if(!newFromGrid)
{
// SCR -19339 - set a flag to prevent update being triggered due to
// a view change happening while activing the form
trans.IgnoreUpdate = true;
SetFocusOnNewJobOper();
trans.IgnoreUpdate = false;
}
}
}
catch
{
_success = false;
trans.IgnoreUpdate = false;
}
return _success;
}
public void SetFocusOnNewJobOper()
{
if(this.s_operationSheet.EpiSelectedSheet == "operationList")
{
s_operationSheet.baseDockManager.PaneFromKey("operationList").Activate();
if(this.p_operationList.eugOperationList.ActiveRow != null)
{
p_operationList.eugOperationList.ActiveRow.Cells["OprSeq"].Activate();

p_operationList.eugOperationList.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode,false,false);
}
}
else
{
s_operationSheet.baseDockManager.PaneFromKey("operationDetail").Activate();
p_operationDetail.numOpr.Focus();
}
}





*Jose C Gomez*
*Software Engineer*
*
*
*checkout my new blog <http://www.usdoingstuff.com> *
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*



On Thu, Dec 1, 2011 at 10:32 AM, tkoch77 <tkoch77@...> wrote:

> **
>
>
> I am trying to set the focus to the operation dropdown on the Job Entry
> form -> Job Details -> Operations -> Detail when a user chooses to add a
> new operation. Currently it defaults to the Opr Numeric editor. I tried
> this bit of code and during debugging it hits the line of code to set the
> focus but it doesn't focus on the dropdown.
>
> Thanks,
>
> Ted
>
> Private Sub edvJobOper_EpiViewNotification(ByVal view As EpiDataView,
> ByVal args As EpiNotifyArgs)
> ' ** Argument Properties and Uses **
> ' view.dataView(args.Row)("FieldName")
> ' args.Row, args.Column, args.Sender, args.NotifyType
> ' NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow,
> NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
> If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
> If (args.Row > -1) Then
> Dim cboOp as Epicor.Mfg.UI.Controls.Combos.OpMasterCombo =
> CType(csm.GetNativeControlReference("98a978ae-10d5-464c-84e1-439a819c0679"),Epicor.Mfg.UI.Controls.Combos.OpMasterCombo)
> cboOp.Focus()
> End If
> End If
> End Sub
>
>
>


[Non-text portions of this message have been removed]