Re: conditional link
Re: conditional link
- Subject: Re: conditional link
- From: David LeBer <email@hidden>
- Date: Mon, 14 Nov 2005 11:22:47 -0500
On 14-Nov-05, at 11:13 AM, Jeremy Matthews wrote:
I want to have an WOimage that, when clicked, will offer the option
of inserting an object (revealing a conditional input field).
I'd like to offer this ability within the same page using a
WOConditional; meaning when a user clicks on the button, it reveals
a section where you can insert an object (string in this case).
Since my conditional-based knowledge is a bit weak, I can do this
by sending the user to another page, but I'd rather not. How can I
keep them in the same page?
Ideas?
I do this kind of thing all the time.
Usually an editFlag boolean on the page is all you really need. Bind
your WOConditional wrapping your form to that and add some management
actions:
protected boolean _editFlag;
public boolean editFlag() {
return _editFlag;
}
public void setEditFlag(boolean flag) {
_editFlag = flag;
}
public WOComponent editObject() {
setEditFlag(true);
return this.context().page();
}
public WOComponent saveChanges() {
// blah, blah
setEditFlag(false);
return this.context().page();
}
public WOComponent cancel() {
// blah, blah, ec.revert(), blah
setEditFlag(false);
return this.context().page();
}
I also make great use of Paul Suh's SwitchableStrings <http://
www.goodeast.com/>
--
;david
--
David LeBer
"I am codeferous!"
Codeferous Software
site: http://www.codeferous.com
blog: http://david.codeferous.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden