Navigation:  The Buzz > Forms and Controls > Tabs >

Tab Control and Modes

Previous pageReturn to chapter overviewNext page

Dec 21, 2007   Button

Default layout is a table control and a TAB control on the screen. I need

locate capability on the table so I enter the task in Query Mode and the

default tab is okay to be in Query mode.

 

However when the user chooses the second tab I want to switch them to Modify

Mode so they can edit the data displayed on that particular tab. Nothing I

have tried does this and leaves the user on the second tab in modify mode.

 

Brian Scoffield

 

Did you consider having the 2nd Tab call a sub task, where you can

have the default mode being Modify Mode?, I have this in some places,

but for other reasons.

 

HTH

Zvi

 

Brian, I'm guessing you meant to say "leaves the user on the second tab in

QUERY mode".

 

If the second (and other tabs) are in the same program and only additional

data is being displayed, then either in a zoom block on the tab field or a

raised event, raise the "Modify Records" action.

 

If you're calling another task/program that's displaying data, pass an

"Initial Mode" parameter. From the zoom/event off the tab, call the other

task/program and pass it the mode you want the task to start in, then just

put the expression on the task properties initial mode.

 

In both cases, make sure that the task options allow Modify mode.

 

HTH

 

Keith

 

Brian,

 

Here's a quick example of mine:

 

Declare Variable V:Tab Alpha(10).

 

Put this Tab on the screen and in its Items List type in 1,2, so you

will see two tabs on the screen: 1 and 2. Now set Tab's property

Modify in Query to Yes.

 

Place your variables on the both tabs.

 

Then use a Handler Zoom on your TAB Control. In the Enable field of

this handler put a condition V:Tab='2'

 

Then Raise Event ( command 14 ) under this Handler called Modify

Records Wait:No.

 

That's all - works like a charm.

 

 

Actually want them on the second tab in modify mode.

 

So simply put, the first tab is query only (it only displays a few of the

fields in the record and if they need to update that data they click a

button on the tab to run a full Modify program). The second tab displays a

simple 'Notes' memo field and I want them to be able to update the notes as

they wish without going off to the more complex Modify program.

 

All fields on both tabs come from a single record in the main table.

 

I tried to raise a Modify on entry to the tab, but it immediately took me

out of the tab and back to the 'default' tab.

The event was triggered by "tab=Notes and mode=query", then raise event

Modify.

 

Brian Scoffield 

 

"I tried to raise a Modify on entry to the tab, but it immediately

took me out of the tab and back to the 'default' tab."

 

Not taking anything away from others suggestions. But just about the

above:

My guess is that you Init the tab with the default value. So it kicks

in on every cycle.

 

We tend to leave the Init of a Tabs to nothing and rather update it

with its default value in the Task Prefix.

 

In case it helps,

Omar

 

 

This seems to change the mode alright, but it doesn't open the second tab.

 

As an aside, when the user leaves the second tab, if I ever get them there

:-), then I want the mode switched back to Query.

 

Exactly my situation so I moved the init to an update in TP and voila!..

Thanks.

 

Now to switch it back to Query when they leave that tab. Another handler I

guess.

 

Got that working as well. Thanks guys.

 

Brian Scoffield

 

Brian,

Have you looked in the debugger to see what the value is of your tab? My

guess is that you're resetting it back to the default (Record Prefix

update?) Becaue you're allowing the tab to update in query mode, we know the

value is being changed (as well as your event indicates that). If it's all

in the same record, this should be a simple expression on the tab

(event/block).

 

Kbput (If(Tab variable = <query tab string>,'Query Records'Act,'Modify

Records'Act))

 

Or you can raise either event based on the tab string contents (make sure

the tab contents match exactly).

Keith

 

Brian,

 

Please insure you have set Modify in Query to Yes.

I can export and send the example if you want

 


Page url: http://www.magic-iug.com/MIUGWeb3/index.html?hm_tab_control_and_modes.htm