cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject [cforms] selection list binding
Date Wed, 10 Mar 2004 15:29:28 GMT
Hello,

below you will find the mail I wanted to send first, but after having written it
I found the solution myself:
I thought about the correct event instead of on-value-changed, I came to on-bind
and in the binding docu I found wb:javascript and came to following code that
nearly satisfies me:

<wb:javascript id="filter.object" path="objects" direction="load">
  <wb:load-form>
    var objects = jxpathPointer.getNode();
    widget.setSelectionList(objects, "id", "name")
  </wb:load-form>
</wb:javascript>

The question is just if this could be added with a "real" element in the wb
namespace, e.g. wb:list and the path has to point to a collection.

And another question related to this: I want to add a first item to the
selection list with an empty value meaning nothing is filtered due to this
field. But when using setSelectionList() this item is replaced and I found no
addSelectionList that does an addCollection(coll) on the java.util.Collection
level. Any suggestions for this?

Joerg

================================================================================

Hello,

as you might already know I'm using the CForms framework for my recent project.
At the moment I'm at a point where the options that I have and know about don't
satisfy me. It's about dynamic selection lists. I know two possibilities:
@src="uri" in form definition and setSelectionlist(obj, str, str) in flow. Both
need a not so straight handling. @src="uri" needs a complete separate call back
to the backend. And also with flow it's more complicated then maybe necessary.

The pages are for searching different types of objects and different types of
objects also need different types of filters. But until now I also have only one
flow function for all the object list display pages. I don't want to add form
specific code into the generic flow function. So I don't want to add form
specific setSelectionlist() calls into it.

I have the filter values in a filter object to which I do the binding. It would
be no problem to also put the collection for the selection list into it, but to
set the selection list on the widget. As I would need flow to get the collection
from the filter object and set it by hand (the form specific part would need to
know about the widget to set the selection list and the path in the bean).

I really wonder why this is not directly doable by the binding - or is it?

I also saw the country selector sample, which shows a nice solution for the form
specific flow, but there the selection list is set on-value-changed. I want to
set it always, independent of any event.

Hope this mail was not to irritating :)

Joerg


Mime
View raw message