Can seem to get the below logic to work in my app.
need your help. thanks.

I have 3 entities: COMPANY, OPPORTUNITY, OPPORTUNITY_COMPANY. 

COMPANY
- companyID (attribute)


OPPORTUNITY
- oppID (attribute)
- customer (relationship between OPPORTUNITY(oppID) and OPPORTUNITY_COMPANY (oppID))

OPPORTUNITY_CUSTOMER
- oppID (attribute)
- customerID (attribute)
- company (relationship between OPPORTUNITY_CUSTOMER (customerID) and COMPANY (companyID))
- opportunity (relationship between OPPORTUNITY_CUSTOMER (oppID) and OPPORTUNITY (oppID))

The requirements of a form are:
- In a form which displays all companies in COMPANY, user can select by WOCheckBOX the company(s) which will be customer of an opportunity. 
- Upon submission, the selected companies needs to be added to the OPPORTUNITY_CUSTOMER as customers of a related OPPORTUNITY. 

how can i get the above done? how's the coding requirement be like? 

Warmest Regards,
Jim Wong



On 26 Feb 2006, at 12:59 AM, Mark Morris wrote:

Yes, it is bound to WORepetition's "item".  WORepetition will put into it the current Object from the "list".  It can be any object. :-)

Regards,
Mark

On Feb 25, 2006, at 8:26 AM, Jim Wong wrote:

thanks for reply.

the currentCompany you specified can be any object right?

Warmest Regards,
Jim Wong



On 25 Feb 2006, at 10:00 PM, Mark Morris wrote:

Hi Jim,

Sorry it took a little longer to get back with you.  I had gone to bed (and I see there's a big time difference between us).

It will get called automatically when the form is submitted, by the WOCheckBox component, and it will pass in the current value of the checkbox (true for checked, false for unchecked).

This is very handy, and you can make your checkboxes do and reflect just about anything you can think of!  :-)

Regards,
Mark

On Feb 25, 2006, at 2:54 AM, Jim Wong wrote:

Hi Mark:

1 question: when will the setCompanyIsInArray() ever be called? do i have to invoke this method somewhere?

Warmest Regards,
Jim Wong



On 25 Feb 2006, at 3:39 PM, Mark Morris wrote:

Hello Jim,

You can use the "isChecked" binding to do this.

For example, bind it to a method named "companyIsInArray".  Assume your WORepetition's "item" binding is set to "currentCompany", and the destination (mutable) array is called "companyArray".  Then write something like (warning, not debugged!):

public boolean companyIsInArray() {
  return companyArray.containsObject( currentCompany );
}

public void setCompanyIsInArray( boolean value ) {
  if( value && !companyIsInArray() ) {
      companyArray.addObject( currentCompany );
  }
  if( !value && companyIsInArray() ) {
      companyArray.removeObject( currentCompany );
  }
}

This would do what you want.

Regards,
Mark

On Feb 24, 2006, at 11:34 PM, Jim Wong wrote:


I want to display a list of objects from entity COMPANY. the list will be displayed using WORepetition. Each line will contain the companyName and a WOCheckBox. When "GO" button is clicked, I want to pass all the selections into a NSMutableArray. But I dunno how to code this. ANyone can help? Thanks.

Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]








 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to