Equivalent to restfaces' HttpParentAction in pretty faces?

Splash Forums PrettyFaces Users Equivalent to restfaces' HttpParentAction in pretty faces?

This topic contains 2 replies, has 2 voices, and was last updated by  balteo 6 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17818

    balteo
    Participant

    Hello,

    I am porting an application from restfaces to prettyfaces and need to find the equivalent to restfaces’ HttpParentAction in pretty faces.

    What I want to achieve: call the same “changeLocale” method from accueilView bean from all pages that want to change the locale:

    method follows here:

    **************************

    @URLAction

    public void changeLocale() {

    log.info(“changeLocale”);

    UIViewRoot view = FacesContext.getCurrentInstance().getViewRoot();//todo locale en dur içi

    if (“fr”.equals(this.language)) {

    view.setLocale(Locale.FRENCH);

    } else if (“en”.equals(this.language)) {

    view.setLocale(Locale.ENGLISH);

    }

    getSuggestionOeuvreView().setSculptureSuggeree(getSuggestionOeuvreView().suggererSculpture());//refactor

    }

    **************************

    Is that possible with pretty faces and it’s annotations?

    Thanks in advance,

    Julien.

    #20409

    Hey Julien,

    you wrote on the other thread, that you tried to use the new parentId feature but it didn’t work for actions. I’m not an expert on this new feature as Lincoln just added it a few days ago. I had a quick look at the code and it seems like actions aren’t inherited at the moment. I think we should definitively add this feature. Could you open a ticket for this?

    http://code.google.com/p/prettyfaces/issues/list

    In the meantime you could quickly build a workaround for your usecase by implementing one of the new service provider interfaces of 3.1.1-SNAPSHOT:

    http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html/Extensions.html#ConfigurationPostProcessor

    You could simply implement this interface and manually add actions to all mappings in the PrettyConfig object. This should be possible in a few lines of code.

    Christian

    #20410

    balteo
    Participant

    Hello Christian,

    I opened the ticket. Sorry I filed it under defect. I am not sure if this is appropriate.

    As far as the configurationPostProcessor is concerned I am having problems instanciating a UrlAction especifically the one above i.e. “changeLocale”. How do I do that please?

    Regards,

    Julien.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.