grid if eventlink

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

grid if eventlink

Andreas Ernst
Hi,

i got a grid from a database. Now i want that the eventlink is only
shown if the status is 100. i.e.

<p:gebuchtCell>
   <t:if test="gebucht" t:context="bestellung.bestnr">
     <a t:type="eventLink" t:event="buchen"
t:context="tachyonbestellung.bestnr">buchen</a>
   </t:if>
</p:gebuchtCell>

At the moment i do not see an easy way to do that.

Any hints?

Andreas
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
[hidden email] | www.ae-online.de
www.tachyon-online.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: grid if eventlink

nquirynen
Hi,

the If component doesn't have a parameter "context". What you need to do
is the following:

1) set parameter "row" in your grid component (which you probably
already did with property "bestellung"):

    <t:grid t:row="bestellung" ... />

    @Property
    private Bestellung bestellung;

2) create a property in your page class:

    public boolean isGebucht() {
        return bestellung.getBestNr().equals(100);
    }

3) Use the if component like this:

    <p:gebuchtCell>
        <t:if t:test="gebucht">
            <a t:type="eventLink" t:event="buchen"
t:context="tachyonbestellung.bestnr">buchen</a>
        </t:if>
    </p:gebuchtCell>


I hope this is what you were asking for.

Nathan

On 27/10/13 15:00, Andreas Ernst wrote:

> Hi,
>
> i got a grid from a database. Now i want that the eventlink is only
> shown if the status is 100. i.e.
>
> <p:gebuchtCell>
>   <t:if test="gebucht" t:context="bestellung.bestnr">
>     <a t:type="eventLink" t:event="buchen"
> t:context="tachyonbestellung.bestnr">buchen</a>
>   </t:if>
> </p:gebuchtCell>
>
> At the moment i do not see an easy way to do that.
>
> Any hints?
>
> Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: grid if eventlink

Andreas Ernst
Hi Nathan,

Am 28.10.13 11:07, schrieb Nathan Quirynen:

> Hi,
>
> the If component doesn't have a parameter "context". What you need to do
> is the following:
>
> 1) set parameter "row" in your grid component (which you probably
> already did with property "bestellung"):
>
>      <t:grid t:row="bestellung" ... />
>
>      @Property
>      private Bestellung bestellung;

This did not work: Unable to create new accessor method public
java.lang.Boolean getGebucht() on class
de.aeits.extranet.pages.Bestellungen as the method is already implemented.

So, just do it by hand:

   public Boolean getGebucht() {
     return tachyonbestellung.getStatus().equals(100);
   }
   public void setGebucht (Boolean bool) {
   }

>
> 2) create a property in your page class:
>
>      public boolean isGebucht() {
>          return bestellung.getBestNr().equals(100);
>      }
>
> 3) Use the if component like this:
>
>      <p:gebuchtCell>
>          <t:if t:test="gebucht">
>              <a t:type="eventLink" t:event="buchen"
> t:context="tachyonbestellung.bestnr">buchen</a>
>          </t:if>
>      </p:gebuchtCell>
>
>
> I hope this is what you were asking for.

Yes, i did.

Thanks.
Andreas
--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
[hidden email] | www.ae-online.de
www.tachyon-online.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: grid if eventlink

Jens Breitenstein
Hi Andreas!

If you make use of @Property annotation tapestry creates get and set methods for you. if you mix it with self-written methods you have to set "read" and "write" annotation params to "false" accordingly to avoid creation. Just have a look at the @Property documentation.

Jens

Von meinem iPhone gesendet

> Am 28.10.2013 um 12:27 schrieb Andreas Ernst <[hidden email]>:
>
> Hi Nathan,
>
> Am 28.10.13 11:07, schrieb Nathan Quirynen:
>> Hi,
>>
>> the If component doesn't have a parameter "context". What you need to do
>> is the following:
>>
>> 1) set parameter "row" in your grid component (which you probably
>> already did with property "bestellung"):
>>
>>     <t:grid t:row="bestellung" ... />
>>
>>     @Property
>>     private Bestellung bestellung;
>
> This did not work: Unable to create new accessor method public java.lang.Boolean getGebucht() on class de.aeits.extranet.pages.Bestellungen as the method is already implemented.
>
> So, just do it by hand:
>
>  public Boolean getGebucht() {
>    return tachyonbestellung.getStatus().equals(100);
>  }
>  public void setGebucht (Boolean bool) {
>  }
>
>>
>> 2) create a property in your page class:
>>
>>     public boolean isGebucht() {
>>         return bestellung.getBestNr().equals(100);
>>     }
>>
>> 3) Use the if component like this:
>>
>>     <p:gebuchtCell>
>>         <t:if t:test="gebucht">
>>             <a t:type="eventLink" t:event="buchen"
>> t:context="tachyonbestellung.bestnr">buchen</a>
>>         </t:if>
>>     </p:gebuchtCell>
>>
>>
>> I hope this is what you were asking for.
>
> Yes, i did.
>
> Thanks.
> Andreas
> --
> ae | Andreas Ernst | IT Spektrum
> Postfach 5, 65612 Beselich
> Schupbacher Str. 32, 65614 Beselich, Germany
> Tel: +49-6484-91002 Fax: +49-6484-91003
> [hidden email] | www.ae-online.de
> www.tachyon-online.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]