Re: It's never easy
Re: It's never easy
- Subject: Re: It's never easy
- From: Theodore Petrosky <email@hidden>
- Date: Mon, 30 Jan 2012 03:53:26 -0800 (PST)
It works. I thought I would share:
BTW, some of this belongs in the InPlaceExample in the Ajax Examples app as they are broken.
Now I have to figure out how to add the functionality of the AjaxInPlaceEditor. (if you click in the background, the edit area is closed etc.)
<webobject name = "PublicationContactInPlace">
<webobject name = "View"><webobject name = "Value"/></webobject>
<webobject name = "Edit"><webobject name = "ValueField"/></webobject><br/>
</webobject>
WOD
PublicationContactInPlace : AjaxInPlace {
saveAction = saveAfterLeavingInPlaceEditor;
//cancelAction = valueCancelled;
}
Edit : ERXWOTemplate {
templateName = "edit";
}
Value : ERXStringWithLineBreaks {
value = object.pubContact;//VALID
}
ValueField : WOText {
value = object.pubContact;//VALID
}
View : ERXWOTemplate {
templateName = "view";
}
JAVA
public EOEnterpriseObject object() {
return (EOEnterpriseObject)valueForBinding("object");
}
public String key() {
return (String)valueForBinding(key());
}
public String displayValue() {
return (String)object().valueForKey(key());
}
public WOActionResults saveAfterLeavingInPlaceEditor() {
NSLog.out.appendln("***saveAfterLeavingInPlaceEditor");
object().editingContext().saveChanges();
return null;
}
@Override
public boolean synchronizesVariablesWithBindings() {
return false;
}
--- On Sun, 1/29/12, David LeBer <email@hidden> wrote:
> From: David LeBer <email@hidden>
> Subject: Re: It's never easy
> To: "Theodore Petrosky" <email@hidden>
> Cc: "WebObjects Development" <email@hidden>
> Date: Sunday, January 29, 2012, 9:31 PM
> A string containing line breaks will
> display as multiple lines in a textarea, but line breaks
> mean nothing in html so they are ignored otherwise.
>
> It looks like you are going to have to duplicate the
> functionality of the AjaxInPlaceEditor with an AjaxInPlace
> and edit and view template.
>
> The edit template wrapping a WOText, the view template
> wrapping an ERXStringWithLineBreaks.
>
> D
>
> --
> David LeBer
> Codeferous Software
>
> On 2012-01-29, at 6:05 PM, Theodore Petrosky wrote:
>
> > I tried this before but here it is for list
> edification. I created a component with an object
> >
> > <webobject name = "PublicationEditInPlace"/>
> > and bound it with
> > PublicationEditInPlace : AjaxInPlaceEditor {
> > value = object.publication;//VALID
> > rows = 5;
> > cols = 15;
> > }
> >
> > Perhaps because my component is bound into a repetition
> but it does not respect the rows and cols bindings so that
> before I click on the object it will show a single string.
> Then when I click to select, I get the textarea with the
> line feeds.
> >
> > Give me a clue. When I attempt to use the AjaxinPlace
> and the multiple bindings, my component complains that there
> is no setKey nor _setKey etc.
> >
> > I could use some expert guidance.
> >
> > Ted
> >
> > --- On Sun, 1/29/12, David LeBer <email@hidden>
> wrote:
> >
> >> From: David LeBer <email@hidden>
> >> Subject: Re: It's never easy
> >> To: "Theodore Petrosky" <email@hidden>
> >> Cc: "WebObjects Development" <email@hidden>
> >> Date: Sunday, January 29, 2012, 3:06 PM
> >> Ted,
> >>
> >> Please respond to the list.
> >>
> >> It looks like AjaxInPlaceEditor will render a
> textarea if
> >> you supply it with a rows and cols binding.
> >>
> >> The AjaxExample app in Wonder has a multiline
> in-place
> >> editor example that should give you what you need.
> >>
> >> Alternately you can use AjaxInPlace and give it
> your own
> >> edit and view templates (also shown in that
> example).
> >>
> >> D
> >>
> >> --
> >> David LeBer
> >> Codeferous Software
> >>
> >> On 2012-01-29, at 12:15 PM, Theodore Petrosky
> wrote:
> >>
> >>> So either I wasn't clear or I don't understand
> the
> >> answer.
> >>>
> >>> In the ListObject view, I want to present the
> user with
> >> an AjaxInPlaceEditor (I shouldn't say that, I want
> them to
> >> be able to select and edit a cell). For my values
> that will
> >> always be a single line (a name of something), it
> works
> >> great as an AjaxInPlaceEditor.
> >>>
> >>> However, when there is a list of items:
> >>>
> >>> Billy
> >>> Sam
> >>> Jon
> >>>
> >>> they appear as:
> >>>
> >>> Billy Sam Jon (of course on a
> single
> >> line instead of three lines in the
> AjaxInPlaceEditor.)
> >>>
> >>> I examined the source of AjaxInPlaceEditor and
> it
> >> appears to me that this is an implementation of
> >> AjaxInPlace.
> >>>
> >>>
> >>>
> >>> --- On Sun, 1/29/12, David LeBer <email@hidden>
> >> wrote:
> >>>
> >>>> From: David LeBer <email@hidden>
> >>>> Subject: Re: It's never easy
> >>>> To: "Theodore Petrosky" <email@hidden>
> >>>> Date: Sunday, January 29, 2012, 10:37 AM
> >>>> There is no 'magic' Ted, D2W is just
> >>>> WO with a rule engine on top.
> >>>>
> >>>> An ERD2WEditLargString is just a property
> level
> >> component
> >>>> containing a WOText (textarea). So
> implement that.
> >>>>
> >>>> D
> >>>>
> >>>> --
> >>>> David LeBer
> >>>> Codeferous Software
> >>>>
> >>>> On 2012-01-29, at 7:58 AM, Theodore
> Petrosky
> >> wrote:
> >>>>
> >>>>> I viewed David Leber's two part D2W
> tutorial
> >> from 2009
> >>>> where he show how to use a
> CustomComponent.
> >>>>>
> >>>>> Great, I figured out how to add an
> >> AjaxInPlaceEditor to
> >>>> my D2W list page. But now I need a
> combination. An
> >>>> ERD2WEditLargeString that is an
> AjaxInPlaceEditor.
> >>>>>
> >>>>> Is there some magic that can help me
> with this
> >> one?
> >>>>>
> >>>>> Ted
> >>>>>
> >> _______________________________________________
> >>>>> 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
> >>>>>
> >>>>
> >>>>
> >>>
> >>
> >>
> >
>
>
_______________________________________________
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