[Logo] RSF Discussions Forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Pager Bean Flow property thing...  XML
Forum Index -> RSF Help and Problems
Author Message
stevegithens
Request-scope Wrangler

Joined: 04/04/2006 20:34:52
Messages: 84
Location: ooeepooee
Offline

I'm trying to set up a bean for a pager that will contain a little piece of info (an ID corresponding to what needs to be paged) and the Action Methods for which button (next/prev) gets triggered.

I'm having a problem, in that the ID doesn't seem to be getting set in the bean that is moving on one step via a FLOW_ONESTEP. In the logs it seems to be getting copied Ok...

Logs:
Code:
 Top level form: uk.org.ponder.rsf.components.UIForm@69bfe89f
 Registering uk.org.ponder.rsf.components.UICommand@6fb0289f with toppager
 Registering uk.org.ponder.rsf.components.UICommand@6fbd289f with toppager
 Registering uk.org.ponder.rsf.components.UICommand@6f89a89f with toppager
 2006-05-31 09:28:18,488 INFO (RootHandlerBean.java:89) - <Request handled>
 2006-05-31 09:28:19,997 INFO (ServletEarlyRequestParser.java:40) - <begin parseRequest>
 2006-05-31 09:28:20,001 INFO (SakaiEarlyRequestParser.java:42) - <Beginning ToolSinkTunnelServlet service with requestURL of
 <a href="http://localhost:8080/portal/tool/92b97927-8e6d-435c-80f8-9162908d5f58/faces/anncview" target="_blank" rel="nofollow">http://localhost:8080/portal/tool/92b97927-8e6d-435c-80f8-9162908d5f58/faces/anncview</a> and extra path of /anncview>
 2006-05-31 09:28:20,030 INFO (RenderUtil.java:97) - <Unpacked command link key Submitting control value toppagerprev>
 2006-05-31 09:28:20,034 INFO (RenderUtil.java:97) - <Unpacked command link key Fast track action value anncviewpager.prevAction>
 2006-05-31 09:28:20,040 INFO (PostDecoder.java:64) - <PostInit: key anncid2-fossil value istring#{anncviewpager.anncid}d250fa5b-b1a6-47b0-8082-cc75d968caf9>
 2006-05-31 09:28:20,045 INFO (PostDecoder.java:99) - <Discovered fossilised binding for anncviewpager.anncid for component anncid2 with old value d250fa5b-b1a6-47b0-8082-cc75d968caf9>
 2006-05-31 09:28:20,262 INFO (PostDecoder.java:64) - <PostInit: key direction value prev>
 2006-05-31 09:28:20,266 INFO (PostDecoder.java:64) - <PostInit: key anncid value d250fa5b-b1a6-47b0-8082-cc75d968caf9>
 2006-05-31 09:28:20,269 INFO (PostDecoder.java:64) - <PostInit: key anncid2 value d250fa5b-b1a6-47b0-8082-cc75d968caf9>
 2006-05-31 09:28:20,272 INFO (PostDecoder.java:64) - <PostInit: key Fast track action value anncviewpager.prevAction>
 2006-05-31 09:28:20,275 INFO (PostDecoder.java:64) - <PostInit: key Submitting control value toppagerprev>
 2006-05-31 09:28:20,278 INFO (PostDecoder.java:64) - <PostInit: key panel value Main>
 SWG ViewPagerBean.prevAction: defaultdir  defaultanncid
 2006-05-31 09:28:20,365 INFO (BeanCopyPreservationStrategy.java:72) - <BeanCopy preserved to path anncviewpager: org.sakaiproject.rsfgallery.annc.ViewPagerBean@3ba4288c>
 2006-05-31 09:28:20,368 INFO (BeanCopyPreservationStrategy.java:77) - <BeanCopy saved 1 beans to token endFlowPreserver6_yYuGSWSj(hEfKSAWvsh8rv>
 2006-05-31 09:28:20,413 INFO (SakaiRequestParser.java:105) - <Got tool dispatcher id of sakai.rsf.gallery resourceBaseURL <a href="http://localhost:8080/ChemTopics/" target="_blank" rel="nofollow">http://localhost:8080/ChemTopics/</a> baseURL <a href="http://localhost:8080/portal/tool/92b97927-8e6d-435c-80f8-9162908d5f58/faces/" target="_blank" rel="nofollow">http://localhost:8080/portal/tool/92b97927-8e6d-435c-80f8-9162908d5f58/faces/</a> and Sakai PID 92b97927-8e6d-435c-80f8-9162908d5f58>
 2006-05-31 09:28:20,419 INFO (RootHandlerBean.java:137) - <Redirecting to <a href="http://localhost:8080/portal/tool/92b97927-8e6d-435c-80f8-9162908d5f58/faces/anncview?flowtoken=6_yYuGSWSj(hEfKSAWvsh8rv&endflow=1&anncid=id&direction=prev&panel=Main>" target="_blank" rel="nofollow">http://localhost:8080/portal/tool/92b97927-8e6d-435c-80f8-9162908d5f58/faces/anncview?flowtoken=6_yYuGSWSj(hEfKSAWvsh8rv&endflow=1&anncid=id&direction=prev&panel=Main></a>
 2006-05-31 09:28:20,422 INFO (RootHandlerBean.java:89) - <Request handled>
 


My Pager bean:
Code:
 
 public class ViewPagerBean {
 	private String anncid = "defaultanncid";
 	private String direction = "defaultdir";
 	
 	public void setAnncid(String anncid)
 	{
 		this.anncid = anncid;
 		System.out.println("SWG ViewPagerBean.setAnncid: " + this.anncid);
 	}
 	
 	public String getAnncid()
 	{
 		return this.anncid;
 	}
 	
 	public void setDirection(String dir)
 	{
 		this.direction = dir;
 		System.out.println("SWG ViewPagerBean.setDirection: " + this.direction);
 	}
 	
 	public String getDirection()
 	{
 		return this.direction;
 	}
 	
 	public String prevAction()
 	{
 		System.out.println("SWG ViewPagerBean.prevAction: " + this.direction + "  " + this.anncid);
 		direction = "prev";
 		return "prevAction";
 	}
 	
 	public String nextAction()
 	{
 		System.out.println("SWG ViewPagerBean.nextAction: " + this.direction + "  " + this.anncid);
 		direction = "next";
 		return "nextAction";
 	}
 	
 	public String returnToListAction()
 	{
 		System.out.println("SWG ViewPagerBean.returnToListAction");
 		direction = "return";
 		return "returnToListAction"; 
 	}
 }
 


My Provider:
Code:
 *snip*
 
 //toppagerprev
 		UIForm toppager = UIForm.make(arg0, "toppager");
 		UIInput idholder = UIInput.make(toppager, "anncid2", "#{anncviewpager.anncid}");
 		idholder.updateValue(this.anncid);
 		UICommand.make(toppager, "toppagerprev", "#{anncviewpager.prevAction}");
 		UICommand.make(toppager, "toppagernext", "#{anncviewpager.nextAction}");
 		UICommand.make(toppager, "toppagerreturn", "#{anncviewpager.returnToListAction}");
 		
 
 	}
 
 	public ViewParameters getViewParameters() {
 		AnncViewParams avp = new AnncViewParams();
 		avp.anncid = "id";
 		avp.direction = "prev";
 		return avp;
 	}
 
 	public List reportNavigationCases() {
 		List i = new ArrayList();
 		
 		i.add(new NavigationCase("prevAction", new AnncViewParams("anncview", "id", "prev"),
 				ARIResult.FLOW_ONESTEP));
 		i.add(new NavigationCase("nextAction", new AnncViewParams("anncview", "id", "next"),
 				ARIResult.FLOW_ONESTEP));
 		i.add(new NavigationCase("returnToListAction", new SimpleViewParameters("anncstart")));
 		return i;
 	}
 


