(RDMLX) Any way to force a focus refresh?

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

Ca this be addressed in a future enhancement?
Mark_Dale
Posts: 61
Joined: Thu Apr 19, 2012 11:06 am

Re: (RDMLX) Any way to force a focus refresh?

Post by Mark_Dale »

I'm not yet sure there needs to be an enhancement, or what it would be.

I noticed in your partial example that you are attempting to set focus to particular dropdown items using HasFocus. Now that you understand that HasFocus is not used for that, have you tried an example where you set the dropdown to null, and use HasFocus(TRUE) once. That works for me. (But I'm only attempting to use HasFocus on one element on the form, in accordance with the documentation)
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

Yes I did change that yesterday after you steered me correct on the other issue. Same problem.

I think you should be able to set up a similar example that would be simpler (no DB) by just using 1 field as dropdown (a,b,c, etc) then after select rebuild (like Bill, Bobby, Betty, etc) the drop down values (set .items to null first). and redisplay the form (NOT as NEW) to duplicate it.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

Ok Mark here is a test for you to copy on this issue:

Program to invoke LrBugDrv

* ==================================
* Drop Down Bug Driver test
* ==================================

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #LRNG_FORM)

Define_Com Class(#LrBugLvl2)

Mthroutine Name(HandleRequest) Options(*REDEFINE)

* -----------------------------------------
* Handle currently requested action
* -----------------------------------------

* Always set the USING Element to /Form.Fields at the start
#Com_Owner.Using Element('/Form.Fields')

Case Of_Field(#COM_OWNER.RequestACTION)

When (= Labeltest)
#LrBugLvl2.uSetValues Formview(#COM_OWNER)
#COM_OWNER.IsNewForm := False

* #COM_OWNER.IsNewForm := True
#LrBugLvl2.uMakeLabel Formview(#COM_OWNER)

When (= DrillTest)
#COM_OWNER.IsNewForm := False
#LrBugLvl2.uDrillDD Formview(#COM_OWNER)

Otherwise /* Default */
#COM_OWNER.IsNewForm := True
#LrBugLvl2.uMakeDD Formview(#COM_OWNER)
Endcase

Endroutine

End_Com
Last edited by stevec on Tue Apr 29, 2014 1:59 pm, edited 1 time in total.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

Program that it calls LrBugLvl2

* ==================================
* Drop Down Bug Tier 2 test
* ==================================

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #LRNG_FORM)

Define_Com Class(#LrBugDdToLabel) Name(#LRBUGDDTOLABEL)

Define Field(#TableRow) Type(*string)

Mthroutine Name(uMakeDD)
Define_Map For(*Input) Class(#Lrng_form) Name(#FormView) Help('Set to #com_owner') Pass(*BY_REFERENCE)

#FormView.Set_Form Grid_Col_N(1) Grid_Col_Width(Fill)
#FormView.Set_Table Name(TableTest) Border_Thickness(1) Border_Cornerradius(10) Layout_Row(1) Clearrows(True) Layout_Col(1) Layout_Cols(-1)
#FormView.Set_Table Name(TableTest) Col_N(1) Col_Name(Title) Col_Width('Fit,Fill,50%') Col_Type('Label')
#FormView.Set_Table Name(TableTest) Col_N(2) Col_Name(Value) Col_Width(Fill) Col_Type('Label')

#TableRow := 'TableTest.Row%1'
#FormView.Set_Label Name(#TableRow + '.Title') Text('DropDown 1:')
#FormView.Set_TextBox Name(#TableRow + '.Value')

#TableRow := 'TableTest.Row%2'
#FormView.Set_Label Name(#TableRow + '.Title') Text('Text Box:')
#LrBugDdToLabel.uDdAtrVal Uname(#TableRow + '.Value') Formview(#FormView) Uvalue(*Null)
#FormView.Set_Dropdown Name(#TableRow + '.Value') Disabled(False)

#TableRow := 'TableTest.Row%3'
#FormView.Set_Label Name(#TableRow + '.Title') Text('DropDown 2:')
#LrBugDdToLabel.uDdAtrVal Uname(#TableRow + '.Value') Formview(#FormView) Uvalue(*Null)

#FormView.Set_Button Text('DD to Label') Layout_Row(3) Onclick(LabelTest)
#FormView.Set_Button Text('DD Drill') Layout_Row(3) Onclick(DrillTest) Layout_Col(2)
#FormView.Set_Dropdown Name(#TableRow + '.Value') Disabled(False)

Endroutine

Mthroutine Name(uDrillDD)
Define_Map For(*Input) Class(#Lrng_form) Name(#FormView) Help('Set to #com_owner') Pass(*BY_REFERENCE)

#TableRow := 'TableTest.Row%2'
#LrBugDdToLabel.uDdAtrVal Uname(#TableRow + '.Value') Formview(#FormView) Uvalue(B)
#FormView.Set_Dropdown Name(#TableRow + '.Value') Hasfocus(True)

#TableRow := 'TableTest.Row%3'
#LrBugDdToLabel.uDdAtrVal Uname(#TableRow + '.Value') Formview(#FormView) Uvalue(T)

Endroutine

Mthroutine Name(uSetValues)
Define_Map For(*Input) Class(#Lrng_form) Name(#FormView) Help('Set to #com_owner') Pass(*BY_REFERENCE)

#TableRow := 'TableTest.Row%1'
#FormView.Get_TextBox Name(#TableRow + '.Value') Value(#Std_Texts)
#FormView.Set_TextBox Name(#TableRow + '.Value') Value(#Std_Texts)

#TableRow := 'TableTest.Row%2'
#FormView.Get_Dropdown Name(#TableRow + '.Value') Value(#Std_Texts)
#LrBugDdToLabel.uDdAtrVal Uname(#TableRow + '.Value') Formview(#FormView) Uvalue(#STD_TEXTS)

#TableRow := 'TableTest.Row%3'
#FormView.Get_Dropdown Name(#TableRow + '.Value') Value(#Std_Texts)
#LrBugDdToLabel.uDdAtrVal Uname(#TableRow + '.Value') Formview(#FormView) Uvalue(#STD_TEXTS)

Endroutine

Mthroutine Name(uMakeLabel)
Define_Map For(*Input) Class(#Lrng_form) Name(#FormView) Help('Set to #com_owner') Pass(*BY_REFERENCE)

#FormView.Set_Table Name(TableTest) Col_N(1) Border_Thickness(1) Border_Cornerradius(10) Col_Width(Fill) Layout_Cols(-1) Layout_Row(1) Clearrows(True)
#FormView.Set_Table Name(TableTest) Col_N(1) Col_Name(Title) Col_Width('Fit,Fill,50%') Col_Type('Label')
#FormView.Set_Table Name(TableTest) Col_N(2) Col_Name(Value) Col_Width(Fill) Col_Type('Label')

#TableRow := 'TableTest.Row%1'
#FormView.Get_TextBox Name(#TableRow + '.Value') Value(#Std_Texts)
#FormView.Set_Label Name(#TableRow + '.Value') Text(#Std_texts)
#FormView.Set_Label Name(#TableRow + '.Title') Text('TB Value:')

#TableRow := 'TableTest.Row%2'
#FormView.Get_Dropdown Name(#TableRow + '.Value') Value(#Std_Texts)
#FormView.Set_Label Name(#TableRow + '.Value') Text(#Std_texts)
#FormView.Set_Label Name(#TableRow + '.Title') Text('DD Value 1:')

#TableRow := 'TableTest.Row%3'
#FormView.Get_Dropdown Name(#TableRow + '.Value') Value(#Std_Texts)
#FormView.Set_Label Name(#TableRow + '.Value') Text(#Std_texts)
#FormView.Set_Label Name(#TableRow + '.Title') Text('DD Value 2:')

Endroutine

End_Com
Last edited by stevec on Tue Apr 29, 2014 2:09 pm, edited 2 times in total.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

And the drop down LrBugDdToLabel

* ==================================
* Drop Down Bug (change from DD to Label)
* ==================================

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #LRNG_FORM)

Define_Com Class(#std_int) Name(#uDDIndex)
Define_Com Class(#std_text) Name(#uDDItemText)
Define_Com Class(#std_text) Name(#uDDItemValue)

Define Field(#Alphabet) Type(*char) Length(26)

Mthroutine Name(uDdAtrVal)
Define_Map For(*Input) Class(#Lrng_form) Name(#FormView) Help('Set to #com_owner') Pass(*BY_REFERENCE)
Define_Map For(*INPUT) Class(#STD_STRNG) Name(#uName)
Define_Map For(*INPUT) Class(#STD_STRNG) Name(#uValue)

#FormView.Set_Null Property('/Form.Fields.' + #uName + '.Item')

If Cond(#uValue.IsNull)
* Alphabet
#uDDIndex := 1
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text('Select...') Item_Value(*Blanks) Name(#uName)

#Alphabet := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

Begin_Loop Using(#STD_IDNO) To(26)
* Only show letter if a series exists starying with it
#uDDItemValue := #Alphabet.Substring( #STD_IDNO 1 )

#uDDIndex += 1
#uDDItemText := #uDDItemValue
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text(#uDDItemText) Item_Value(#uDDItemValue) Name(#uName)

End_Loop

Else
#uDDIndex := 1
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text('Select...') Item_Value(*Blanks) Name(#uName)

* Specific Letter (assume B for test)
If Cond(#uValue = B)

#uDDItemValue := Betsie
#uDDIndex += 1
#uDDItemText := Betsie
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text(#uDDItemText) Item_Value(#uDDItemValue) Name(#uName)

#uDDItemValue := Bill
#uDDIndex += 1
#uDDItemText := Billy
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text(#uDDItemText) Item_Value(#uDDItemValue) Name(#uName)

#uDDItemValue := Bob
#uDDIndex += 1
#uDDItemText := Bobby
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text(#uDDItemText) Item_Value(#uDDItemValue) Name(#uName)

Else
* T
#uDDItemValue := Ted
#uDDIndex += 1
#uDDItemText := Teddy
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text(#uDDItemText) Item_Value(#uDDItemValue) Name(#uName)

#uDDItemValue := Tim
#uDDIndex += 1
#uDDItemText := Timmy
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text(#uDDItemText) Item_Value(#uDDItemValue) Name(#uName)

#uDDItemValue := Tom
#uDDIndex += 1
#uDDItemText := Tommy
#FormView.Set_Dropdown Item_N(#uDDIndex) Item_Text(#uDDItemText) Item_Value(#uDDItemValue) Name(#uName)

Endif

Endif

#FormView.Set_Dropdown Name(#uName) Value(#uValue)

Endroutine

End_Com
Last edited by stevec on Tue Apr 29, 2014 2:01 pm, edited 1 time in total.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

When you run this example click on the first drop down and select a letter (any besides select ...) and then click the 2nd button dd drill test. It should reload page and no expand the first drop down even though the code sets focus on it.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

Note that if you click into dd 2 and select before clicking the dd drill button that the dd 1 will expand.

Which brings me back to where I started this thread. How can I force a refresh on a dd that already has focus so that the dd is expanded?
Mark_Dale
Posts: 61
Joined: Thu Apr 19, 2012 11:06 am

Re: (RDMLX) Any way to force a focus refresh?

Post by Mark_Dale »

The first component is added twice, I think.

I need a component with a uMakeLabel method.
stevec
Posts: 138
Joined: Thu Aug 23, 2012 6:45 am

Re: (RDMLX) Any way to force a focus refresh?

Post by stevec »

Sorry I fixed them. All are updated as I am still trying to duplicate the dd to label error
Post Reply