Almost there.. I'm having a hard time with this environmental coding. If
I can get it down for this one page then it should be simple enough for
the rest.
As of now, I'm getting a strange error in the sense that it describes
something I did not explicitly code:
Render queue error in BeginRender[pss/ConversionTab:delegate]: The
return value from a render phase event method was not compatible the
expected return type of java.lang.Boolean. You should change the method
to return the correct type.
It says I have a render phase event returning something other than a
Boolean, yet I don't have any render phases return anything other than
void as far as I can tell. I'm trying to push a user Id through to the
DetailsTab through the environment so it can load details from the DAO.
Here is some of the code, edited to mostly just contain the code
directly related to page loading/rendering.
Code from the Container:
/**
* SUB TAB LOGIC
*/
@Inject
private Environment env;
@Inject
private ComponentSource cs;
static final String DETAILS_TAB = "DetailsTab";
static final String PREFIX = "pss/view/conversion/";
@Persist
private String subPage;
@Persist
private PageId id;
public Object getSelectedSubTab(){
debug("In getSelectedSubTab with subPageId: " + subPage);
if(DETAILS_TAB.equals(subPage)){
if(id == null || "".equals(id.getId()))
return null;
return PREFIX+subPage;
}
return null;
}
public Object onActionFromDetailsLink(String cid){
this.subPage = DETAILS_TAB;
id = new PageId(cid);
debug("DetailsLink clicked. SubPageId set to " + subPage);
return "pss/ModuleIndex";
}
@BeginRender
public void pushPageId(){
debug("Loaded ConversionTab and SubPageId = " + id);
env.push(PageId.class, id);
}
@AfterRender
public void popPageId(){
id = env.pop(PageId.class);
}
Code from the DetailsTab:
@Environmental
private PageId convId;
@Property @Persist("flash")
private ThirdParty conv;
@Persist("flash")
private String curName;
@Persist("flash")
private String pointName;
@Persist
private Boolean haveUpdated;
@Property @Persist("flash")
private String confirmMsg;
@Inject
private TPDAO tpdao;
@Component(id = "convert")
private BeanEditForm _form;
@Inject
private Messages messages;
public void onPrepareForRender(){
conv = (ThirdParty) tpdao.read(convId.getId());
if(haveUpdated==null || haveUpdated==true){
pointName = conv.getPointCur();
curName = conv.getConversionName();
}
haveUpdated=false;
debug("In onPrepare of DetailsTab in conversion package. Loaded
Conversion ::"+conv+":: from DB");
}
On 08/19/2010 07:29 PM, Thiago H. de Paula Figueiredo wrote:
On Thu, 19 Aug 2010 19:13:43 -0300, Rich M <rich...@moremagic.com> wrote:
Ah, great! That helped move things forward. Transformation is
starting to take place, I was able to get one of the SubPages to Live
Reload, but the display is wrong, part a) isn't quite complete. What
is the best way to feed the current SubPage into the containing
ModuleIndex's page/template?
Feed as in passing data? This can be done by putting data into the
Environmental in the ModuleIndex and them getting them using the same
service in the SubPages. That's how the Grid and
BeanEditForm/BeanEditor components work.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org