You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Anastasios Angelidis <vo...@videotron.ca> on 2005/03/11 07:55:28 UTC

beginPageRender not called!? :|

This is my implentation...

Am using JBoss and JBoss IDE, I put a break point in the 
beginPageRender(), even the System.out.println is not showing in the 
concole output...

Am running JBoss4-.0.0 with Tapestry 3.0.2 and friend URL fix. Thepage 
itself renders and the other listeners methods work... Am sure my break 
points work also cause I have used enough to test things out ion eclipse! :P

So what's the deal?

Thanks

public abstract class Home extends BasePage
{
    public abstract void setArtist(Artist artist);
    public abstract Artist getArtist();
   
    public List getArtistList()
    {       
        ...
    }   

    public void editArtist(IRequestCycle cycle)
    {
        ...
    }   
   
    public void newArtist(IRequestCycle cycle)
    {
        ...
    }
   
    /* (non-Javadoc)
     * @see org.apache.tapestry.IPage#beginPageRender()
     */
    public void beginPageRender()
    {
        // TODO Auto-generated method stub
        super.beginPageRender();
       
        System.out.println("Hello");
    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Setting up custom selection model...

Posted by Anastasios Angelidis <vo...@videotron.ca>.
Bassically when my form gets rendered I would like to load my music 
genre list in a drop down and if my artist has already selected his 
music genre, I want the list to display his selected music genre.
I have provided below exactly what am doing. this all works. Except when 
I go back to redit the artist info, thelist is all the way at the top, 
instead of the artist selected genre...

Thanks

My edit.html:
<span jwcid="selectItem"/>

My edit.page
<property-specification name="artist" type="com.mamoth.Artist" 
persistent="yes"/>
<property-specification name="genre" type="com.mamoth.Genre" 
persistent="yes"/>
<property-specification name="genreSelectionModel" 
type="com.mamoth.GenreSelectionModel" persistent="yes"/>

<component id="selectItem" type="PropertySelection">
    <binding name="model" expression="genreSelectionModel"/>
    <binding name="value" expression="genre"/>
</component>           

edit.java:
public void pageBeginRender(PageEvent event)
{    
    System.out.println(getGenre().getGenre());

    if(getGenreSelectionModel() == null)
    {
        Global global = (Global)getGlobal();
        GenreDAO genreDAO = global.getGenreDAO();
   
        setGenreSelectionModel(new 
GenreSelectionModel(genreDAO.getGenreList()));
    }
}

Listener in home.java:
public void editArtist(IRequestCycle cycle)
{
    Edit nextPage = (Edit) cycle.getPage("Artist/Edit");
       
    Global global = (Global)getGlobal();
    ArtistDAO artistDAO = global.getArtistDAO();

    Atist artist = 
artistDAO.getArtistByPrincipal(cycle.getRequestContext().getRequest().getRemoteUser());
       
    nextPage.setArtist(artist);
    nextPage.setGenre(artist.getGenre());
       
    System.out.println(nextPage.getGenre().getGenre());
       
    cycle.activate(nextPage);
}



ron wrote:

> The Model gives the Possible entries.
> The "value" parameter should evaluate to an Object.
> Lets say, you have a property on your page, called 'selected'.
> you use <select jwcid="@PropertySelection" model="..." 
> value="ognl:selected"/>
>
> The 'selected' property of your page will be read and changed 
> automatically by Taps.
> Cheers,
> Ron
>
>
>
> Anastasios Angelidis:
>
>> There is no setter methods?
>>
>> Or can I just implement my own setter method?
>>
>>
>> Hanson Char wrote:
>>
>>>> But how do I set up a selected option?
>>>>   
>>>
>>>
>>>
>>> How about setting the "value" of your PropertySelection to the object
>>> that corresponds to the selected option.
>>>
>>> H
>>>
>>>
>>> On Sun, 13 Mar 2005 00:49:19 -0500, Anastasios Angelidis
>>> <vo...@videotron.ca> wrote:
>>>  
>>>
>>>> Never mind I understand how it works now...
>>>>
>>>> But how do I set up a selected option?
>>>>
>>>> Thanks
>>>>
>>>>
>>>> Anastasios Angelidis wrote:
>>>>
>>>>  
>>>>
>>>>> I managed to implement the IPropertySelectionModel and it's populated
>>>>> from the database...
>>>>>
>>>>> But how can I set the value to my own Id so I can match a label with
>>>>> an Id from the db?
>>>>>
>>>>> Thanks
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: 
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>     
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>   
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>  
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Setting up custom selection model...

Posted by ron <ro...@gmx.net>.
The Model gives the Possible entries.
The "value" parameter should evaluate to an Object.
Lets say, you have a property on your page, called 'selected'.
you use <select jwcid="@PropertySelection" model="..." 
value="ognl:selected"/>

The 'selected' property of your page will be read and changed 
automatically by Taps.
Cheers,
Ron



 Anastasios Angelidis:

> There is no setter methods?
>
> Or can I just implement my own setter method?
>
>
> Hanson Char wrote:
>
>>> But how do I set up a selected option?
>>>   
>>
>>
>> How about setting the "value" of your PropertySelection to the object
>> that corresponds to the selected option.
>>
>> H
>>
>>
>> On Sun, 13 Mar 2005 00:49:19 -0500, Anastasios Angelidis
>> <vo...@videotron.ca> wrote:
>>  
>>
>>> Never mind I understand how it works now...
>>>
>>> But how do I set up a selected option?
>>>
>>> Thanks
>>>
>>>
>>> Anastasios Angelidis wrote:
>>>
>>>   
>>>
>>>> I managed to implement the IPropertySelectionModel and it's populated
>>>> from the database...
>>>>
>>>> But how can I set the value to my own Id so I can match a label with
>>>> an Id from the db?
>>>>
>>>> Thanks
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>     
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>   
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>  
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Setting up custom selection model...

Posted by Anastasios Angelidis <vo...@videotron.ca>.
There is no setter methods?

Or can I just implement my own setter method?


Hanson Char wrote:

>>But how do I set up a selected option?
>>    
>>
>
>How about setting the "value" of your PropertySelection to the object
>that corresponds to the selected option.
>
>H
>
>
>On Sun, 13 Mar 2005 00:49:19 -0500, Anastasios Angelidis
><vo...@videotron.ca> wrote:
>  
>
>>Never mind I understand how it works now...
>>
>>But how do I set up a selected option?
>>
>>Thanks
>>
>>
>>Anastasios Angelidis wrote:
>>
>>    
>>
>>>I managed to implement the IPropertySelectionModel and it's populated
>>>from the database...
>>>
>>>But how can I set the value to my own Id so I can match a label with
>>>an Id from the db?
>>>
>>>Thanks
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Setting up custom selection model...

Posted by Hanson Char <ha...@gmail.com>.
> But how do I set up a selected option?

How about setting the "value" of your PropertySelection to the object
that corresponds to the selected option.

H


On Sun, 13 Mar 2005 00:49:19 -0500, Anastasios Angelidis
<vo...@videotron.ca> wrote:
> Never mind I understand how it works now...
> 
> But how do I set up a selected option?
> 
> Thanks
> 
> 
> Anastasios Angelidis wrote:
> 
> > I managed to implement the IPropertySelectionModel and it's populated
> > from the database...
> >
> > But how can I set the value to my own Id so I can match a label with
> > an Id from the db?
> >
> > Thanks
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Setting up custom selection model...

Posted by Anastasios Angelidis <vo...@videotron.ca>.
Never mind I understand how it works now...

But how do I set up a selected option?

Thanks


Anastasios Angelidis wrote:

> I managed to implement the IPropertySelectionModel and it's populated 
> from the database...
>
> But how can I set the value to my own Id so I can match a label with 
> an Id from the db?
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Setting up custom selection model...

Posted by Anastasios Angelidis <vo...@videotron.ca>.
I managed to implement the IPropertySelectionModel and it's populated 
from the database...

But how can I set the value to my own Id so I can match a label with an 
Id from the db?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: beginPageRender not called!? :|

Posted by Joerg Latteier <la...@online.de>.
For pre-page-render initialisations, I use the PageRenderListener interface 
and the beginRender event, that works fine. Try


public abstract class Home extends BasePage implements PageRenderListener {
...

  //
  public void pageBeginRender(PageEvent event) {
	System.out.println("Hello");    
  }

  //
  public void pageEndRender(PageEvent event) {
  }

}

Joerg
   

>> -----Original Message-----
>> From: Anastasios Angelidis [mailto:voodoo@videotron.ca] 
>> Sent: Friday, March 11, 2005 7:55 AM
>> To: Tapestry users
>> Subject: beginPageRender not called!? :|
>> 
>> This is my implentation...
>> 
>> Am using JBoss and JBoss IDE, I put a break point in the 
>> beginPageRender(), even the System.out.println is not showing in the 
>> concole output...
>> 
>> Am running JBoss4-.0.0 with Tapestry 3.0.2 and friend URL 
>> fix. Thepage 
>> itself renders and the other listeners methods work... Am 
>> sure my break 
>> points work also cause I have used enough to test things out 
>> ion eclipse! :P
>> 
>> So what's the deal?
>> 
>> Thanks
>> 
>> public abstract class Home extends BasePage
>> {
>>     public abstract void setArtist(Artist artist);
>>     public abstract Artist getArtist();
>>    
>>     public List getArtistList()
>>     {       
>>         ...
>>     }   
>> 
>>     public void editArtist(IRequestCycle cycle)
>>     {
>>         ...
>>     }   
>>    
>>     public void newArtist(IRequestCycle cycle)
>>     {
>>         ...
>>     }
>>    
>>     /* (non-Javadoc)
>>      * @see org.apache.tapestry.IPage#beginPageRender()
>>      */
>>     public void beginPageRender()
>>     {
>>         // TODO Auto-generated method stub
>>         super.beginPageRender();
>>        
>>         System.out.println("Hello");
>>     }
>> }
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: beginPageRender not called!? :|

Posted by Hanson Char <ha...@gmail.com>.
Home needs to implement PageRenderListener for the pageBeningRender
method to be invoked.

H


On Fri, 11 Mar 2005 01:55:28 -0500, Anastasios Angelidis
<vo...@videotron.ca> wrote:
> This is my implentation...
> 
> Am using JBoss and JBoss IDE, I put a break point in the
> beginPageRender(), even the System.out.println is not showing in the
> concole output...
> 
> Am running JBoss4-.0.0 with Tapestry 3.0.2 and friend URL fix. Thepage
> itself renders and the other listeners methods work... Am sure my break
> points work also cause I have used enough to test things out ion eclipse! :P
> 
> So what's the deal?
> 
> Thanks
> 
> public abstract class Home extends BasePage
> {
>     public abstract void setArtist(Artist artist);
>     public abstract Artist getArtist();
> 
>     public List getArtistList()
>     {
>         ...
>     }
> 
>     public void editArtist(IRequestCycle cycle)
>     {
>         ...
>     }
> 
>     public void newArtist(IRequestCycle cycle)
>     {
>         ...
>     }
> 
>     /* (non-Javadoc)
>      * @see org.apache.tapestry.IPage#beginPageRender()
>      */
>     public void beginPageRender()
>     {
>         // TODO Auto-generated method stub
>         super.beginPageRender();
> 
>         System.out.println("Hello");
>     }
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org