如何在页面上的ajax请求之后保留JSF flash范围参数?

时间:2016-02-12 14:45:24

标签: jsf-2.2 flash-scope

我可以使用

保持页面重新加载的flash变量
Array
(
    [11] => Array
      (
        [supervizori] => data
        [grupi] => Doctors //this is the team
        [tipo_crt] => LUCE
        [operatori] => data
        [data] => 2015-12-20
        [status] => OK
        [nome] => data
        [cognome] => data
        [cel] => data
        [codice_fiscale] => shkrfl93a08a123a
    )

[12] => Array
    (
        [supervizori] => data
        [grupi] => BMW //this is the team
        [tipo_crt] => data
        [operatori] => data
        [data] => 2015-12-22
        [status] => KO
        [nome] => rgrg
        [cognome] => grdgdrgdrg
        [cel] => serges
        [codice_fiscale] => a
    )

[17] => Array
    (
        [supervizori] => data
        [grupi] => Doctors  //this is the team    
        [tipo_crt] => GAS
        [operatori] => data
        [data] => 2015-12-24
        [status] => Atessa
        [nome] => dscc
        [cognome] => csdfvsg
        [cel] => wgwegwe
        [codice_fiscale] => rgrwgrwg
    )

[18] => Array
    (
        [supervizori] => data
        [grupi] => Bosat //this is the team
        [tipo_crt] => data
        [operatori] => data
        [data] => 2015-12-24
        [status] => OK
        [nome] => dscc
        [cognome] => csdfvsg
        [cel] => wgwegwe
        [codice_fiscale] => rgrwgrwg
    )

[19] => Array
    (
        [supervizori] => data
        [grupi] => Doctors   //this is the team   
        [tipo_crt] => LUCE
        [operatori] => data
        [data] => 2015-12-29
        [status] => Atessa
        [nome] => dhr
        [cognome] => rhrdh
        [cel] => rdhrdh
        [codice_fiscale] => rdhrdh
    )

[20] => Array
    (
        [supervizori] => data
        [grupi] => Doctors   //this is the team   
        [tipo_crt] => LUCE
        [operatori] => data
        [data] => 2016-01-04
        [status] => OK
        [nome] => dwadwa
        [cognome] => jgv
        [cel] => jlgv
        [codice_fiscale] => jgv
    ) // this is the first array from orders

Array
(
    [8] => Array
        (
            [grup_name] => BMW   
        )

    [9] => Array
        (
            [grup_name] => Doctors      
        )

    [10] => Array
        (
            [grup_name] => Bosat    
        )

 )// the teams array

但是对页面的任何回发都会导致我丢失flash变量。 我尝试过使用preRenderView事件监听器并检查回发。

FacesContext.getCurrentInstance().getExternalContext().getFlash().keep("someVar");

但这次我收到此错误并丢失了flash变量

  

当我们尝试为Flash设置传出cookie时,响应已经提交。存储在闪存中的任何值在下一个请求中都不可用。

实际上我想要实现的是使用Post-Redirect-Get模式并将页面数据保存在手动重新加载页面上(用户点击F5)。我正在使用Mojorra 2.2.8

0 个答案:

没有答案