not sure if I fully get it, but does this look appealing (shown with
jboss-seam and facelets code):

@Name("editState") @Scope(ScopeType.CONVERSATION)
public class EditStateBean {
private Map<String, Boolean> editing = new HashSet<String, Boolean>();
public Map<String, Boolean> getEditing() {
  return editState;
}
}

<html>
<body>
<h:form>

<sandbox:limitRendered>
  <h:panelGroup rendered="#{editState.editing['firstName']}">
    <h:inputText value="#{bean.firstName}" />
    <h:commandButton value="Save">
      <t:updateActionListener property="#{editState.editing['firstName']}"
        value="#{false}" />
    </h:commandButton>
  </h:panelGroup>
  <h:panelGroup>
    <h:outputText value="#{bean.firstName}" />
    <h:commandButton value="Edit">
      <t:updateActionListener property="#{editState.editing['firstName']}"
        value="#{true}" />
    </h:commandButton>
  </h:panelGroup>
</sandbox:limitRendered>

</h:form>
</body>
</html>

Then you can take this one step further and create a facelets include
or a custom component to make this easier to do it many times. You can
also add in PPR/AJAX support as desired.

On 8/3/07, Jerome Iffrig (Europe) <[EMAIL PROTECTED]> wrote:
>
>
>
> Thanks Andrew,  my question was more about how to handle the business logic
> / presentation layer behind the scenes. My point is that I don't want to
> have 20 JSPs and and mappings for each of the fields to be updated - I'd
> like to have 1 JSP to update text field, 1 JSP to update a select list
> .etc... But the data to be displayed in the first place (current value, to
> be updated) and the totle of the page to change depending on what field is
> to be updated... Is there an easy way to wrap this all together?
>
> Many thanks.
>
>  ________________________________
>  From: Andrew Robinson [mailto:[EMAIL PROTECTED]
> Sent: Thu 02/08/2007 17:20
> To: MyFaces Discussion
> Subject: Re: Form elements to update in separate window (eBay style)
>
>
>
>
> You could use an in page dialog (like a4j's or tomahawk's modal
> dialog). Using AJAX would make it easy to update just portions of the
> page
>
> On 8/2/07, Jerome Iffrig (Europe) <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > Hi,
> >
> >
> >
> > If any of you use eBay, you would have noticed the way it handles the
> update
> > of some fields.
> >
> > To put it short, you have your user information displayed on the screen.
> >
> > To modify your profile (e.g. your e-mail address) eBay does not display a
> > big form with all your information editable, it rather displays a tiny
> form
> > with the single editable field, the one to modiy.
> >
> >
> >
> > Do you have any idea on how this can be implemented with JSF (for info I
> use
> > Spring to wrap my services and Hibernate for saving my data in the DB).  I
> > was imagining some dynamic way in which I could reuse only a handful of
> > JSPs/actions (one for text field, one for drop-downs) with dynamic
> > recognition of the object type and some way to glue a validator in.
> >
> >
> >
> > Thanks for your ideas.
> >
> >
> >
> >
> >
> >
>

Reply via email to