datatable-cells editable or read-only

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

datatable-cells editable or read-only

Heinrich Götzger
Hello,

within a fr:datatable I'd like to have single cells editable or
read-only, depending on whether the line is new or not.

So i tried as follows (reduced copy of page):

<xhtml:tbody>

    <xhtml:tr

       repeat-nodeset="instance('content')/Items/item"

       id="item-repeat">

       [...]

       <xhtml:td

          id="item-table-column-data_S"

          width="110px">

          <xhtml:div>

             <xf:group

                ref="./item[@new]">

                <xhtml:div

                   style="white-space: nowrap;">

                   <xf:input

                      id="WF_Item_S"

                      type="text"

                      ref="S"/>

                   <xi:include

                      href="oxf:/contextHelp.xhtml"/>

                </xhtml:div>

             </xf:group>

          </xhtml:div>

          <xf:group

             ref="./item[not(@new)]">

             <xf:output

                id="WF_Item_S_ro"

                type="text"

                ref="S">

                <xf:hint>

                   <xf:output

                      mediatype="text/html"

                      ref="instance('content')/Items/item[$position]/S_TEXT"/>

                </xf:hint>

             </xf:output>

          </xf:group>

       </xhtml:td>

       [...]

    </xhtml:tr>

</xhtml:tbody>


But unfortunately it is not working as expected. There is no content in
the cell at all, even in the existing items.

The instance looks like:

<Items>

    <item>

       <S>12345</S>

       <S_TEXT>Text for 12345</S_TEXT>

    </item>

</Items>

and for new lines it has the attribute new in the node item:

<Items>

    <item new='true'>

       <S/>

       <S_TEXT/>

    </item>

</Items>



So how would the recommended way be to get these feature?

Thanks for helping with ideas.

Cheers

Heinrich

--
Before printing this e-mail, think about our environmental responsibility.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: datatable-cells editable or read-only

Erik Bruchez
Administrator
Heinrich,

Your repeat expression:

    instance('content')/Items/item

already points to `item` elements.

Now within the repeat:

    ./item[@new]

points to a child element `item` of the current item. So this would
point to `item/item`, which doesn't work.

Instead, write:

    .[@new]

-Erik

On Mon, Mar 26, 2012 at 8:21 AM, Heinrich Götzger <[hidden email]> wrote:

> Hello,
>
> within a fr:datatable I'd like to have single cells editable or read-only,
> depending on whether the line is new or not.
>
> So i tried as follows (reduced copy of page):
>
> <xhtml:tbody>
>
>   <xhtml:tr
>
>      repeat-nodeset="instance('content')/Items/item"
>
>      id="item-repeat">
>
>      [...]
>
>      <xhtml:td
>
>         id="item-table-column-data_S"
>
>         width="110px">
>
>         <xhtml:div>
>
>            <xf:group
>
>               ref="./item[@new]">
>
>               <xhtml:div
>
>                  style="white-space: nowrap;">
>
>                  <xf:input
>
>                     id="WF_Item_S"
>
>                     type="text"
>
>                     ref="S"/>
>
>                  <xi:include
>
>                     href="oxf:/contextHelp.xhtml"/>
>
>               </xhtml:div>
>
>            </xf:group>
>
>         </xhtml:div>
>
>         <xf:group
>
>            ref="./item[not(@new)]">
>
>            <xf:output
>
>               id="WF_Item_S_ro"
>
>               type="text"
>
>               ref="S">
>
>               <xf:hint>
>
>                  <xf:output
>
>                     mediatype="text/html"
>
>                     ref="instance('content')/Items/item[$position]/S_TEXT"/>
>
>               </xf:hint>
>
>            </xf:output>
>
>         </xf:group>
>
>      </xhtml:td>
>
>      [...]
>
>   </xhtml:tr>
>
> </xhtml:tbody>
>
>
> But unfortunately it is not working as expected. There is no content in the
> cell at all, even in the existing items.
>
> The instance looks like:
>
> <Items>
>
>   <item>
>
>      <S>12345</S>
>
>      <S_TEXT>Text for 12345</S_TEXT>
>
>   </item>
>
> </Items>
>
> and for new lines it has the attribute new in the node item:
>
> <Items>
>
>   <item new='true'>
>
>      <S/>
>
>      <S_TEXT/>
>
>   </item>
>
> </Items>
>
>
>
> So how would the recommended way be to get these feature?
>
> Thanks for helping with ideas.
>
> Cheers
>
> Heinrich
>
> --
> Before printing this e-mail, think about our environmental responsibility.
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: datatable-cells editable or read-only

