JHS 10.1.3 "DeepLink" Create method
537426Oct 22 2006 — edited Oct 23 2006Hi,
I want to use a "DeepLink" Create method when I'm on a form page for "Addresses", which page contains a child table-form group of the persons who use the particular address I'm editing. Here I would like to have a link to go to the "Employees" VO page, which is a form or table-form page that I also use for editing or searching employees, and have this page in the "create" mode. Note that there is already a "new" button on the addresses page, but the view object I use to list the employees here is reduced compared to the "full size" main view object for employees.
So this is a kind of deeplinking, but the action is neither query nor set current row, but create. As I said, this was possible with Jhs 10.1.2 by changing the event and eventValue hidden form parameters with some client-side Javascript.
I found there is a way to manually add this action, somehow based on the same model that Steven gave me for the rowKeyStr-based deeplinking.
Here are the custom lines I used :
In the EmployeePageDef I added :
<invokeAction id="setCreateEmployeeDeepLinkInvoke"
Binds="CreateEmployee"
Refresh="prepareModel"
RefreshCondition="#{jsfNavigationOutcome=='DeepLinkCreateEmployee'}"/>
And I used a custom template for the new button in the address page, based on newButtonNotInFormLayout.vm :
#if ($JHS.current.pageComponent.hasDetailsPage && $JHS.current.group.formInsertAllowed)
<af:commandButton action="${JHS.facesConfigGenerator.addNavigationCase(${JHS.page.name}, "DeepLinkCreate${JHS.current.group.property1}", ${JHS.current.group.property1})}"
textAndAccessKey="${JHS.nls(${JHS.current.group.displayTitleSingular}, "NEW_BUTTON_LABEL_${JHS.current.group.property1}", "NEW_BUTTON_LABEL" )}"
immediate="true"
#JHS_PROP("rendered" ${JHS.current.group.insertAllowedExpression})
onclick="return alertForChanges();"
id="${JHS.current.group.name}NewButton">
<f:actionListener type="oracle.jheadstart.controller.jsf.listener.DoRollbackActionListener"/>
<af:resetActionListener/>
</af:commandButton>
#end
where property1 of the Address group is set to Emplyee.
Everything works fine, except that when clicking the customized new button and arriving at the Employee page, the createModes.CreateEmployee value is not set to true, so the layout of the page is not set to create mode.
Therefore I changed the common.vm template to :
#macro (GROUP_IN_CREATE_MODE)
(createModes.Create${JHS.current.group.shortName} or jsfNavigationOutcome=='DeepLinkCreate${JHS.current.group.name}')#end
#macro (SPECIFIED_GROUP_IN_CREATE_MODE $group)
(createModes.Create${group.shortName} or jsfNavigationOutcome=='DeepLinkCreate${group.name}')#end
#macro (GROUP_NOT_IN_CREATE_MODE)
!(createModes.Create${JHS.current.group.shortName} or jsfNavigationOutcome=='DeepLinkCreate${JHS.current.group.name}')#end
My question is : why is the createModes.CreateEmployee value not set to true when invoking DeepLinkCreateEmployee ? Is there a way to manually set this value to true so that the page layout is rendered in create mode without changing the common.vm template ?
Best regards,
David