cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <g...@tuffmail.com>
Subject Re: Personalize CForms
Date Thu, 27 Jul 2006 10:30:40 GMT
Omar Adobati napisaƂ(a):
> Good Morning all,
>
> In which way I could personalize the CForms widgets?
> I'd like to be able to set the input sizes, such as the style and the
> behavior when certain condition happen (suppose when I check more the
> THE_LIMIT checkboxes).
> Now, I can do it using "standard" forms, but I don't know what I have
> to manage to do the same with CForms.
What about generating custom <fi:styling/> [1] tag? You could calculate 
needed size in event handler[2] (e.g. onValueChanged) and place 
calculated value in form attribute (CForms has a concept of attributes, 
see javadocs [3]). Then you could obtain it from JXTemplate while 
generating <fi:styling/>.
This should do the trick in very clean way.
> Another question:
> I'm taking a look to the form-samples-styling.xsl and it just import
> or include other xsl file using, for example, this line of code:
>
> <xsl:include 
> href="resource://org/apache/cocoon/forms/resources/forms-page-styling.xsl"/> 
>
>
> I can't understand the "reference" protocol... where it point? Will be
> a good choice to try to edit the files included or imported by this
> stylesheet?
I guess you mean "context://" protocol? ;-)
If so, it enables you to access files from servlet context path. 
Basically these are files placed in WEB-INF/classes and 
WEB-INF/lib/*.jar. XSL given in example is stored in some CForm's jar. 
You should not try to edit these included/imported XSLs in need of 
customization. Only edit them when you make a generic patch that for 
example fix some bug, and then do not forget to donate it back to the 
Cocoon :-)
So in short: follow good practices, import needed stylesheets and create 
your own templates that override original ones.

Hope this helps. If you have additional questions, do not hesitate to ask.

[1] http://cocoon.apache.org/2.1/userdocs/widgets/widget_field.html
[2] http://cocoon.apache.org/2.1/userdocs/widgetconcepts/eventhandling.html
[3] 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/forms/formmodel/Widget.html#setAttribute(java.lang.String,%20java.lang.Object)

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message