cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roy huang" <lingererhu...@hotmail.com>
Subject Re: disabling widgets
Date Mon, 05 Apr 2004 10:28:49 GMT
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107792005324520&w=2
In this link,Sylvain suggest 3 states for a widget,I think it's a good idea.
Today I want to hide an action under some condition ,but I just can't if I don't modify the
forms-field-styling.xsl.
I use a transformer to generate different cocoon form define under different condition,but
the widget is always there(type may be different).So in style xml I can always use widget
like that:
    <ft:widget id="edit">    
    </ft:widget>  
But if I remove the widget from the form define file,display will generate an error about
'Widget with id "***" does not exist in the form container'.I thought an afternoon and believe
I must modify forms-field-styling.xsl to do the job,but I don't like this method.(see also:http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107774469108519&w=2)

Yes,content and display should separate ,but if just the content indicate display it or not?The
Cocoon Forms proposal contain <fd:choice> (http://wiki.cocoondev.org/Wiki.jsp?page=WoodyScratchpad),
I think this proposal is similar to what I am doing now.So if the inline widget doesn't exist
and displaytemplate use it ,it will generate the same error.

Solution suggestion:
1.Do not generate error if a widget not exist ,just not render or ignore it.Of course ,this
can turn on and off by parameter.
2.Sylvain's suggest,3 states for a widget.this state is an attribute of a widget define,we
can modify it by flow or own transformer.

WDYT?

Roy Huang
Mime
View raw message