You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2005/06/18 13:20:03 UTC

DirectLink question and page cache

Hi there! As my development experience with Tapestry goes on, I found
3 unusual behaviours...

1st. I have a DirectLink : 
    <component id="link" type="DirectLink">
        <binding name="listener" expression="listeners.selectBlock"/>
        <binding name="parameters" expression="components.foreach.value.title"/>
        <binding name="disabled" expression="currentBlock.title ==
selectedBlock.title"/>
        <binding name="stateful" expression="false"/>
    </component>

The parameter was first : components.foreach.value (so it references
an entire Object graph not only a string) Well, as the user clicks on
the links, the first time it happens ok (with a humongous url link)
but then no link works anymore, I get a "page contains no data" from
the browser. (???) I was wondering if it was the length of the url.

2nd. The listener method listed below:

public void removeGroup(IRequestCycle cycle){
		Long id = (Long) cycle.getServiceParameters()[0];
		Group group = new Group();
		group.setId(id);
		group = getGroupService().getGroup(group);
		getGroupService().removeGroup(group);
		Visit visit = (Visit)getVisit();
		visit.setUser(getUserService().getUser(visit.getUser()));
		cycle.activate("CreateGroup");
	}
It does update the visit's user object. But when I click on the main
page link (where user info is displayed) the page contains "stale"
data. If a second click happens, the info is updated. That page
implements PageRenderListener, so I debug the contents of the visit
object during the first click and it was ok, but the rendering not...
This I have no clue!

3rd. A bit of confusion on pageRendering. One of my components, which
has this method:

public void setBlockNames(List blocks){
		blockNames = blocks;
		if (getSelectedBlock() == null) {
			Object defaultComponent = getDefaultBlock();
            setSelectedBlock(defaultComponent);
            setCurrentBlock(defaultComponent);
        }
	}

Yes I got it from tabPanel example (I'm extending it actually). gets
this method invoked twice during page rendering. The first time blocks
contains the value passed as parameters, the second time is null, why
is that?

Thanks a lot guys

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


Re: DirectLink question and page cache

Posted by Norbert Sándor <de...@freemail.hu>.
Yes, there is a limit on the length of URLs.
When your data is large, you should use POST instead of GET.
(For the length limit see http://www.boutell.com/newfaq/misc/urllength.html 
or use Google).

Br,
Norbi

----- Original Message ----- 
From: "Vinicius Carvalho" <ja...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Saturday, June 18, 2005 1:20 PM
Subject: DirectLink question and page cache


Hi there! As my development experience with Tapestry goes on, I found
3 unusual behaviours...

1st. I have a DirectLink :
    <component id="link" type="DirectLink">
        <binding name="listener" expression="listeners.selectBlock"/>
        <binding name="parameters" 
expression="components.foreach.value.title"/>
        <binding name="disabled" expression="currentBlock.title ==
selectedBlock.title"/>
        <binding name="stateful" expression="false"/>
    </component>

The parameter was first : components.foreach.value (so it references
an entire Object graph not only a string) Well, as the user clicks on
the links, the first time it happens ok (with a humongous url link)
but then no link works anymore, I get a "page contains no data" from
the browser. (???) I was wondering if it was the length of the url.

2nd. The listener method listed below:

public void removeGroup(IRequestCycle cycle){
Long id = (Long) cycle.getServiceParameters()[0];
Group group = new Group();
group.setId(id);
group = getGroupService().getGroup(group);
getGroupService().removeGroup(group);
Visit visit = (Visit)getVisit();
visit.setUser(getUserService().getUser(visit.getUser()));
cycle.activate("CreateGroup");
}
It does update the visit's user object. But when I click on the main
page link (where user info is displayed) the page contains "stale"
data. If a second click happens, the info is updated. That page
implements PageRenderListener, so I debug the contents of the visit
object during the first click and it was ok, but the rendering not...
This I have no clue!

3rd. A bit of confusion on pageRendering. One of my components, which
has this method:

public void setBlockNames(List blocks){
blockNames = blocks;
if (getSelectedBlock() == null) {
Object defaultComponent = getDefaultBlock();
            setSelectedBlock(defaultComponent);
            setCurrentBlock(defaultComponent);
        }
}

Yes I got it from tabPanel example (I'm extending it actually). gets
this method invoked twice during page rendering. The first time blocks
contains the value passed as parameters, the second time is null, why
is that?

Thanks a lot guys

---------------------------------------------------------------------
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