You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Udo Schnurpfeil <ud...@schnurpfeil.de> on 2010/07/13 12:47:44 UTC

Re: [Tobago] Problem using tc:tree and request parameters

  Hi Alf,

I think the request parameters are working like expected.
Only in the case of "reload" it will depend, if you make a "reload" of 
the "get" or the reload of a later "post" request.
A reload of a "post" will normally reposted after the browser has asked 
the user (may depends on browser and configuration).

For solving the problem, I want to understand why you use the "get" 
request with the non-jsf parameter (see the last section from my last 
mail).

Regards,

Udo

Am 17.06.10 13:01, schrieb Alf Felis:
> Hi Udo,
>
> sorry... I forgot the environment information:
> MyFaces 1.1.6
> Tobago 1.0.24 and 1.0.27
>
> The bean has session scope.
>      <managed-bean>
>          <managed-bean-name>tobagoTreeTestBean</managed-bean-name>
>          <managed-bean-class>TobagoTreeTestBean</managed-bean-class>
>          <managed-bean-scope>session</managed-bean-scope>
>      </managed-bean>
>
> I have attached my test bean and the jsp page to this mail.
>
> First I thought that the request always contains the state of the navigation, but I checked the request parameters (using a servlet filter) and figured out that the state information will only be sent when I click the navigation tree.
>
> Nevertheless reloading the page (browser reload) collapses the tree when using parameters and saves the state without using parameters. In both situations there are no request parameters from the navigation state.
>
> --------------------------------------------
> Request parameters using parameters:
> --------------------------------------------
> Parameters:
> param: 123
>
> --------------------------------------------
> Request parameters without parameters:
> --------------------------------------------
> Parameters:
>
> --------------------------------------------
> Request parameters when clicking the tree:
> --------------------------------------------
> Parameters:
> _idJsp0::form-action: _idJsp0:nav:Number1
> jsf_tree: 5
> _idJsp0::action-position: 0px,0px,0px,0px
> _idJsp0::context-path: /Tobago
> jsf_viewid: /TobagoTreeTest.jsp
> _idJsp0::form-clientDimension: 913;700
> _idJsp0:nav: ;Home;Number1;
> _idJsp0:nav-marker: _idJsp0:nav:Number1
> tobago.dummy:
> _idJsp0:nav-scrollPosition:
>
>
> Regards,
>
> Alf
>
>
> -----Ursprüngliche Nachricht-----
> Von: Udo Schnurpfeil<ud...@schnurpfeil.de>
> Gesendet: 17.06.2010 09:59:42
> An: MyFaces Discussion<us...@myfaces.apache.org>
> Betreff: Re: [Tobago] Problem using tc:tree and request parameters
>
>> Hi Alf,
>>
>> I've some questions:
>> Which Tobago version and which JSF implementation and version you are
>> using (and which container)?
>> In which scope is the managed bean that holds the state?
>>
>> I don't exactly know what happens, because I've not the sources of you code.
>> But I can try some supposition...
>> The usual usage of Tobago is to write an application, with one or more
>> pages that will be called by clicking on some controls on the page.
>> It was a difference of calling the URL and clicking a<tc:button>. The
>> click on a button will submit the current expansion state of the tree
>> and sends it to the server (via a hidden input field), which manipulates
>> the tree state object. When calling the URL (manually) the expansion
>> state information is not part of the request. When JSF now restores the
>> UIViewRoot and begins to decode the request it clears the expand state
>> and tries to apply the new information from the browser (which are not
>> available in this case).
>>
>> It is correct, that you want to provide external links (non faces
>> request to faces response)? Are you also use "internal" actions? If not,
>> you don't need to save the expansion state for each user. You can try to
>> put the tree state in the "none" scope.
>>
>> Regards,
>>
>> Udo
>>
>> Am 15.06.10 15:51, schrieb Alf Felis:
>>> Any idea?
>>>
>>> -------- Original-Nachricht --------
>>> Datum: Thu, 03 Jun 2010 13:31:44 +0200
>>> Von: "Alf Felis"[
>>> An: MyFaces Discussion
>>> Betreff: [Tobago] Problem using tc:tree and request parameters
>>>
>>> Hi all,
>>>
>>> I have a problem with tc:tree.
>>> In my code I expand the tree after creation using the TreeState:
>>>
>>> state.expand(tree, 1);
>>>
>>> This works fine till I use a request parameter... e.g.
>>>
>>> http://localhost:8080/Tobago/faces/TobagoTreeTest.jsp?param=123
>>>
>>> In this case the first/initial call will show an expanded tree... the second call shows a collapsed tree.
>>>
>>> -------------------------------------
>>> first and second call with parameter:
>>> -------------------------------------
>>> 1.) Call the URL ->   tree expanded
>>> 2.) Reload the URL ->   tree collapsed
>>>
>>> -------------------------------------
>>> first call with, second without parameter:
>>> -------------------------------------
>>> 1.) Call the URL ->   tree expanded
>>> 2.) Call http://localhost:8080/Tobago/faces/TobagoTreeTest.jsp ->   tree expanded
>>> 3.) any call/reload without parameter ->   tree expanded
>>>
>>> I figured out that the method 'TreeState.clearExpandState()' will be called, but I can't find any hints on that issue.
>>>
>>>
>>> Regards, Alf