And my template:
Code:
 <form rsf:id="toppager" method="post">
 	<input rsf:id="anncid2" type="text" style="display: none"/>
 	<p class="itemNav">
 		<input rsf:id="toppagerprev" value="<  Previous" type="submit" />
 		<input rsf:id="toppagerreturn" value="Return to List" type="submit" />
 		<input rsf:id="toppagernext" value="Next >" type="submit" />
 	</p>
 </form>
 


The hidden input that I'm using to keep track of the Announcement ID, just doesn't seem to be getting set on the Bean I have it hooked up to with the EL Expression.

Ideas??
[WWW]
antranig
Request-scope Wrangler

Joined: 03/04/2006 13:29:55
Messages: 643
Offline

The docs do warn that two ONESTEP flows cannot be run back-to-back. I recommend making this a GET form (now very straightforward in 0.6.3) - or using a full flow.

By the looks of it you have exposed a bug, though, since this isn't the right "failure" behaviour I'd be expecting I'll look into it later today.
antranig
Request-scope Wrangler

Joined: 03/04/2006 13:29:55
Messages: 643
Offline

OK, after thinking about this a bit more, this probably *is* the behaviour I'd be expecting
I thought this "ought" to work for at least one POST cycle, but in fact on the very first cycle there is no value in anncid at all. And on second and subsequent cycles the flow token changes, as per the impl of ONE_STEP so the bean contents are simply not found.

In general hidden field hacks like this are against the general idiom of RSF in terms of ways of keeping track of state - you should really be using the standard flow preservation mechanism since these are more configurable by the "end user" (they might actually configure it to use hidden fields if they want to, but you shouldn't make the choice for them).
 
Forum Index -> RSF Help and Problems
Message Quick Reply
Go to:   
Powered by JForum 2.1.6 © JForum Team