mini-lang would be a nice add on but i think very convenient to have use-when. use-when is pretty popular in forms so will need very little training. I feel ofbiz should try to reuse grammer present in different xsds. Less concepts, less training.
Section optional seems like a great idea. We always use separate screens and call one from other using include-screen. Never thought about sections. It seems to add little from grammer pov. You are suggesting allowing sub elements of section (actions, widget etc.) to be under screen right ? Harmeet ----- Original Message ----- From: "Adrian Crum" <[email protected]> To: [email protected] Sent: Friday, July 24, 2009 12:51:01 AM GMT -05:00 US/Canada Eastern Subject: Re: use-when for widget-screen.xsd I'm glad this has been brought up. I agree that the current screen widget conditional logic is cumbersome to use. The use-when attribute is one alternative, another approach would be to include support of the mini-lang if conditional element - so multiple screen widgets can be included in a conditional block (without the need for a section element). While we're on the subject, the section element should be optional. According to David Jones' comments, the section element was meant to be a way to reuse sections of a screen. Yet that capability hasn't been implemented. Every screen must have one main section element. If you try to create more than one main section element the rest are ignored. The end result is, every screen definition has an unnecessary section element. From my perspective, a screen element should BE a section element (in other words, a screen IS a section) which would eliminate the need to create one, and section elements within the screen should require a name - since the intent is to reuse that section. If those rules were enforced, then the if element could control the display of portions of screens, and the screen sections are clearly meant to be reused. -Adrian --- On Thu, 7/23/09, Harmeet Bedi <[email protected]> wrote: > From: Harmeet Bedi <[email protected]> > Subject: use-when for widget-screen.xsd > To: "dev" <[email protected]> > Date: Thursday, July 23, 2009, 6:43 PM > I would like to ask you what you > think about having use-when attribute for various screen > elements and defaulted to true. > > The current condition check and widgets, fail-widgets > mechanism is a bit wordy, does not allow easy switching for > any type of element and is not as close in grammer to > use-when in widget-form.xsd.. should make grammers closer if > possible in various spots. > > I was hoping it to have it for all elements. so for > instance one could say something like this: > > <include-form name="FormRef1" > location="SomeLocation.xml" use-when="${showRef1}"/> > <include-form name="FormRef2" > location="SomeLocation.xml" use-when="${showRef2}"/> > > or container, or widget or etc.. > > <container use-when="${showSpecialCaseContainer}"> > .. > </container> > > > Thoughts ? > Harmeet >
