1

I'm using p:steps as a workflow, it works well except active index doesn't have an URL attach

xhtml:

<p:fieldset legend="Etape" toggleable="true" toggleSpeed="500" style="height:110px;">
    <p:steps model="#{etapeModel.model}" activeIndex="#{besoin.etape.code}" 
    styleClass="custom" readonly="false" />
</p:fieldset>

java code:

public EtapeModel(){
    model = new DefaultMenuModel();
    Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
    selected = BesoinService.get(Integer.parseInt(params.get("id")));

    for(Etape e : Etape.values()){
        DefaultMenuItem item = new DefaultMenuItem(e.getLibelle());
        item.setUrl("besoinForm.xhtml?faces-redirect=true&i=1&id="+selected.getId()+"&etape="+e.getCode());
        item.setId("etape"+e.getCode());
        model.addElement(item);
    }
}

I understand this behaviour, but what possibilities I have to attach an url on active index ?

Mojarra 2.2.0 and Primefaces 5.3

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Shadowritter
  • 137
  • 1
  • 1
  • 8
  • Need bookmarkable URLs while using other components as well like ``, ``, `` etc. Consult the PrimeFaces team to include such features in future versions. – Tiny Feb 12 '16 at 14:29

1 Answers1

0

I don't use this component anymore, but best solution I found is to write a custom component based on Steps, a good example here

http://www.mastertheboss.com/jboss-web/primefaces/extending-primefaces-components

By extending Steps and StepsRenderer using this source and modify the way attribute "href" is write (and "class" too for thing like cursor:hover)

Shadowritter
  • 137
  • 1
  • 1
  • 8