[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

PacMan

12/19/2005 9:43:00 AM

Greetings!

I have a form that uses a combo box to enable/disable a button, depending on
the content of the combo box. I overrode the modified() method to call my
method InitButton() which does the actual button.enabled( false ) call. I do
a selection on the combo box, and the button is enabled/disabled. So far. so
good.

However, the combo box is a bound control, and even though I call
initButton() in my form's init() method, the button is not enabled/disabled
correctly based on the combo box data fetched from the datasource. When I do
a selection, though, it does what it is supposed to. As I mentioned, both the
combobox modified() and form init() method both call initButton().

Any idea why loading the data does not initialize the button?

Why is the value of the combobox.selection() always 0?

Here is my code:

in the form:
public void init()
{
super();
element.initButtonA();
}

in the combo box:
public boolean modified()
{
boolean ret;

ret = super();
element.initButtonA();
return ret;
}

void initButtonA()
{
if ( cmb.selection() == Enum1::Value1 )
buttonA.enabled( true );
else
buttonA.enabled( false );
}

Thanks!
14 Answers

Nitin

12/19/2005 10:19:00 AM

0

Hi,

You need to override a method active() on datasource. In this method after
super() just call this method.
Actually when ever you change a record the button should work according to
the value in that record.

Cheers
Nitin

"PacMan" wrote:

> Greetings!
>
> I have a form that uses a combo box to enable/disable a button, depending on
> the content of the combo box. I overrode the modified() method to call my
> method InitButton() which does the actual button.enabled( false ) call. I do
> a selection on the combo box, and the button is enabled/disabled. So far. so
> good.
>
> However, the combo box is a bound control, and even though I call
> initButton() in my form's init() method, the button is not enabled/disabled
> correctly based on the combo box data fetched from the datasource. When I do
> a selection, though, it does what it is supposed to. As I mentioned, both the
> combobox modified() and form init() method both call initButton().
>
> Any idea why loading the data does not initialize the button?
>
> Why is the value of the combobox.selection() always 0?
>
> Here is my code:
>
> in the form:
> public void init()
> {
> super();
> element.initButtonA();
> }
>
> in the combo box:
> public boolean modified()
> {
> boolean ret;
>
> ret = super();
> element.initButtonA();
> return ret;
> }
>
> void initButtonA()
> {
> if ( cmb.selection() == Enum1::Value1 )
> buttonA.enabled( true );
> else
> buttonA.enabled( false );
> }
>
> Thanks!

PacMan

12/20/2005 3:59:00 AM

0

Thanks for the suggestion. However, nothing has changed.

Here is what I did.

in the form data source:
public int active()
{
int ret;

ret = super();
element.initButtonA();

return ret;
}

Is this what you suggested?

The enabling/disabling works when the combo box is modified, but not on the
initial activation of the form.
It seems that the combo.selection() always = 0 on startup, regardless of the
actual data from the datasource that is loaded into the combo box , hence the
button is always disabled (i set the button disabled when enum value = 0)

I would appreciate more suggestions/insights. Thanks.

-Jimm Bo

"Nitin" wrote:

> Hi,
>
> You need to override a method active() on datasource. In this method after
> super() just call this method.
> Actually when ever you change a record the button should work according to
> the value in that record.
>
> Cheers
> Nitin
>
> "PacMan" wrote:
>
> > Greetings!
> >
> > I have a form that uses a combo box to enable/disable a button, depending on
> > the content of the combo box. I overrode the modified() method to call my
> > method InitButton() which does the actual button.enabled( false ) call. I do
> > a selection on the combo box, and the button is enabled/disabled. So far. so
> > good.
> >
> > However, the combo box is a bound control, and even though I call
> > initButton() in my form's init() method, the button is not enabled/disabled
> > correctly based on the combo box data fetched from the datasource. When I do
> > a selection, though, it does what it is supposed to. As I mentioned, both the
> > combobox modified() and form init() method both call initButton().
> >
> > Any idea why loading the data does not initialize the button?
> >
> > Why is the value of the combobox.selection() always 0?
> >
> > Here is my code:
> >
> > in the form:
> > public void init()
> > {
> > super();
> > element.initButtonA();
> > }
> >
> > in the combo box:
> > public boolean modified()
> > {
> > boolean ret;
> >
> > ret = super();
> > element.initButtonA();
> > return ret;
> > }
> >
> > void initButtonA()
> > {
> > if ( cmb.selection() == Enum1::Value1 )
> > buttonA.enabled( true );
> > else
> > buttonA.enabled( false );
> > }
> >
> > Thanks!

Nitin

12/20/2005 4:21:00 AM

0

Hi,

Then I think cmb is a form control name. As you said that it is bound
control, then it will be better to take it as table's field. Do it like this:

void initButtonA()
{
if ( Table.ComboField == Enum1::Value1 )
buttonA.enabled( true );
else
buttonA.enabled( false );
}

Also call the same method from modified() method on Data Source -> field ->
ComboField.

Cheers
Nitin


"PacMan" wrote:

> Thanks for the suggestion. However, nothing has changed.
>
> Here is what I did.
>
> in the form data source:
> public int active()
> {
> int ret;
>
> ret = super();
> element.initButtonA();
>
> return ret;
> }
>
> Is this what you suggested?
>
> The enabling/disabling works when the combo box is modified, but not on the
> initial activation of the form.
> It seems that the combo.selection() always = 0 on startup, regardless of the
> actual data from the datasource that is loaded into the combo box , hence the
> button is always disabled (i set the button disabled when enum value = 0)
>
> I would appreciate more suggestions/insights. Thanks.
>
> -Jimm Bo
>
> "Nitin" wrote:
>
> > Hi,
> >
> > You need to override a method active() on datasource. In this method after
> > super() just call this method.
> > Actually when ever you change a record the button should work according to
> > the value in that record.
> >
> > Cheers
> > Nitin
> >
> > "PacMan" wrote:
> >
> > > Greetings!
> > >
> > > I have a form that uses a combo box to enable/disable a button, depending on
> > > the content of the combo box. I overrode the modified() method to call my
> > > method InitButton() which does the actual button.enabled( false ) call. I do
> > > a selection on the combo box, and the button is enabled/disabled. So far. so
> > > good.
> > >
> > > However, the combo box is a bound control, and even though I call
> > > initButton() in my form's init() method, the button is not enabled/disabled
> > > correctly based on the combo box data fetched from the datasource. When I do
> > > a selection, though, it does what it is supposed to. As I mentioned, both the
> > > combobox modified() and form init() method both call initButton().
> > >
> > > Any idea why loading the data does not initialize the button?
> > >
> > > Why is the value of the combobox.selection() always 0?
> > >
> > > Here is my code:
> > >
> > > in the form:
> > > public void init()
> > > {
> > > super();
> > > element.initButtonA();
> > > }
> > >
> > > in the combo box:
> > > public boolean modified()
> > > {
> > > boolean ret;
> > >
> > > ret = super();
> > > element.initButtonA();
> > > return ret;
> > > }
> > >
> > > void initButtonA()
> > > {
> > > if ( cmb.selection() == Enum1::Value1 )
> > > buttonA.enabled( true );
> > > else
> > > buttonA.enabled( false );
> > > }
> > >
> > > Thanks!

Nitin

12/20/2005 4:22:00 AM

0

Also no need to call initButtonA() from form - init().


"PacMan" wrote:

> Thanks for the suggestion. However, nothing has changed.
>
> Here is what I did.
>
> in the form data source:
> public int active()
> {
> int ret;
>
> ret = super();
> element.initButtonA();
>
> return ret;
> }
>
> Is this what you suggested?
>
> The enabling/disabling works when the combo box is modified, but not on the
> initial activation of the form.
> It seems that the combo.selection() always = 0 on startup, regardless of the
> actual data from the datasource that is loaded into the combo box , hence the
> button is always disabled (i set the button disabled when enum value = 0)
>
> I would appreciate more suggestions/insights. Thanks.
>
> -Jimm Bo
>
> "Nitin" wrote:
>
> > Hi,
> >
> > You need to override a method active() on datasource. In this method after
> > super() just call this method.
> > Actually when ever you change a record the button should work according to
> > the value in that record.
> >
> > Cheers
> > Nitin
> >
> > "PacMan" wrote:
> >
> > > Greetings!
> > >
> > > I have a form that uses a combo box to enable/disable a button, depending on
> > > the content of the combo box. I overrode the modified() method to call my
> > > method InitButton() which does the actual button.enabled( false ) call. I do
> > > a selection on the combo box, and the button is enabled/disabled. So far. so
> > > good.
> > >
> > > However, the combo box is a bound control, and even though I call
> > > initButton() in my form's init() method, the button is not enabled/disabled
> > > correctly based on the combo box data fetched from the datasource. When I do
> > > a selection, though, it does what it is supposed to. As I mentioned, both the
> > > combobox modified() and form init() method both call initButton().
> > >
> > > Any idea why loading the data does not initialize the button?
> > >
> > > Why is the value of the combobox.selection() always 0?
> > >
> > > Here is my code:
> > >
> > > in the form:
> > > public void init()
> > > {
> > > super();
> > > element.initButtonA();
> > > }
> > >
> > > in the combo box:
> > > public boolean modified()
> > > {
> > > boolean ret;
> > >
> > > ret = super();
> > > element.initButtonA();
> > > return ret;
> > > }
> > >
> > > void initButtonA()
> > > {
> > > if ( cmb.selection() == Enum1::Value1 )
> > > buttonA.enabled( true );
> > > else
> > > buttonA.enabled( false );
> > > }
> > >
> > > Thanks!

PacMan

12/20/2005 6:21:00 AM

0

Thanks! You hit the nail on the head.

Moving the enable/disable method call to the active() method instead of the
init() method was the difference.

Thank you so much.



"Nitin" wrote:

> Also no need to call initButtonA() from form - init().
>
>
> "PacMan" wrote:
>
> > Thanks for the suggestion. However, nothing has changed.
> >
> > Here is what I did.
> >
> > in the form data source:
> > public int active()
> > {
> > int ret;
> >
> > ret = super();
> > element.initButtonA();
> >
> > return ret;
> > }
> >
> > Is this what you suggested?
> >
> > The enabling/disabling works when the combo box is modified, but not on the
> > initial activation of the form.
> > It seems that the combo.selection() always = 0 on startup, regardless of the
> > actual data from the datasource that is loaded into the combo box , hence the
> > button is always disabled (i set the button disabled when enum value = 0)
> >
> > I would appreciate more suggestions/insights. Thanks.
> >
> > -Jimm Bo
> >
> > "Nitin" wrote:
> >
> > > Hi,
> > >
> > > You need to override a method active() on datasource. In this method after
> > > super() just call this method.
> > > Actually when ever you change a record the button should work according to
> > > the value in that record.
> > >
> > > Cheers
> > > Nitin
> > >
> > > "PacMan" wrote:
> > >
> > > > Greetings!
> > > >
> > > > I have a form that uses a combo box to enable/disable a button, depending on
> > > > the content of the combo box. I overrode the modified() method to call my
> > > > method InitButton() which does the actual button.enabled( false ) call. I do
> > > > a selection on the combo box, and the button is enabled/disabled. So far. so
> > > > good.
> > > >
> > > > However, the combo box is a bound control, and even though I call
> > > > initButton() in my form's init() method, the button is not enabled/disabled
> > > > correctly based on the combo box data fetched from the datasource. When I do
> > > > a selection, though, it does what it is supposed to. As I mentioned, both the
> > > > combobox modified() and form init() method both call initButton().
> > > >
> > > > Any idea why loading the data does not initialize the button?
> > > >
> > > > Why is the value of the combobox.selection() always 0?
> > > >
> > > > Here is my code:
> > > >
> > > > in the form:
> > > > public void init()
> > > > {
> > > > super();
> > > > element.initButtonA();
> > > > }
> > > >
> > > > in the combo box:
> > > > public boolean modified()
> > > > {
> > > > boolean ret;
> > > >
> > > > ret = super();
> > > > element.initButtonA();
> > > > return ret;
> > > > }
> > > >
> > > > void initButtonA()
> > > > {
> > > > if ( cmb.selection() == Enum1::Value1 )
> > > > buttonA.enabled( true );
> > > > else
> > > > buttonA.enabled( false );
> > > > }
> > > >
> > > > Thanks!

Vishal

12/20/2005 6:44:00 AM

0

Dear PacMan,
For this you need to write code on two places:

1. Datasoources>>TableName>>FieldName>>Modified()
2. Datasources>>TableName>>Methods>> active()

I had written these few lines on both the places:

if(eisTransportTable.eisTestEnum == eisTestEnum::ValueOne)
myBtn.enabled(true);
else
myBtn.enabled(false);

--
Vishal
Technical consultant Microsoft Axapta


"PacMan" wrote:

> Greetings!
>
> I have a form that uses a combo box to enable/disable a button, depending on
> the content of the combo box. I overrode the modified() method to call my
> method InitButton() which does the actual button.enabled( false ) call. I do
> a selection on the combo box, and the button is enabled/disabled. So far. so
> good.
>
> However, the combo box is a bound control, and even though I call
> initButton() in my form's init() method, the button is not enabled/disabled
> correctly based on the combo box data fetched from the datasource. When I do
> a selection, though, it does what it is supposed to. As I mentioned, both the
> combobox modified() and form init() method both call initButton().
>
> Any idea why loading the data does not initialize the button?
>
> Why is the value of the combobox.selection() always 0?
>
> Here is my code:
>
> in the form:
> public void init()
> {
> super();
> element.initButtonA();
> }
>
> in the combo box:
> public boolean modified()
> {
> boolean ret;
>
> ret = super();
> element.initButtonA();
> return ret;
> }
>
> void initButtonA()
> {
> if ( cmb.selection() == Enum1::Value1 )
> buttonA.enabled( true );
> else
> buttonA.enabled( false );
> }
>
> Thanks!

James Hammerton

2/27/2010 5:11:00 PM

0

[soc.culture.iraq and aus.religion.islam dropped since my news server
doesn't allow X posting to more than 5 groups]

SHOES THROWER wrote:
> Iran to fire 11,000 rockets in minute if attacked (AFP)
>
> TEHERAN - Iran warned on Saturday it would fire off 11,000 rockets at
> enemy bases within the space of a minute if the United States launched
> military action against the Islamic republic. ???In the first minute of an
> invasion by the enemy, 11,000 rockets and cannons would be fired at
> enemy bases,??? said a brigadier general in the elite Revolutionary
> Guards, Mahmoud Chaharbaghi.

How many rockets do they have?

James

--
James Hammerton,
http://jhammerton.word...
http://www.magnacartaplus...

William Black

2/27/2010 5:20:00 PM

0

#
Path: textnews.cambrium.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!195.71.90.67.MISMATCH!news.unit0.net!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: "William Black" <william.black@hotmail.co.uk>
Newsgroups: alt.religion.islam,aus.politics,uk.politics.misc,uk.religion.islam,us.politics
Subject: Re: Iran to fire 11,000 rockets in minute if attacked
Date: Sat, 27 Feb 2010 22:49:56 +0530
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <hmbk8e$aap$1@news.eternal-september.org>
References: <4b873ed5$0$6090$afc38c87@news.optusnet.com.au> <4b891257@news.x-privat.org> <4b894709@news.x-privat.org> <7ut20kF5mrU3@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="utf-8";
reply-type=response
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 27 Feb 2010 17:20:17 +0000 (UTC)
Injection-Info: news.motzarella.org; posting-host="uBQGkARW4uC5Geq4cpVS1Q";
logging-data="10585"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cANqZzh/rhVgI1YK7vhhLUFCwlXnc/YE="
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16669
In-Reply-To: <7ut20kF5mrU3@mid.individual.net>
X-Newsreader: Microsoft Windows Mail 6.0.6000.16480
Cancel-Lock: sha1:BltmeoVHNyFQ/FSIxc5bA+No93E=
X-Priority: 3
X-MSMail-Priority: Normal
Xref: textnews.cambrium.nl alt.religion.islam:650416 aus.politics:903074 uk.politics.misc:1136069 uk.religion.islam:171524 us.politics:217673


"James Hammerton" <jah.usenet@yahoo.co.uk> wrote in message
news:7ut20kF5mrU3@mid.individual.net...
> [soc.culture.iraq and aus.religion.islam dropped since my news server
> doesn't allow X posting to more than 5 groups]
>
> SHOES THROWER wrote:
>> Iran to fire 11,000 rockets in minute if attacked (AFP)
>>
>> TEHERAN - Iran warned on Saturday it would fire off 11,000 rockets at
>> enemy bases within the space of a minute if the United States launched
>> military action against the Islamic republic. ???In the first minute of an
>> invasion by the enemy, 11,000 rockets and cannons would be fired at enemy
>> bases,??? said a brigadier general in the elite Revolutionary Guards,
>> Mahmoud Chaharbaghi.
>
> How many rockets do they have?

It's not about rockets, it's about the number of empty milk bottles ...

--
William Black


I've seen things you people wouldn't believe.
Barbeques on fire by the chalets past the castle headland
I watched the gift shops glitter in the darkness off the Newborough gate
All these moments will be lost in time, like icecream on the beach
Time for tea.

B J Foster

2/27/2010 7:19:00 PM

0

Ardalan Keykavoussi wrote:
> Iran to fire 11,000 rockets in minute if attacked (AFP)

"unrepresentative swill!"
(to misquote a great leader and pig farmer)


>
> TEHERAN - Iran warned on Saturday it would fire off 11,000 rockets at
> enemy bases within the space of a minute if the United States launched
> military action against the Islamic republic. "In the first minute of an
> invasion by the enemy, 11,000 rockets and cannons would be fired at
> enemy bases," said a brigadier general in the elite Revolutionary
> Guards, Mahmoud Chaharbaghi.
>
> "This volume and speed of firing would continue," added Chaharbaghi, who
> is commander of artillery and missiles of the Guards' ground forces,
> according to the semi-official Fars news agency.
>
> The United States has never ruled out attacking Iran to end its defiance
> over the controversial Iranian nuclear programme, which the US alleges
> is aimed at making nuclear weapons but Iran insists is entirely peaceful.
>
> Iran has for its part vowed never to initiate an attack but has also
> warned of a crushing response to any act of aggression against its soil.
>
> "If a war breaks out in the future, it will not last long because we
> will rub their noses in the dirt," said Chaharbaghi.
>
> "Now the enemy should ask themselves how many of their people they are
> ready to have sacrificed for their stupidity in attacking Iran," he said.
>
> Iranian officials have repeatedly warned the military would target the
> bases of US forces operating in neighbouring Iraq and Afghanistan in the
> event of any attack and already has these sites under close surveillance.
>
> Chaharbaghi said that the Guards would soon receive "rockets with a
> range of 250 kilometres (155 miles)" whereas the current range of its
> rockets is 150 kilometres (91 miles).
>
> "We have identified our targets and with a close surveillance of
> targets, we can respond to the enemy's stupidity immediately,"
> Chaharbaghi added.
>
> He said that the Guards' weapons were spread out throughout the country
> and so would not be affected by any isolated US strikes against military
> facilities.
>
> The Guards are Iran's elite ideological army and responsible for its
> most significant weapons such as the longer range Shahab-3 missile which
> has Israel and US bases in the Middle East within its range.
>
> http://tinyurl....

abelard

2/27/2010 9:46:00 PM

0

On Sat, 27 Feb 2010 17:10:44 +0000, James Hammerton
<jah.usenet@yahoo.co.uk> wrote:

>[soc.culture.iraq and aus.religion.islam dropped since my news server
>doesn't allow X posting to more than 5 groups]
>
>SHOES THROWER wrote:
>> Iran to fire 11,000 rockets in minute if attacked (AFP)
>>
>> TEHERAN - Iran warned on Saturday it would fire off 11,000 rockets at
>> enemy bases within the space of a minute if the United States launched
>> military action against the Islamic republic. ?In the first minute of an
>> invasion by the enemy, 11,000 rockets and cannons would be fired at
>> enemy bases,? said a brigadier general in the elite Revolutionary
>> Guards, Mahmoud Chaharbaghi.
>
>How many rockets do they have?

best make a pre-emptive strike of sufficient force then

--
web site at www.abelard.org - news comment service, logic, economics
energy, education, politics, etc over 1 million document calls in year past
--------------------------------------------------------------------------------
all that is necessary for [] walk quietly and carry
the triumph of evil is that [] a big stick.
good people do nothing [] trust actions not words
only when it's funny -- roger rabbit
--------------------------------------------------------------------------------