You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jan Hoskens <jh...@schaubroeck.be> on 2004/11/10 14:58:23 UTC
JXtemplate session-context
Hi,
Is there a way to get session-context information in
JXTemplateGenerator? I know there's a session, but what if I need to
retrieve the ID from the authencation context? (context=authentication
and path=authentication/ID)
Kind Regards,
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JX-Template with repeater data... how to?
Posted by Philipp Rech <ph...@gmx.de>.
>>> Instead of FormTemplateTransformer use template.jx macro library for
>>> CForms.
>>>
uhh, i have no idea what that is or how to use the "template.jx macro
library". Could someone explane please? Is the way i've tried it wrong? (see
below)thanks a lot for your help and a great weekend to all of you!
phil-
> Philipp Rech wrote:
> > hello Cocooner's!
> >
> > i have a problem: want to display data from a repetar widget in a
> > JX-Template. So data is passed to the template via a Flow:
> > ---------------------------------------------------------------
> > form2.showForm("goods");
> > var model2 = form2.getModel();
> > cocoon.sendPageAndWait("confrim_goods", {"model": model2});
> > --------------------------------------------------------------
> > with works fine with usual c-forms and jx-tempalets
> > where i adress them like:
> > --------------------------------------------------------------
> > <div>>${model.WIDGET_NAME}</div>
> > --------------------------------------------------------------
> > but how can i do the same with a repeater
> > (the c-forms tempalte is this):
> > -------------------------------------------------------------
> > <ft:widget-label id="goods"/><br/>
> > <ft:repeater-size id="goods"/>-
> > <table border="1">
> > <tr>
> > <th><ft:repeater-widget-label id="goods"
> widget-id="goodsMaterialId"/></th>
> > <th><ft:repeater-widget-label id="goods" widget-id="description"/></th>
> > <th><ft:repeater-widget-label id="goods" widget-id="amount"/></th>
> > <th><ft:repeater-widget-label id="goods" widget-id="unit"/></th>
> > <th><ft:repeater-widget-label id="goods" widget-id="confiscate"/></th>
> > <th><ft:repeater-widget-label id="goods"
> > widget-id="assignAbleToPerson"/></th>
> > <th><ft:repeater-widget-label id="goods" widget-id="select"/></th>
> > </tr>
> > <ft:repeater-widget id="goods">
> > <tr>
> > <td><ft:widget id="goodsMaterialId"/></td>
> > <td><ft:widget id="description"/></td>
> > <td><ft:widget id="amount"/></td>
> > <td><ft:widget id="unit"/></td>
> > <td><ft:widget id="confiscate"/></td>
> > <td><ft:widget id="assignAbleToPerson"/></td>
> > <td><ft:widget id="select"/></td>
> > </tr>
> > </ft:repeater-widget>
> > <tr>
> > <td colspan="4" align="right">
> > <ft:widget id="addgood"/>
> > <ft:widget id="removegood"/>
> > </td>
> > </tr>
> > </table>
> > </fi:items>
> > -------------------------------------------------------------------
> > and the JX-Tempalte THAT DOES NOT WORK is this:
> > -------------------------------------------------------------------
> > <table border="1">
> > <tr>
> > <th>goodsMaterialId</th>
> > <th>description</th>
> > <th>amount</th>
> > <th>unit</th>
> > <th>confiscate</th>
> > <th>assignAbleToPerson</th>
> > </tr>
> > <jx:forEach select="#{????????}">
> > <tr>
> > <td>${model.goodsMaterialId}</td>
> > <td>${model.description}</td>
> > <td>${model.amount}</td>
> > <td>${model.unit}</td>
> > <td>${model.confiscate}</td>
> > <td>${model.assignAbleToPerson}</td>
> > </tr>
> > </jx:forEach>
> > -------------------------------------------------------------------
> >
> > i do not know what to put in the <jx:forEach select="#{????????}">
> > to adress the goods elements of the model....
> >
> > Thanks in davance, thanks a lot indeed!
> > phil-
> Instead of FormTemplateTransformer use template.jx macro library for
> CForms.
>
> --
> Leszek Gawron lgawron@mobilebox.pl
> Project Manager MobileBox sp. z o.o.
> +48 (61) 855 06 67 http://www.mobilebox.pl
> mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JX-Template with repeater data... how to?
Posted by Leszek Gawron <lg...@mobilebox.pl>.
Philipp Rech wrote:
> hello Cocooner's!
>
> i have a problem: want to display data from a repetar widget in a
> JX-Template. So data is passed to the template via a Flow:
> ---------------------------------------------------------------
> form2.showForm("goods");
> var model2 = form2.getModel();
> cocoon.sendPageAndWait("confrim_goods", {"model": model2});
> --------------------------------------------------------------
> with works fine with usual c-forms and jx-tempalets
> where i adress them like:
> --------------------------------------------------------------
> <div>>${model.WIDGET_NAME}</div>
> --------------------------------------------------------------
> but how can i do the same with a repeater
> (the c-forms tempalte is this):
> -------------------------------------------------------------
> <ft:widget-label id="goods"/><br/>
> <ft:repeater-size id="goods"/>-
> <table border="1">
> <tr>
> <th><ft:repeater-widget-label id="goods" widget-id="goodsMaterialId"/></th>
> <th><ft:repeater-widget-label id="goods" widget-id="description"/></th>
> <th><ft:repeater-widget-label id="goods" widget-id="amount"/></th>
> <th><ft:repeater-widget-label id="goods" widget-id="unit"/></th>
> <th><ft:repeater-widget-label id="goods" widget-id="confiscate"/></th>
> <th><ft:repeater-widget-label id="goods"
> widget-id="assignAbleToPerson"/></th>
> <th><ft:repeater-widget-label id="goods" widget-id="select"/></th>
> </tr>
> <ft:repeater-widget id="goods">
> <tr>
> <td><ft:widget id="goodsMaterialId"/></td>
> <td><ft:widget id="description"/></td>
> <td><ft:widget id="amount"/></td>
> <td><ft:widget id="unit"/></td>
> <td><ft:widget id="confiscate"/></td>
> <td><ft:widget id="assignAbleToPerson"/></td>
> <td><ft:widget id="select"/></td>
> </tr>
> </ft:repeater-widget>
> <tr>
> <td colspan="4" align="right">
> <ft:widget id="addgood"/>
> <ft:widget id="removegood"/>
> </td>
> </tr>
> </table>
> </fi:items>
> -------------------------------------------------------------------
> and the JX-Tempalte THAT DOES NOT WORK is this:
> -------------------------------------------------------------------
> <table border="1">
> <tr>
> <th>goodsMaterialId</th>
> <th>description</th>
> <th>amount</th>
> <th>unit</th>
> <th>confiscate</th>
> <th>assignAbleToPerson</th>
> </tr>
> <jx:forEach select="#{????????}">
> <tr>
> <td>${model.goodsMaterialId}</td>
> <td>${model.description}</td>
> <td>${model.amount}</td>
> <td>${model.unit}</td>
> <td>${model.confiscate}</td>
> <td>${model.assignAbleToPerson}</td>
> </tr>
> </jx:forEach>
> -------------------------------------------------------------------
>
> i do not know what to put in the <jx:forEach select="#{????????}">
> to adress the goods elements of the model....
>
> Thanks in davance, thanks a lot indeed!
> phil-
Instead of FormTemplateTransformer use template.jx macro library for CForms.
--
Leszek Gawron lgawron@mobilebox.pl
Project Manager MobileBox sp. z o.o.
+48 (61) 855 06 67 http://www.mobilebox.pl
mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65
JX-Template with repeater data... how to?
Posted by Philipp Rech <ph...@gmx.de>.
hello Cocooner's!
i have a problem: want to display data from a repetar widget in a
JX-Template. So data is passed to the template via a Flow:
---------------------------------------------------------------
form2.showForm("goods");
var model2 = form2.getModel();
cocoon.sendPageAndWait("confrim_goods", {"model": model2});
--------------------------------------------------------------
with works fine with usual c-forms and jx-tempalets
where i adress them like:
--------------------------------------------------------------
<div>>${model.WIDGET_NAME}</div>
--------------------------------------------------------------
but how can i do the same with a repeater
(the c-forms tempalte is this):
-------------------------------------------------------------
<ft:widget-label id="goods"/><br/>
<ft:repeater-size id="goods"/>-
<table border="1">
<tr>
<th><ft:repeater-widget-label id="goods" widget-id="goodsMaterialId"/></th>
<th><ft:repeater-widget-label id="goods" widget-id="description"/></th>
<th><ft:repeater-widget-label id="goods" widget-id="amount"/></th>
<th><ft:repeater-widget-label id="goods" widget-id="unit"/></th>
<th><ft:repeater-widget-label id="goods" widget-id="confiscate"/></th>
<th><ft:repeater-widget-label id="goods"
widget-id="assignAbleToPerson"/></th>
<th><ft:repeater-widget-label id="goods" widget-id="select"/></th>
</tr>
<ft:repeater-widget id="goods">
<tr>
<td><ft:widget id="goodsMaterialId"/></td>
<td><ft:widget id="description"/></td>
<td><ft:widget id="amount"/></td>
<td><ft:widget id="unit"/></td>
<td><ft:widget id="confiscate"/></td>
<td><ft:widget id="assignAbleToPerson"/></td>
<td><ft:widget id="select"/></td>
</tr>
</ft:repeater-widget>
<tr>
<td colspan="4" align="right">
<ft:widget id="addgood"/>
<ft:widget id="removegood"/>
</td>
</tr>
</table>
</fi:items>
-------------------------------------------------------------------
and the JX-Tempalte THAT DOES NOT WORK is this:
-------------------------------------------------------------------
<table border="1">
<tr>
<th>goodsMaterialId</th>
<th>description</th>
<th>amount</th>
<th>unit</th>
<th>confiscate</th>
<th>assignAbleToPerson</th>
</tr>
<jx:forEach select="#{????????}">
<tr>
<td>${model.goodsMaterialId}</td>
<td>${model.description}</td>
<td>${model.amount}</td>
<td>${model.unit}</td>
<td>${model.confiscate}</td>
<td>${model.assignAbleToPerson}</td>
</tr>
</jx:forEach>
-------------------------------------------------------------------
i do not know what to put in the <jx:forEach select="#{????????}">
to adress the goods elements of the model....
Thanks in davance, thanks a lot indeed!
phil-
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXtemplate session-context
Posted by Johannes Textor <jc...@gmx.de>.
That's interesting, for it is actually what I do all the time to solve
this kind of problems
(inject simple data into jxt). I wonder how you are using jxt as a
"standalone" and what are
the benefits e.g. over xsp (besides xsp being ugly, that is ...) - I am
just curious, what can
you do with jxt alone ?
Jan Hoskens wrote:
> I know how to use flow/jxtemplate, but I was just wondering if I could
> get there without flow. It's a bit overhead to create an extra pipe to
> call a function and then only pass one extra piece of info retrieved
> from the session context to a display-pipeline. This seems like
> making a simple page more difficult, if you know what I mean ;-)
>
> Thanks for your reply Johannes,
>
> Kind Regards,
> Jan
>
>
> Johannes Textor wrote:
>
>> Hi Jan,
>>
>> afaik there is no way to do this directly in jxt. Anyway I think
>> that's more a design decision than a lacking
>> feature, since you should not use jxt to do complex stuff - it's a
>> mere formatting language. You can,
>> of course, retrieve this information in your flow script and pass it
>> to jxt using normal template parameters.
>> (You can also pass complex objects like the complet authentication
>> context, for example)
>>
>> HTH, Johannes
>>
>> Jan Hoskens wrote:
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXtemplate session-context
Posted by Jan Hoskens <jh...@schaubroeck.be>.
I know how to use flow/jxtemplate, but I was just wondering if I could
get there without flow. It's a bit overhead to create an extra pipe to
call a function and then only pass one extra piece of info retrieved
from the session context to a display-pipeline. This seems like making
a simple page more difficult, if you know what I mean ;-)
Thanks for your reply Johannes,
Kind Regards,
Jan
Johannes Textor wrote:
> Hi Jan,
>
> afaik there is no way to do this directly in jxt. Anyway I think
> that's more a design decision than a lacking
> feature, since you should not use jxt to do complex stuff - it's a
> mere formatting language. You can,
> of course, retrieve this information in your flow script and pass it
> to jxt using normal template parameters.
> (You can also pass complex objects like the complet authentication
> context, for example)
>
> HTH, Johannes
>
> Jan Hoskens wrote:
>
>> Hi,
>>
>> Is there a way to get session-context information in
>> JXTemplateGenerator? I know there's a session, but what if I need to
>> retrieve the ID from the authencation context?
>> (context=authentication and path=authentication/ID)
>>
>> Kind Regards,
>> Jan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXtemplate session-context
Posted by Johannes Textor <jc...@gmx.de>.
Hi Jan,
afaik there is no way to do this directly in jxt. Anyway I think that's
more a design decision than a lacking
feature, since you should not use jxt to do complex stuff - it's a mere
formatting language. You can,
of course, retrieve this information in your flow script and pass it to
jxt using normal template parameters.
(You can also pass complex objects like the complet authentication
context, for example)
HTH, Johannes
Jan Hoskens wrote:
> Hi,
>
> Is there a way to get session-context information in
> JXTemplateGenerator? I know there's a session, but what if I need to
> retrieve the ID from the authencation context? (context=authentication
> and path=authentication/ID)
>
> Kind Regards,
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org