cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn C. Vos" <>
Subject RE: Is it possible to change the layout of Widgets with AJAX=true
Date Thu, 26 Oct 2006 16:12:37 GMT
Robby Pelssers, AGP <> schreef:
> Suppose I have a set of objects whose properties I either want to
> show in Mode 'edit' or  'output'.  Depending on some event (user
> changes Mode of one object by  
> clicking on button in repeaterrow),  I want to change the state of
> the property-i widgets from 'output' to 'active'.

This sounds like something you should do in the validation of the
widget the user clicked on. I'd have to look up the details, but
you can do that too.

> Also I would like
> myl layout to change like example below.  In non-ajax mode this is no
> problem, since the jx-template is processed again.  How could I
> accomplish this behaviour with AJAX=true ??    
> In my jx-template looks like this:

[edited a bit for brevity]
>         <jx:choose>
>           <jx:when test="${Mode.equals('edit')}">
>             <tr>
>               <td><ft:widget-label id="property1"/></td>
>               <td><ft:widget id="property1"/></td>
>             </tr>
>           </jx:when>
>           <jx:otherwise>
>              <tr>
>                <td><ft:widget id="property1"/></td>
>              </tr>
>           </jx:otherwise>
>         </jx:choose>

This won't work, because cforms-ajax only updates individual widgets
that have changed. It won't remove a widget for you.

To change the apppearance of a widget, you'll have to override the
default form styling in a custom styling xsl. You can either use
that to turn your label invisible, or you can make the label part
of the widget itself.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message