Reply To: What is the correct way to use pattern values?

Splash Forums PrettyFaces Users What is the correct way to use pattern values? Reply To: What is the correct way to use pattern values?

#27217

Peter-TI
Participant

I think I finally found where I was looking for(in the manual 🙂 ):


<action>bean.loadItem</action>

and parent ID

So I could I use it like this, defining store:


<url-mapping id="viewItem">
  <pattern value="/store/item/#{ iid : bean.itemId }/" />
  <view-id value="/#pageBean.getPage" />
  <action>#{bean.loadItem}</action>
  <query-param name="language"> #{bean.language} </query-param>

</url-mapping>

With the property:


	bean.itemId 

with the beans:

#pageBean.getPage
bean.loadItem
Setting bean.itemId
bean.language

Or can I use pretty faces like this, the parent child way.?Hopefully a solustion for what I intended:
This examle is with the shoestore module:


<url-mapping id="module"> 
   <pattern value="/bean.module" /> 
   	<~-- Result: /shoestore -->
   <view-id value="/#{pageBean.getPage}" />
   <action>#{bean.loadModule}</action>
</url-mapping>

<url-mapping parentId="module" id="phase1"> 
   <pattern value="/#{phase1}" /> 
   	<~-- Result: /shoestore/#{phase1} -->
   <view-id value="#{pageBean.getPage}" /> 
    <action>#{bean.loadPhase1}</action>
</url-mapping>

/shoestore/nike/

<url-mapping parentId="module" id="phase2"> 
   <pattern value="/#{phase2}" /> 
   	<~-- Result: /shoestore/#{phase1}/#{phase2} -->
   <view-id value="#{pageBean.getPage}" /> 
    <action>#{bean.loadPhase2}</action>
</url-mapping>

/shoestore/nike/white

With property:
bean.module
phase*

with the beans:
pageBean.getPage
bean.Module

module name is set as bean.module propertie after some checks
bean.loadPhase*
phase is set after some checks

Is this possible with <action>?
So is the pattern value set with the action properly? Do I not have to put the <action> above the pattern value?
Could I also add query parameters in this parent, child way?
Is it possible to add the module variable in a commandlink or commandButton, and not to use url-mapping id? This with above parent child example?
For example:


<h:commandLink action="pretty:shoestore"> Shoe Store </h:commandLink>