Re: adding a component to a D2W page
Re: adding a component to a D2W page
- Subject: Re: adding a component to a D2W page
- From: David LeBer <email@hidden>
- Date: Tue, 11 Sep 2012 10:37:03 -0400
InstructionComponentCondition : WOConditional {
condition = d2wContext.showHeaderInstructionComponent;
}
0 : *true* => showHeaderInstructionComponent = "false" [com.webobjects.directtoweb.BooleanAssignment]
100 : pageConfiguration like 'Edit*Foo' => showHeaderInstructionComponent = "true" [com.webobjects.directtoweb.BooleanAssignment]
--
David LeBer
Codeferous Software
On 2012-09-11, at 10:23 AM, Theodore Petrosky <email@hidden> wrote:
> Yea, I like your headerInstructionComponentName better.
>
> your comment about wrapping it in a conditional is interesting. if I understand, it would be like this:
>
>
> <webobject name = "InstructionComponentCondition">
> <webobject name = "InstructionComponent"/>
> </webobject
>
> InstructionComponent : WOSwitchComponent {
> WOComponentName = d2wContext.headerInstructionComponentName;
> }
>
> InstructionComponentCondition : WOConditional {
> condition = "";
> }
>
> but the condition is giving me problems. when I trace backwards to find out how 'hasLeftActions' works, it leads me on a merry chase through ERMDListPageRepetition which extends ERDListPageRepetition which gives me a headache.
>
> can I just create a setter for the boolean and set it from the rules?
>
> as an aside, I noticed that even before I added in the conditional, when I ran my app, the switched in component didn't show up, until I clicked the "clear d2w cache" link a number of times. Even after a relaunch the component didn't show up right away.
>
> Ted
>
>
>
> --- On Mon, 9/10/12, David LeBer <email@hidden> wrote:
>
>> From: David LeBer <email@hidden>
>> Subject: Re: adding a component to a D2W page
>> To: "Theodore Petrosky" <email@hidden>
>> Cc: "email@hidden Development" <email@hidden>
>> Date: Monday, September 10, 2012, 3:21 PM
>> Ted,
>>
>> You don't need the WOComponentContent (unless you plan on
>> wrapping content with your 'instructions' component).
>>
>> You probably want to use something more descriptive than
>> 'compName', i.e: headerInstructionComponentName.
>>
>> Some thoughts:
>>
>> If you can eliminate the dependency on pushing a value into
>> the d2wContext that would be cleaner (i.e: reduce the
>> squickness I feel).
>>
>> 1. Wrap the instruction switch component with a conditional
>> that is controlled by rules. With a default rule to keep it
>> hidden and a specific rule to show it on the pages where it
>> needs to light up.
>>
>> 2. Replace the fixed text with localized text keyed off the
>> page configuration name. Some think like:
>> "[PageConfigurationName][TabName]InstructionText" (i.e:
>> EditUserOverviewInstructionText). So you only need one
>> 'Instruction' component, and the text can change based on
>> the page config and tab (if you're using them). You could
>> make this value overrideable by a value in the rules or
>> pushing a value in the d2wContext if you absolutely needed
>> to.
>>
>> D
>>
>> --
>> David LeBer
>> Codeferous Software
>>
>> On 2012-09-10, at 1:29 PM, Theodore Petrosky <email@hidden>
>> wrote:
>>
>>> I must be doing something wrong because it worked so
>> easily.
>>>
>>> I created a component "AgendaInstructions" with:
>>>
>>> these are the agenda instructions From the
>> AgendaInstructions component!!!
>>> <webobject
>> name=ComponentContent></webobject>
>>>
>>> in the html and:
>>>
>>> ComponentContent: WOComponentContent {
>>> }
>>>
>>> in the wod.
>>>
>>> in the method that returns the page:
>>>
>>
>> page.d2wContext().takeValueForKey("AgendaInstructions",
>> "compName");
>>>
>>> in my ListRepetition component:
>>>
>>> <webobject name = "InstructionComponent"/>
>>>
>>> InstructionComponent : WOSwitchComponent {
>>> WOComponentName = d2wContext.compName;
>>> }
>>>
>>> Is there anything more I 'should' be doing? It seemed
>> too easy.
>>>
>>> Ted
>>>
>>>
>>> --- On Mon, 9/10/12, David LeBer <email@hidden>
>> wrote:
>>>
>>>> From: David LeBer <email@hidden>
>>>> Subject: Re: adding a component to a D2W page
>>>> To: "email@hidden
>> Development" <email@hidden>
>>>> Date: Monday, September 10, 2012, 12:48 PM
>>>> WOSwitchComponent is your friend.
>>>>
>>>> Look at the templates, they are used everywhere.
>>>>
>>>> D
>>>>
>>>> --
>>>> David LeBer
>>>> Codeferous Software
>>>>
>>>> On 2012-09-10, at 12:21 PM, Theodore Petrosky
>> <email@hidden>
>>>> wrote:
>>>>
>>>>> ok this is what I figured out so far:
>>>>>
>>>>> 10 : (look = 'ERModernLook' and (task = 'list'
>> or task
>>>> = 'select' or (task = 'edit' and subTask =
>> 'list'))) =>
>>>> repetitionComponentName =
>> "ERMDSimpleListPageRepetition"
>>>> [com.webobjects.directtoweb.Assignment]
>>>>>
>>>>> from that rule, I see that if we are creating
>> a
>>>> ListPage, this rule says to use
>>>> "ERMDSimpleListPageRepetition".
>>>>>
>>>>> So I created my own framework, and created a
>> component
>>>> "TPMDSimpleListPageRepetition" copying the html,
>> wod, java
>>>> where they belonged.
>>>>>
>>>>> then I created a rule:
>>>>>
>>>>> 10 : (look = 'ERModernLook' and (task = 'list'
>> or task
>>>> = 'select' or (task = 'edit' and subTask =
>> 'list'))) =>
>>>> repetitionComponentName =
>> "TPMDSimpleListPageRepetition"
>>>> [com.webobjects.directtoweb.Assignment]
>>>>>
>>>>> and my D2W app is using my ListPageRep.
>>>>>
>>>>> so my next step was to create a WOString at the
>> top of
>>>> my new shiny component: <webobject name =
>>>> "CopyOnTop"/> and in the wod:
>>>>>
>>>>> CopyOnTop : WOString {
>>>>> value =
>> d2wContext.topCopy;
>>>>> }
>>>>>
>>>>> so that in my method that calls in the listPage
>> I
>>>> added:
>>>>>
>>>>> page.d2wContext().takeValueForKey("This is some
>> copy
>>>> Call Reports", "topCopy");
>>>>>
>>>>> and it gives me what I want. I can just wrap it
>> in a
>>>> div and the stylist and go to town.
>>>>>
>>>>> but, can I add a WOComponent instead of the
>> WOString?
>>>> If yes, the bindings are not obvious. I will keep
>> looking
>>>> maybe a solution will jump out and bite me.
>>>>>
>>>>> adding a component would be handier, easier if
>> I had a
>>>> few paragraphs of information to add.
>>>>>
>>>>> Ted
>>>>>
>>>>>
>>>>> --- On Wed, 9/5/12, Jesse Tayler <email@hidden>
>>>> wrote:
>>>>>
>>>>>> From: Jesse Tayler <email@hidden>
>>>>>> Subject: Re: adding a component to a D2W
>> page
>>>>>> To: "Theodore Petrosky" <email@hidden>
>>>>>> Date: Wednesday, September 5, 2012, 11:01
>> AM
>>>>>> I'm pretty sure you are getting
>>>>>> confused but I'm not looking at it either.
>>>>>>
>>>>>> so, the factory is just going to return
>> whatever
>>>> list page a
>>>>>> rule somewhere tells it to, right?
>>>>>>
>>>>>> so, there's not "the" list page, there's
>> some rule
>>>> that's
>>>>>> saying with this entity, and this task, use
>> this
>>>> page.
>>>>>>
>>>>>> so, whatever your tab menu is doing, it's
>> calling a
>>>> rule to
>>>>>> get the list page --
>>>>>>
>>>>>> you might have to write six rules to get
>> the list
>>>> page to
>>>>>> fire when you want, but it doesn't matter
>> how many
>>>> pages you
>>>>>> create - you're the programmer!
>>>>>>
>>>>>> now, if you're lost on this - try writing
>> some
>>>> rules that do
>>>>>> something you can see clearly on screen in
>> the same
>>>> context
>>>>>> -- this will help you see what rules are
>> firing and
>>>> what
>>>>>> level of specificity you need to override
>> whatever
>>>> is
>>>>>> currently firing.
>>>>>>
>>>>>> sometimes you can even find the rule that's
>> firing
>>>> in some
>>>>>> framework and copy it, raise the priority
>> and
>>>> change the
>>>>>> page name to your page.
>>>>>>
>>>>>> see where I'm going on that?
>>>>>>
>>>>>> hope that sheds some light --
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sep 5, 2012, at 10:44 AM, Theodore
>> Petrosky
>>>> <email@hidden>
>>>>>> wrote:
>>>>>>
>>>>>>> this is what I thought however:
>>>>>>>
>>>>>>> lpi =
>>>>>>
>>>>
>> D2W.factory().listPageForEntityNamed(CallReport.ENTITY_NAME,
>>>>>> session());
>>>>>>>
>>>>>>> This is the page I need to target. the
>> list
>>>> page.
>>>>>>>
>>>>>>> when I click a tab in the menu, it
>> fires off a
>>>> method
>>>>>> to return a listPage.
>>>>>>>
>>>>>>> and it seems that I would have to
>> create 6
>>>> different
>>>>>> listPages as the markup to add is different
>> for
>>>> each tab.
>>>>>>>
>>>>>>> Ted
>>>>>>>
>>>>>>> --- On Wed, 9/5/12, Jesse Tayler <email@hidden>
>>>>>> wrote:
>>>>>>>
>>>>>>>> From: Jesse Tayler <email@hidden>
>>>>>>>> Subject: Re: adding a component to
>> a D2W
>>>> page
>>>>>>>> To: "Theodore Petrosky" <email@hidden>
>>>>>>>> Date: Wednesday, September 5, 2012,
>> 10:16
>>>> AM
>>>>>>>> hmm -- I doubt it --
>>>>>>>>
>>>>>>>> I think I'm saying make a list page
>> called
>>>>
>>>>>>>>
>>>>>>>> TedsCoolListPage.wo
>>>>>>>>
>>>>>>>> Inherit from whatever list page you
>> are
>>>> using now.
>>>>>>>>
>>>>>>>> copy all WOD and HTML from the page
>> you are
>>>> using
>>>>>> now.
>>>>>>>>
>>>>>>>> add whatever you need.
>>>>>>>>
>>>>>>>> write rule to make TedsCoolListPage
>> the
>>>> component
>>>>>> you use on
>>>>>>>> that list, instead of whatever you
>> are
>>>> using.
>>>>>>>>
>>>>>>>> make sense?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sep 5, 2012, at 6:15 AM,
>> Theodore
>>>> Petrosky
>>>>>> <email@hidden>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> I have six tabs. I want to
>> subclass the
>>>> List*
>>>>>> page so
>>>>>>>> that I can fly in some markup
>> before the
>>>> table.
>>>>>>>>>
>>>>>>>>> It seems to me that this
>> method
>>>> requires 6
>>>>>> 'subclasses'
>>>>>>>> of the List* page.
>>>>>>>>>
>>>>>>>>> Is this what you are thinking?
>>>>>>>>>
>>>>>>>>> Ted
>>>>>>>>>
>>>>>>>>> --- On Tue, 9/4/12, Jesse
>> Tayler <email@hidden>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> From: Jesse Tayler <email@hidden>
>>>>>>>>>> Subject: Re: adding a
>> component to
>>>> a D2W
>>>>>> page
>>>>>>>>>> To: "Theodore Petrosky"
>> <email@hidden>
>>>>>>>>>> Date: Tuesday, September 4,
>> 2012,
>>>> 11:43 PM
>>>>>>>>>> oh, I'd just take the html
>> and wod
>>>>>>>>>> bindings from the page you
>> are
>>>> subclassing,
>>>>>> you can
>>>>>>>> subclass
>>>>>>>>>> or not in java, but write a
>> rule to
>>>> use
>>>>>> that
>>>>>>>> component.
>>>>>>>>>>
>>>>>>>>>> edit html and add at
>> will….
>>>>>>>>>>
>>>>>>>>>> might be more simple than
>> you are
>>>> realizing
>>>>>> --
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sep 4, 2012, at 11:01
>> PM,
>>>> Theodore
>>>>>> Petrosky
>>>>>>>> <email@hidden>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Jesse,
>>>>>>>>>>>
>>>>>>>>>>> would you be interested
>> in
>>>> showing me
>>>>>> how to
>>>>>>>> use the
>>>>>>>>>> subclassing technique? I
>> really
>>>> don't know
>>>>>> where to
>>>>>>>> begin
>>>>>>>>>> and it is time I learned
>> something
>>>> new.
>>>>>>>>>>>
>>>>>>>>>>> I would be happy to
>>>> document/record a
>>>>>> session
>>>>>>>> and make
>>>>>>>>>> it available. There may be
>> others
>>>> in the
>>>>>> same
>>>>>>>> boat.
>>>>>>>>>>>
>>>>>>>>>>> Ted
>>>>>>>>>>>
>>>>>>>>>>> --- On Tue, 9/4/12,
>> Jesse
>>>> Tayler <email@hidden>
>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> From: Jesse Tayler
>> <email@hidden>
>>>>>>>>>>>> Subject: Re: adding
>> a
>>>> component to
>>>>>> a D2W
>>>>>>>> page
>>>>>>>>>>>> To: "Theodore
>> Petrosky"
>>>> <email@hidden>
>>>>>>>>>>>> Cc: "WebObjects
>>>> Development" <email@hidden>
>>>>>>>>>>>> Date: Tuesday,
>> September 4,
>>>> 2012,
>>>>>> 12:54 PM
>>>>>>>>>>>> hi ted -
>>>>>>>>>>>>
>>>>>>>>>>>> is this something
>> you can
>>>> add to
>>>>>> your page
>>>>>>>>>> wrapper?
>>>>>>>>>>>>
>>>>>>>>>>>> if maybe that's not
>> a
>>>> great
>>>>>> solution,
>>>>>>>>>>>>
>>>>>>>>>>>> in the past, when I
>> have
>>>> designed
>>>>>> complex
>>>>>>>> D2W apps,
>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I end up
>> subclassing pages
>>>> and
>>>>>> often make
>>>>>>>> container
>>>>>>>>>> elements
>>>>>>>>>>>> like a 'panel' to
>> handle
>>>>>> arrangement of
>>>>>>>> property
>>>>>>>>>> level
>>>>>>>>>>>> components and also
>> to
>>>> report
>>>>>> things or
>>>>>>>> add
>>>>>>>>>> standard UI
>>>>>>>>>>>> elements at that
>> level.
>>>>>>>>>>>>
>>>>>>>>>>>> modern look has so
>> many
>>>> goodies
>>>>>> today, but
>>>>>>>>>> subclassing and
>>>>>>>>>>>> using your own page
>> (or
>>>> panel)
>>>>>> level
>>>>>>>> components is
>>>>>>>>>> a common
>>>>>>>>>>>> way to add
>> something like a
>>>> special
>>>>>> error
>>>>>>>> message
>>>>>>>>>> or
>>>>>>>>>>>> standard UI element
>> that is
>>>> not
>>>>>> part of
>>>>>>>> the
>>>>>>>>>> underlying
>>>>>>>>>>>> system.
>>>>>>>>>>>>
>>>>>>>>>>>> maybe that helps
>> --
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Sep 4, 2012, at
>> 12:43
>>>> PM,
>>>>>> Theodore
>>>>>>>> Petrosky
>>>>>>>>>> <email@hidden>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> I have a D2w
>> app. they
>>>> want to
>>>>>> add
>>>>>>>> some
>>>>>>>>>> instructional
>>>>>>>>>>>> text to the top of
>> the page
>>>> (under
>>>>>> the
>>>>>>>> Menubar).
>>>>>>>>>> Obviously,
>>>>>>>>>>>> the text will
>> change for
>>>> each tab
>>>>>> that is
>>>>>>>>>> selected.
>>>>>>>>>>>>>
>>>>>>>>>>>>> How do I add
>> this
>>>> markup in? or
>>>>>> How do
>>>>>>>> I create
>>>>>>>>>> the
>>>>>>>>>>>> hook so a component
>> can fly
>>>> in here
>>>>>> as
>>>>>>>> needed?
>>>>>>>>>>>>>
>>>>>>>>>>>>> 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
>>>>
>>>>
>>>> --
>>>> David LeBer
>>>> Codeferous Software
>>>>
>>>>
>>>> _______________________________________________
>>>> 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