myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Schofield <sean.schofi...@gmail.com>
Subject Re: [Myfaces-develop] New feature suggestion : Edit mode
Date Wed, 04 May 2005 15:31:54 GMT
The editable attribute might be a little bit of overkill.  Yes for
text it would be nice to alternate between HTML text or inputText but
that could also be achieved using the rendered attribute.

<h:inputText value="#{foo.value}" rendered="#{foo.isEditable}"/>
<h:outputText value="#{foo.value}" rendered="#{!foo.isEditable}">

So yes you type two lines of code but I would argue that the above is
more obvious "at a glance."

Is there an argument against my approach besides the extra line of code?

sean


On 5/4/05, Martin Marinschek <martin.marinschek@gmail.com> wrote:
> That would be possible.
> 
> The names for the style classes will need to be "styleEditable" and
> "styleClassEditable", so that it is possible to link them to the
> "editable" property.
> 
> another thing we have to consider is the case that an editable
> component can turn its state during the life cycle - what do we do if
> we render out just the value like in an output component and then the
> component turns to be an input component again?
> 
> we would probably need a hidden field with the value so that the
> component can play "chameleon" without a problem.
> 
> regards,
> 
> Martin
> 
> On 5/4/05, Sylvain Vieujot <svieujot@apache.org> wrote:
> >  Another useful thing might be to be able to set editable to a bunch of
> > components at once like :
> >
> >  <section editable="#{some condition}">
> >      ....
> >      <x:inputText .../>
> >  </section>
> >
> >  This would set the editable flag on all the section's editable children.
> >
> >  Maybe we could just add the editable attribute to x:panelGroup to do this.
> >
> >
> >  On Wed, 2005-05-04 at 09:53 -0400, Sylvain Vieujot wrote:
> >
> >  editable sounds good to me.
> >
> >  any idea for the styleClassReadMode/notEditableStyleClass
> > ??
> >  Just to show a use case : on some documents, the users can edit some fields
> > depending on their rights.
> >  If they can't edit the fields, editable is set to false, but I would like
> > to display the text in grey, so that the user understands it's not a bug. It
> > makes it more clear that he can see the information, but not change it.
> >
> >
> >  On Wed, 2005-05-04 at 08:42 -0500, Stan Silvert wrote:
> >  Whatever you do, just don't call it "Edit mode". "Edit mode" is a term
> > used in portlets. Since JSF is being billed as the perfect framework
> > for portlets we wouldn't want there to be a MyFaces "edit mode" that
> > gets confused with portlet "edit mode".
> >
> > Stan Silvert
> > JBoss, Inc.
> > ssilvert@jboss.com
> > callto://stansilvert
> > > -----Original Message-----
> > > From: Martin Marinschek [mailto:martin.marinschek@gmail.com]
> > > Sent: Wednesday, May 04, 2005 5:08 AM
> > > To: MyFaces Development
> > > Subject: Re: [Myfaces-develop] New feature suggestion : Edit mode
> > >
> > > "editable" would be a possibility.
> > >
> > > what do you think, Sylvain?
> > >
> > > regards,
> > >
> > > Martin
> > >
> > > On 5/4/05, Korhonen, Kalle <kkorhone@cisco.com> wrote:
> > > > > -----Original Message-----
> > > > > From: Martin Marinschek [mailto:martin.marinschek@gmail.com]
> > > > > Subject: Re: [Myfaces-develop] New feature suggestion : Edit mode
> > > > > but that is a flag with a meaning for the html tags, it is
> > > > > written through to the html output - I don't think we should
> > > > > tamper with those tags.
> > > >
> > > > Uh.. true. I figured it might be up to the renderer, but no, it's
> > > > browser enforced. For the new attribute, how about "editable"
> > instead of
> > > > "editMode"?
> > > >
> > > > Kalle
> > > >
> > > > > On 5/4/05, Korhonen, Kalle <kkorhone@cisco.com> wrote:
> > > > > >
> > > > > > Shouldn't we rather use the standard "readonly" attribute
> > > > > for this, as
> > > > > > specified in JSF RI?
> > > > > >
> > > > > > Kalle
> > > > > >
> > > > > >
> > > > > > readonlyfalsefalsejava.lang.String Flag indicating
> > that
> > > > > this component
> > > > > > will prohibit changes by the user. The element may receive focus
> > > > > > unless it has also been disabled.
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > From: Sylvain Vieujot [mailto:svieujot@apache.org]
> > > > > > Sent: Tuesday, May 03, 2005 6:53 PM
> > > > > > To: dev@myfaces.apache.org
> > > > > > Subject: Fwd: [Myfaces-develop] New feature suggestion : Edit
> > mode
> > > > > >
> > > > > >
> > > > > > Quite sometimes ago, we discussed on adding an editMode
> > > > > attribute the
> > > > > > meaningful x: components.
> > > > > > The explanation for this is in the forwarded email
> > > > > discussion bellow.
> > > > > >
> > > > > > To summarize what it's about :
> > > > > > <x:inputText ... editMode="true"> renders as the standard
input
> > box
> > > > > > <x:inputText ... editMode="false"> renders as an x:outputText
> > > > > >
> > > > > > I now need those features, and would like to implement them
> > > > > (have them
> > > > > > implemented).
> > > > > > So, I would like to check everyone still agrees with this.
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Sylvain.
> > > > > >
> > > > > > Subject: Re: [Myfaces-develop] New feature suggestion : Edit
> > mode
> > > > > > Date: Fri, 30 Jul 2004 10:51:39 -0400
> > > > > > One more precision :
> > > > > > I didn't dig into the role based access -- used in disabled
for
> > > > > > example -- right now.
> > > > > > Maybe we have to think for one minute about the integration
of
> > this
> > > > > > with editMode.
> > > > > >
> > > > > > As of now, I think it works well :
> > > > > > editMode == true => standard behavior
> > > > > > editMode == false => renders as output anyway.
> > > > > >
> > > > > > But as I'm not sure I fully understand the MyFaces roles right
> > now,
> > > > > > maybe I'm wrong or there is something smarter to do.
> > > > > >
> > > > > > Sylvain.
> > > > > >
> > > > > > On Fri, 2004-07-30 at 10:12, Sylvain Vieujot wrote:
> > > > > >
> > > > > > Yes, that's it.
> > > > > >
> > > > > > I also think that the editmode attribute is better (in fact
> > > > > editMode
> > > > > > as I think this is the convention, like for actionListener).
> > > > > >
> > > > > > Thanks for your feedback.
> > > > > >
> > > > > > Sylvain.
> > > > > >
> > > > > > On Fri, 2004-07-30 at 03:22, Manfred Geiler wrote:
> > > > > > Hi,
> > > > > > Just a short summarize of your suggestion, so that I'm sure
> > > > > that I got
> > > > > > it right:
> > > > > > - we indroduce a new attribute "edit" (or "editmode") for
> > > > > all extended
> > > > > > input components (x: tags)
> > > > > > - default value of this attribute is true
> > > > > > - value of true does not change rendering
> > > > > > - value of false renders an output (normal html text) instead
of
> > an
> > > > > > input (html input tag)
> > > > > >
> > > > > > Ok, her is my vote:
> > > > > > +1 for such an attribute
> > > > > > +.4 for name "edit"
> > > > > > +.6 for name "editmode"
> > > > > >
> > > > > > Regards,
> > > > > > Manfred
> > > > > >
> > > > > >
> > > > > > Sylvain Vieujot wrote:
> > > > > > > *Feedback requested on implementing a new edit attribute
> > > > > for the x: tags :
> > > > > > > *
> > > > > > > I used to program a lot with Notes/Domino, and Domino has
a
> > very
> > > > > > > nice feature :
> > > > > > > You design a form, and the you use it either in read or
edit
> > mode.
> > > > > > > In read mode, you just see the fields contents (i.e.
> > > > > h:outputText in
> > > > > > > JSF), and in edit mode, you have the corresponding input
> > > > > field (i.e.
> > > > > > > h:inputText(area) in JSF).
> > > > > > >
> > > > > > > This is a very useful feature that really help to quicken
> > > > > the development.
> > > > > > > In JSF right now, as far as I know, you either have to
> > > > > design 2 forms :
> > > > > > > one for read mode, and one for edit mode, or (especially
if
> > the
> > > > > > > access can be different for each field) like here :
> > > > > > >
> > > > > > > <h:inputText value="#{order.client}" size="50"
> > > > > > rendered="#{editMode.edit}"/>
> > > > > > > <h:outputText value="#{order.client}" rendered="#{!
> > > > > > > editMode.edit}"/>
> > > > > > >
> > > > > > > I think it would be way easier to add an *edit* attribute
> > > > > to the x:
> > > > > > > tags, that would reduce the upper code to :
> > > > > > >
> > > > > > > <x:inputText value="#{order.client}" size="50"
> > > > > > > *edit*="#{editMode.edit}"/>
> > > > > > >
> > > > > > > For sure, you can use the disabled attribute, but here,
> > > > > you wouldn't
> > > > > > > have the text in a disabled box, but you would see it
> > > > > clear which is
> > > > > > > much nicer.
> > > > > > > For the x:dateInput tag that I just did, it would also
> > > > > look nicer to
> > > > > > > see a clean text with the date/time instead of all the
input
> > > > > > > fields/combo
> > > > > > boxes.
> > > > > > > For the x:fileUpload also, it would allow to display the
> > > > > file name
> > > > > > > and maybe render the file in case the edit attribute is
> > > > > set to false.
> > > > > > >
> > > > > > > In the current MyFaces exemples, for the dataTable.jsf
> > > > > example, if
> > > > > > > you want to edit all the countries, you also have to
> > > > > design a new form.
> > > > > > > I think with an edit attribute, we could avoid the
> > > > > > > countryTableForm.jsf, and have only one form.
> > > > > > >
> > > > > > > I also need a wiki style input tag where in edit mode,
you
> > enter
> > > > > > > text with wiki like formating, and in read mode, you just
see
> > the
> > > > > > > formated
> > > > > > text.
> > > > > > > In such cases, the edit (or whatever we choose to name
> > > > > it) attribute
> > > > > > > is mandatory.
> > > > > > >
> > > > > > > So, my question is :
> > > > > > > Would you agree that we implement a standard edit
> > > > > attribute for all
> > > > > > > the
> > > > > > > x: tags where it's relevant ?
> > > > > > >
> > > > > > > And as you might guess, I think it would really be a big
plus
> > for
> > > > > > > MyFaces as it would dramatically improve and simplify
> > > > > some developments.
> > > > > > >
> > > > > > > Thanks for your feedback.
> > > > > > >
> > > > > > > Sylvain.
> > > > > >
> > > > > >
> > > > > >
> > -------------------------------------------------------
> > > > > > This SF.Net email is sponsored by OSTG. Have you noticed
> > > > > the changes
> > > > > > on Linux.com, ITManagersJournal and NewsForge in the past
> > > > > few weeks?
> > > > > > Now, one more big change to announce. We are now OSTG- Open
> > Source
> > > > > > Technology Group. Come see the changes on the new OSTG site.
> > > > > > www.ostg.com
> > _______________________________________________
> > > > > > Myfaces-develop mailing list
> > > > > > Myfaces-develop@lists.sourceforge.net
> > > > > >
> > https://lists.sourceforge.net/lists/listinfo/myfaces-develop
> > > > > >
> > > > > >
> > > > >
> > > >
> >
> >
>

Mime
View raw message