Issue related to commandlinks

2010-08-06 Thread preeti agarwal
Thanks for your response.



Basically, I am creating a tab facelet component. The code below is for
achieving lazy loading. I am iterating over each tab and creating a
commandlink for each:



c:forEach var=tabs1 items=#{paramList} begin=0 end=#{listSize}
varStatus=status
c:set var=index value=#{status.index} scope=session/
c:choose
 c:when test=${tabs1.lazyLoadingEnabled =='true'}
  *tr:commandLink id =LazyLoad#{CompId}_#{index}
partialSubmit=true actionListener=#{tabs1.ClickAction}/tr:commandLink
**
* /c:when
 c:otherwise
 /c:otherwise
/c:choose
/c:forEach







On click on each tab, I trigger the command link to display the
panelgroupLayout:



c:forEach var=tab items=#{paramList} begin=0 end=#{listSize}
varStatus=status
  c:set var=Tcount value=#{status.index} scope=session/

  *   tr:panelGroupLayout
id=LazyLoadPanelGroup#{CompId}_#{Tcount} p**
artialTriggers=LazyLoad#{CompId}_#{index}
*  TAB CONTENT
 */tr:panelGroupLayout*

/c:forEach







The funny thing is that if I do it programatically - Using the action
listener and setting the trigger in Java function, it works.  Below is the
code for the Action Listener :

UIComponent PanelGroup = root.findComponent(PanelId);

RequestContext rc = RequestContext.*getCurrentInstance*();

rc.addPartialTarget(PanelGroup);





I have checked for the Ids. It looks like the PPR call is getting blocked
somewhere, because when I click on the third one *all those tabs which have
been clicked before* get rendered.












-- Forwarded message --
From: *Michael Kurz* michi.k...@gmx.at
Date: Thu, Aug 5, 2010 at 11:20 PM
Subject: Re: Issue related to commandlinks
To: users@myfaces.apache.org


Are you sure the IDS are correct (no NamingContainers in between or
something like this)? A code fragment might be helpful to outline the
problem.

Regards
Michael

Am 04.08.2010 15:59, schrieb preeti agarwal:



Hey all,

  I have three panelGroupLayouts and three commandlinks. Each
commandlink is associated with a corresponding panelGroupLayout. I am
rendering the panelgroupLayouts using PPR (partialtriggers) on clicking of
the commandlinks.

