logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: extending Chiba: msg#00033

Subject: Re: extending Chiba
Hello Joern + Uli,

I'm sending the screenshot attached, it should make clearer why we needed to
develop a new component instead of just styling the select/itemset. At first I
tried to get this same effect just using the select control as it is, but the
closest we can get is a select[@xforms:appearence="full"]. However, selects have
no "columns", there is just one label for each item, and that already hinders us
a lot.

As you can learn from the screenshot, each column can contain plain text or a
link displayed as text, or a link displayed as an image icon. Each column's
header can be clicked to sort the displayed data in ascending or descending 
order.

The markup is very provisional, but it's currently more or less like this:

<xforms:select xforms:bind="bind-result" xforms:appearence="full">

  <our:list xforms:bind="bind-employee">
    <!-- here we have multiple labels!!! -->
    <xforms:label xforms:id="label-edit" our:image="html/img/pencil.gif"/>
    <xforms:label xforms:bind="bind-code"/>
    <xforms:label xforms:id="label-name" xforms:bind="bind-name"/>
    <xforms:label xforms:bind="bind-sex"/>
    <xforms:label xforms:bind="bind-birthdate"/>

    <!-- then we specify links for some columns -->
    <!-- the params are appended to the URL with instance data -->
    <our:link our:url="http://localhost/myxform"; our:label="label-name">
      <our:param our:name="id" xforms:bind="bind-code"/>
      <our:param our:name="action">details</our:param>
    </our:link>

    <our:link our:url="http://localhost/myxform"; our:label="label-edit">
      <our:param our:name="id" xforms:bind="bind-code"/>
      <our:param our:name="action">edit</our:param>
    </our:link>

    <!-- finally we have the itemset's standard xforms:value -->
    <xforms:value xforms:bind="bind-code"/>
  </our:list>
</xforms:select>

The instance document to which the list control is bound is pretty common,
except that the first element of the nodeset is used as the column's headers and
the following elements are bound to the items labels/values.

We are still discussing the markup, a finished definition for the attributes
and/or namespaces, we are considering if we should use XLink's attributes
somewhere, etc.

The implementation of the list control was really trivial, we just made a copy
of Itemset class and created two new methods in this new class - they are called
from expand() - so it processes several labels instead of just one. We then
created a new XSLT template to render it as desired. We had to change a few
methods in Chiba (see my previous message) so our custom control is recognized.

It's this last step, having to change Chiba itself, that we seek to avoid. Maybe
in the next week we will be coming with a proposal.

By the way, both the namespace URI and the *prefix* seem to be hard-coded in
NamespaceCtx class, shouldn't the prefix be allowed to vary freely according to
the definition in the XHTML file? Is it possible?

Flavio Costa

Attachment: listing.jpg
Description: JPEG image


Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>