PDA

View Full Version : How to set defaults in a dbmodalpanel



Dave &/or Ryan
25-Jan-2005, 06:35 PM
I'm trying to use a popup panel to allow new items to be created on
the fly for inclusion in a dbgrid, but having no luck seeding
'special' default values into the panel. The .dd defaults are always
being applied.

in the popup procedure....

procedure popup
.. clear invmast //works just fine

.. set changed_value of oinvmast_line item 0 to "JEWELRY"
//has no effect
Set Field_Changed_Value Field Invmast.line To JEWELRY"
//errors at runtime, I suppose it would , being a dd message
move "JEWELRY" to invmast.line
//no effect

forward send popup
end_procedure

Bob Worsley
25-Jan-2005, 06:38 PM
There's a description on vdf-guidance for adding a "Dialog_Callback" to your
(db)ModalPanel class, works similar to Prompt_Callback in lookups. Sounds
like what you need.
Bob

"Dave &/or Ryan" <it@kirkfreeport.net> wrote in message
news:1dldv0tduajq9ms0lgnvb2gqevbl3gip0a@4ax.com...
> I'm trying to use a popup panel to allow new items to be created on
> the fly for inclusion in a dbgrid, but having no luck seeding
> 'special' default values into the panel. The .dd defaults are always
> being applied.
>
> in the popup procedure....
>
> procedure popup
> . clear invmast //works just fine
>
> . set changed_value of oinvmast_line item 0 to "JEWELRY"
> //has no effect
> Set Field_Changed_Value Field Invmast.line To JEWELRY"
> //errors at runtime, I suppose it would , being a dd message
> move "JEWELRY" to invmast.line
> //no effect
>
> forward send popup
> end_procedure
>

RobertRoth
25-Jan-2005, 08:10 PM
Although Bob's suggestion of a callback may be the right answer for
your particular situation, in general it is not required.

Typically, the dbmodal panel will have it's own DDO structure with
DDO's corresponding to parent and child files in the calling view.

Procedure Popup
send request_assign of myParent_DD
send clear of mychild_dd
set field_changed_value of myChild_DD field mychild.myfield1 ;
to somevalue
forward send popup
End_Procedure


Hope that helps.
Bob Roth
Barton Nelson Inc.
KCMO

On Tue, 25 Jan 2005 18:35:59 -0500, Dave &/or Ryan
<it@kirkfreeport.net> wrote:

>I'm trying to use a popup panel to allow new items to be created on
>the fly for inclusion in a dbgrid, but having no luck seeding
>'special' default values into the panel. The .dd defaults are always
>being applied.
>
>in the popup procedure....
>
>procedure popup
>. clear invmast //works just fine
>
>. set changed_value of oinvmast_line item 0 to "JEWELRY"
>//has no effect
> Set Field_Changed_Value Field Invmast.line To JEWELRY"
>//errors at runtime, I suppose it would , being a dd message
> move "JEWELRY" to invmast.line
>//no effect
>
> forward send popup
>end_procedure
>

Allan Greis Eriksen
26-Jan-2005, 09:12 AM
Dave &/or Ryan <it@kirkfreeport.net> wrote in
news:1dldv0tduajq9ms0lgnvb2gqevbl3gip0a@4ax.com:

> I'm trying to use a popup panel to allow new items to be created on
> the fly for inclusion in a dbgrid, but having no luck seeding
> 'special' default values into the panel. The .dd defaults are always
> being applied.
>
> in the popup procedure....
>
> procedure popup
> . clear invmast //works just fine
>
> . set changed_value of oinvmast_line item 0 to "JEWELRY"
> //has no effect
> Set Field_Changed_Value Field Invmast.line To JEWELRY"
> //errors at runtime, I suppose it would , being a dd message
> move "JEWELRY" to invmast.line
> //no effect
>
> forward send popup
> end_procedure
>

You could argument Procedure Activate_group instead I think

Procedure activate_group
Forward send activate_group
// do your stuff here...
end_procedure

--
Regards,
Allan Kim Eriksen
Programmer/systemconsolent

Bob Worsley
26-Jan-2005, 10:13 AM
The difference is that dialog_callback occurs much later in the process of
bringing up the modal panel. Popup is way early, the Dialog_Callback
happens during Entering_Scope. Timing problems are always biting me where I
don't want to be bit... <g>
Bob

"Barton Nelson Inc." <Robert@bebco.com> wrote in message
news:j4pdv0p9povrvgofjl3idctllc2h6i4a4q@4ax.com...
> Although Bob's suggestion of a callback may be the right answer for
> your particular situation, in general it is not required.
>
> Typically, the dbmodal panel will have it's own DDO structure with
> DDO's corresponding to parent and child files in the calling view.
>
> Procedure Popup
> send request_assign of myParent_DD
> send clear of mychild_dd
> set field_changed_value of myChild_DD field mychild.myfield1 ;
> to somevalue
> forward send popup
> End_Procedure
>
>
> Hope that helps.
> Bob Roth
> Barton Nelson Inc.
> KCMO
>
> On Tue, 25 Jan 2005 18:35:59 -0500, Dave &/or Ryan
> <it@kirkfreeport.net> wrote:
>
> >I'm trying to use a popup panel to allow new items to be created on
> >the fly for inclusion in a dbgrid, but having no luck seeding
> >'special' default values into the panel. The .dd defaults are always
> >being applied.
> >
> >in the popup procedure....
> >
> >procedure popup
> >. clear invmast //works just fine
> >
> >. set changed_value of oinvmast_line item 0 to "JEWELRY"
> >//has no effect
> > Set Field_Changed_Value Field Invmast.line To JEWELRY"
> >//errors at runtime, I suppose it would , being a dd message
> > move "JEWELRY" to invmast.line
> >//no effect
> >
> > forward send popup
> >end_procedure
> >
>

Dave &/or Ryan
26-Jan-2005, 06:23 PM
Thanks, guys. All methods seem to work (at least better than what I
had <g>) and I've gone with Bob Roth's because I'm closing the panel
on completion and only catete one record at a time so don't need it to
clean up nicely.

Dave


On Tue, 25 Jan 2005 18:35:59 -0500, Dave &/or Ryan
<it@kirkfreeport.net> wrote:

>I'm trying to use a popup panel to allow new items to be created on
>the fly for inclusion in a dbgrid, but having no luck seeding
>'special' default values into the panel. The .dd defaults are always
>being applied.
>
>in the popup procedure....
>
>procedure popup
>. clear invmast //works just fine
>
>. set changed_value of oinvmast_line item 0 to "JEWELRY"
>//has no effect
> Set Field_Changed_Value Field Invmast.line To JEWELRY"
>//errors at runtime, I suppose it would , being a dd message
> move "JEWELRY" to invmast.line
>//no effect
>
> forward send popup
>end_procedure
>