When I click the first two commandlinks, nothing happens (The panelgroup
doesn't get rendered).
When I click the third one, all three panelgroups get rendered.

I have rechecked that the ids are linked correctly. Any idea why this might
happen?


Re: Issue related to commandlinks

2010-08-06 Thread Michael Kurz

See answer inline.

Am 06.08.2010 08:08, schrieb preeti agarwal:

Thanks for your response.


You're welcome!


On click on each tab, I trigger the command link to display the
panelgroupLayout:

c:forEach var=tab items=#{paramList} begin=0 end=#{listSize}
varStatus=status
   c:set var=Tcount value=#{status.index} scope=session/

   *tr:panelGroupLayout
id=LazyLoadPanelGroup#{CompId}_#{Tcount} p**
artialTriggers=LazyLoad#{CompId}_#{index}


I think that index is wrong here - should also be Tcount. index is 
set in the last c:forEach and should be fixed to listSize at this point 
in time. This would also explain why the last link triggers all panels.


regards
Michael


Re: Issue related to commandlinks

2010-08-06 Thread Michael Kurz
Well, as he seems to use Facelets this should be OK as Facelets provides 
parts of the JSTL. But nevertheless you are right, combining Facelets 
and JSTL can have nasty side effects.


regards
Michael

Am 06.08.2010 09:44, schrieb Anton Gavazuk:

which version of JSF do you use - 1.1, 1.2, 2.0?
I suppose it could be unexpected behavior of  mixing JSF and JSP tags.

2010/8/6 preeti agarwalpreetiagarwa...@gmail.com


Thanks for your response.



Basically, I am creating a tab facelet component. The code below is for
achieving lazy loading. I am iterating over each tab and creating a
commandlink for each:



c:forEach var=tabs1 items=#{paramList} begin=0 end=#{listSize}
varStatus=status
c:set var=index value=#{status.index} scope=session/
c:choose
 c:when test=${tabs1.lazyLoadingEnabled =='true'}
  *tr:commandLink id =LazyLoad#{CompId}_#{index}
partialSubmit=true
actionListener=#{tabs1.ClickAction}/tr:commandLink
**
*/c:when
 c:otherwise
 /c:otherwise
/c:choose
/c:forEach







On click on each tab, I trigger the command link to display the
panelgroupLayout:



c:forEach var=tab items=#{paramList} begin=0 end=#{listSize}
varStatus=status
  c:set var=Tcount value=#{status.index} scope=session/

  *tr:panelGroupLayout
id=LazyLoadPanelGroup#{CompId}_#{Tcount} p**
artialTriggers=LazyLoad#{CompId}_#{index}
*  TAB CONTENT
 */tr:panelGroupLayout*

/c:forEach







The funny thing is that if I do it programatically - Using the action
listener and setting the trigger in Java function, it works.  Below is the
code for the Action Listener :

UIComponent PanelGroup = root.findComponent(PanelId);

RequestContext rc = RequestContext.*getCurrentInstance*();

rc.addPartialTarget(PanelGroup);





I have checked for the Ids. It looks like the PPR call is getting blocked
somewhere, because when I click on the third one *all those tabs which have
been clicked before* get rendered.












-- Forwarded message --
From: *Michael Kurz*michi.k...@gmx.at
Date: Thu, Aug 5, 2010 at 11:20 PM
Subject: Re: Issue related to commandlinks
To: users@myfaces.apache.org


Are you sure the IDS are correct (no NamingContainers in between or
something like this)? A code fragment might be helpful to outline the
problem.

Regards
Michael

Am 04.08.2010 15:59, schrieb preeti agarwal:



Hey all,

  I have three panelGroupLayouts and three commandlinks. Each
commandlink is associated with a corresponding panelGroupLayout. I am
rendering the panelgroupLayouts using PPR (partialtriggers) on clicking of
the commandlinks.

When I click the first two commandlinks, nothing happens (The panelgroup
doesn't get rendered).
When I click the third one, all three panelgroups get rendered.

I have rechecked that the ids are linked correctly. Any idea why this might
happen?





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

2010-08-06 Thread Udo Schnurpfeil

 Hi, Alf,

after taking a close look to your problem, we have discovered a problem 
in the decision if there is a post back, or not.
I've added an issue in JIRA: 
https://issues.apache.org/jira/browse/TOBAGO-905


You may test the current 1.0.x branch or use the nightly build from 
tomorrow.


Regards,

Udo

Am 25.06.10 09:30, schrieb Alf Felis:

Hi Udo,

I noticed that the attachments has been removed from my mail.

Should I send them to your email account?


Regards,

Alf


-Ursprüngliche Nachricht-
Von: Alf Felisalf.fe...@gmx.de
Gesendet: 17.06.2010 13:01:43
An: MyFaces Discussionusers@myfaces.apache.org
Betreff: Re: [Tobago] Problem using tc:tree and request parameters


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-nametobagoTreeTestBean/managed-bean-name
managed-bean-classTobagoTreeTestBean/managed-bean-class
managed-bean-scopesession/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
Gesendet: 17.06.2010 09:59:42
An: MyFaces Discussion
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 atc: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


Trinidad code completion

2010-08-06 Thread Walter Mourão
Hi folks,
after installing Eclipse Helios (J2EE bundle + Trinidad plugin) the Trinidad
code completion stopped working...

Hints ?

Thanks in advance,


Walter Mourão
http://waltermourao.com.br
http://arcadian.com.br
http://oriens.com.br


Re: Issue related to commandlinks

2010-08-06 Thread preeti agarwal
wow.thanks for fast response and keen observation.
We totally missed this typo error as this piece of code was copy pasted from
code where the counter was index.
Hopefully this will solve the problem.
Really thanks.



On Fri, Aug 6, 2010 at 1:59 PM, Michael Kurz michi.k...@gmx.at wrote:

 See answer inline.

 Am 06.08.2010 08:08, schrieb preeti agarwal:

 Thanks for your response.


 You're welcome!

  On click on each tab, I trigger the command link to display the
 panelgroupLayout:

 c:forEach var=tab items=#{paramList} begin=0 end=#{listSize}
 varStatus=status
   c:set var=Tcount value=#{status.index} scope=session/

   *tr:panelGroupLayout
 id=LazyLoadPanelGroup#{CompId}_#{Tcount} p**
 artialTriggers=LazyLoad#{CompId}_#{index}


 I think that index is wrong here - should also be Tcount. index is
 set in the last c:forEach and should be fixed to listSize at this point in
 time. This would also explain why the last link triggers all panels.

 regards
 Michael



Re: Trinidad code completion

2010-08-06 Thread Matthias Wessendorf
Strange. But I guess that is a tooling issue

sent from my Android phone

On Aug 6, 2010 6:34 PM, Walter Mourão walter.mou...@gmail.com wrote:
 Hi folks,
 after installing Eclipse Helios (J2EE bundle + Trinidad plugin) the
Trinidad
 code completion stopped working...

 Hints ?

 Thanks in advance,


 Walter Mourão
 http://waltermourao.com.br
 http://arcadian.com.br
 http://oriens.com.br