Heinrich Götzger
Erik,

well, what shall I say?

Thank you.

Cheers

Heinrich

On 03/27/12 06:49, Erik Bruchez wrote:

> Heinrich,
>
> Your repeat expression:
>
>      instance('content')/Items/item
>
> already points to `item` elements.
>
> Now within the repeat:
>
>      ./item[@new]
>
> points to a child element `item` of the current item. So this would
> point to `item/item`, which doesn't work.
>
> Instead, write:
>
>      .[@new]
>
> -Erik
>
> On Mon, Mar 26, 2012 at 8:21 AM, Heinrich Götzger<[hidden email]>  wrote:
>> Hello,
>>
>> within a fr:datatable I'd like to have single cells editable or read-only,
>> depending on whether the line is new or not.
>>
>> So i tried as follows (reduced copy of page):
>>
>> <xhtml:tbody>
>>
>>    <xhtml:tr
>>
>>       repeat-nodeset="instance('content')/Items/item"
>>
>>       id="item-repeat">
>>
>>       [...]
>>
>>       <xhtml:td
>>
>>          id="item-table-column-data_S"
>>
>>          width="110px">
>>
>>          <xhtml:div>
>>
>>             <xf:group
>>
>>                ref="./item[@new]">
>>
>>                <xhtml:div
>>
>>                   style="white-space: nowrap;">
>>
>>                   <xf:input
>>
>>                      id="WF_Item_S"
>>
>>                      type="text"
>>
>>                      ref="S"/>
>>
>>                   <xi:include
>>
>>                      href="oxf:/contextHelp.xhtml"/>
>>
>>                </xhtml:div>
>>
>>             </xf:group>
>>
>>          </xhtml:div>
>>
>>          <xf:group
>>
>>             ref="./item[not(@new)]">
>>
>>             <xf:output
>>
>>                id="WF_Item_S_ro"
>>
>>                type="text"
>>
>>                ref="S">
>>
>>                <xf:hint>
>>
>>                   <xf:output
>>
>>                      mediatype="text/html"
>>
>>                      ref="instance('content')/Items/item[$position]/S_TEXT"/>
>>
>>                </xf:hint>
>>
>>             </xf:output>
>>
>>          </xf:group>
>>
>>       </xhtml:td>
>>
>>       [...]
>>
>>    </xhtml:tr>
>>
>> </xhtml:tbody>
>>
>>
>> But unfortunately it is not working as expected. There is no content in the
>> cell at all, even in the existing items.
>>
>> The instance looks like:
>>
>> <Items>
>>
>>    <item>
>>
>>       <S>12345</S>
>>
>>       <S_TEXT>Text for 12345</S_TEXT>
>>
>>    </item>
>>
>> </Items>
>>
>> and for new lines it has the attribute new in the node item:
>>
>> <Items>
>>
>>    <item new='true'>
>>
>>       <S/>
>>
>>       <S_TEXT/>
>>
>>    </item>
>>
>> </Items>
>>
>>
>>
>> So how would the recommended way be to get these feature?
>>
>> Thanks for helping with ideas.
>>
>> Cheers
>>
>> Heinrich
>>
>> --
>> Before printing this e-mail, think about our environmental responsibility.
>>
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing
>> list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>

--
Before printing this e-mail, think about our environmental responsibility.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws