|
View:
New views
11 Messages
—
Rating Filter:
Alert me
|
|
|
Sort Table - Page Refreshes - Then Auto Scroll Back to the TableI have implemented a sortable table with the <t:dataTable/> tag. It's very cool. Thx to those
who worked on this. I am not a JavaScript guru, so I am having some trouble with something that should be very basic: My sortable table is near the bottom of my page. After the page refreshes. I'd like to automatically scroll back to the table. Any suggestions? Mike __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
Re: Sort Table - Page Refreshes - Then Auto Scroll Back to the TableIf you've enabled the AUTOSCROLL parameter in your web.xml file, you
should be seeing javascript generated like the following for each command-link/command-button. onclick="clear__5FtagId1_5F2();document.forms['_tagId1_2'].elements['autoScroll'].value=getScrolling();document.forms['_tagId1_2'].elements['_tagId1_2:_link_hidden_'].value='_tagId1_2:showAttachmentStatusableWorkList';if(document.forms['_tagId1_2'].onsubmit){var result=document.forms['_tagId1_2'].onsubmit(); if( (typeof result == 'undefined') || result ) {document.forms['_tagId1_2'].submit();}}else{document.forms['_tagId1_2'].submit();}return false;" The javascript below sets the current element (generally a command-link) as the location to scroll to when the page reloads. document.forms['yourFormId'].elements['autoScroll'].value=getScrolling(); Unfortunately, I haven't figured out how to make it scroll to any arbitrary component on the page, but I'd think just enabling the parameter should make it scroll back to your sorting link. <context-param> <param-name>org.apache.myfaces.AUTO_SCROLL</param-name> <param-value>true</param-value> <description> If true, a javascript function will be rendered that is able to restore the former vertical scroll on every request. Convenient feature if you have pages with long lists and you do not want the browser page to always jump to the top if you trigger a link or button action that stays on the same page. Default: "false" </description> </context-param> On 12/19/05, Mike Duffy <mduffy_lists@...> wrote: > I have implemented a sortable table with the <t:dataTable/> tag. It's very cool. Thx to those > who worked on this. > > I am not a JavaScript guru, so I am having some trouble with something that should be very basic: > My sortable table is near the bottom of my page. After the page refreshes. I'd like to > automatically scroll back to the table. > > Any suggestions? > > Mike > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > |
|
|
|
|
|
JSTL + JSF questionHi guys -
Thanks in advance for any answers :) I need to iterate over something in one of my JSPs that is a list maintained in a session scoped JSF bean. I am trying to use this JSTL tag: <c:forEach var="children" items="$editorPanelBean.list"> Is this legal? Or do I need to do something complicated like using a JSP scriptlet to get my request parameters and go digging for the map? Jeremy Sager Data Communications Product Manager Chesapeake System Solutions 410.356.6805 x120 JSager@... |
|
|
Re: JSTL + JSF questiondoesn't work
use facelets or glassfish (jsp 2.1) On 12/20/05, Jeremy Sager <jsager@...> wrote: > Hi guys - > > Thanks in advance for any answers :) > > I need to iterate over something in one of my JSPs that is a list maintained > in a session scoped JSF bean. > > I am trying to use this JSTL tag: > > <c:forEach var="children" items="$editorPanelBean.list"> > > Is this legal? Or do I need to do something complicated like using a JSP > scriptlet to get my request parameters and go digging for the map? > > Jeremy Sager > Data Communications Product Manager > Chesapeake System Solutions > 410.356.6805 x120 > JSager@... > > -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln http://www.wessendorf.net mwessendorf-at-gmail-dot-com |
|
|
Re: JSTL + JSF questionUnless you're using facelets, you're going to have difficulty using
c:forEach with JSF. Maybe you can use t:dataList instead? The difference is that c:forEach operates at component tree build time and dataList operates at render time, but for most use cases, that doesn't make any difference to the end-developer. On 12/20/05, Jeremy Sager <jsager@...> wrote: > Hi guys - > > Thanks in advance for any answers :) > > I need to iterate over something in one of my JSPs that is a list maintained > in a session scoped JSF bean. > > I am trying to use this JSTL tag: > > <c:forEach var="children" items="$editorPanelBean.list"> > > Is this legal? Or do I need to do something complicated like using a JSP > scriptlet to get my request parameters and go digging for the map? > > Jeremy Sager > Data Communications Product Manager > Chesapeake System Solutions > 410.356.6805 x120 > JSager@... > > |
|
|
Re: JSTL + JSF questionHi,
Assuming your JSF bean is called editorPanelBean and it's in the session You can get access to it using the following <c:forEach var="children" items="${sessionScope.editorPanelBean.list}"> so you don't have to use a scriplet in this scenario. |
|
|
Re: JSTL + JSF questionhttp://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html
this is a good article on the issue. On 12/20/05, Matthias Wessendorf <mwessendorf@...> wrote: > doesn't work > > use facelets or glassfish (jsp 2.1) > > > > On 12/20/05, Jeremy Sager <jsager@...> wrote: > > Hi guys - > > > > Thanks in advance for any answers :) > > > > I need to iterate over something in one of my JSPs that is a list maintained > > in a session scoped JSF bean. > > > > I am trying to use this JSTL tag: > > > > <c:forEach var="children" items="$editorPanelBean.list"> > > > > Is this legal? Or do I need to do something complicated like using a JSP > > scriptlet to get my request parameters and go digging for the map? > > > > Jeremy Sager > > Data Communications Product Manager > > Chesapeake System Solutions > > 410.356.6805 x120 > > JSager@... > > > > > > > -- > Matthias Wessendorf > Zülpicher Wall 12, 239 > 50674 Köln > http://www.wessendorf.net > mwessendorf-at-gmail-dot-com > -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln http://www.wessendorf.net mwessendorf-at-gmail-dot-com |
|
|
Re: JSTL + JSF questionOne friendly advice, use facelets or Shale-Clay or you'll go throught
a lot of pain if you use JSP as your view technology. It has several integration issues with JSF. On 12/20/05, Matthias Wessendorf <mwessendorf@...> wrote: > http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html > > this is a good article on the issue. > > On 12/20/05, Matthias Wessendorf <mwessendorf@...> wrote: > > doesn't work > > > > use facelets or glassfish (jsp 2.1) > > > > > > > > On 12/20/05, Jeremy Sager <jsager@...> wrote: > > > Hi guys - > > > > > > Thanks in advance for any answers :) > > > > > > I need to iterate over something in one of my JSPs that is a list maintained > > > in a session scoped JSF bean. > > > > > > I am trying to use this JSTL tag: > > > > > > <c:forEach var="children" items="$editorPanelBean.list"> > > > > > > Is this legal? Or do I need to do something complicated like using a JSP > > > scriptlet to get my request parameters and go digging for the map? > > > > > > Jeremy Sager > > > Data Communications Product Manager > > > Chesapeake System Solutions > > > 410.356.6805 x120 > > > JSager@... > > > > > > > > > > > > -- > > Matthias Wessendorf > > Zülpicher Wall 12, 239 > > 50674 Köln > > http://www.wessendorf.net > > mwessendorf-at-gmail-dot-com > > > > > -- > Matthias Wessendorf > Zülpicher Wall 12, 239 > 50674 Köln > http://www.wessendorf.net > mwessendorf-at-gmail-dot-com > -- Alexandre Poitras Québec, Canada |
|
|
Re: Sort Table - Page Refreshes - Then Auto Scroll Back to the TableThx Mike.
I've enabled the AUTO_SCROLL in my web.xml. The scroll back behavior is still not working. Is there anything else I need to do? I see the onclick scroll functions for the sortable columns in my data table. Is the scroll back funtionality enabled by just setting AUTO_SCROLL to true in the web.xml? Mike --- Mike Kienenberger <mkienenb@...> wrote: > If you've enabled the AUTOSCROLL parameter in your web.xml file, you > should be seeing javascript generated like the following for each > command-link/command-button. > > onclick="clear__5FtagId1_5F2();document.forms['_tagId1_2'].elements['autoScroll'].value=getScrolling();document.forms['_tagId1_2'].elements['_tagId1_2:_link_hidden_'].value='_tagId1_2:showAttachmentStatusableWorkList';if(document.forms['_tagId1_2'].onsubmit){var > result=document.forms['_tagId1_2'].onsubmit(); if( (typeof result == > 'undefined') || result ) > {document.forms['_tagId1_2'].submit();}}else{document.forms['_tagId1_2'].submit();}return > false;" > > The javascript below sets the current element (generally a > command-link) as the location to scroll to when the page reloads. > > document.forms['yourFormId'].elements['autoScroll'].value=getScrolling(); > > Unfortunately, I haven't figured out how to make it scroll to any > arbitrary component on the page, but I'd think just enabling the > parameter should make it scroll back to your sorting link. > > <context-param> > <param-name>org.apache.myfaces.AUTO_SCROLL</param-name> > <param-value>true</param-value> > <description> > If true, a javascript function will be rendered that is > able to restore the > former vertical scroll on every request. Convenient > feature if you have pages > with long lists and you do not want the browser page to > always jump to the top > if you trigger a link or button action that stays on the same page. > Default: "false" > </description> > </context-param> > > > On 12/19/05, Mike Duffy <mduffy_lists@...> wrote: > > I have implemented a sortable table with the <t:dataTable/> tag. It's very cool. Thx to > those > > who worked on this. > > > > I am not a JavaScript guru, so I am having some trouble with something that should be very > basic: > > My sortable table is near the bottom of my page. After the page refreshes. I'd like to > > automatically scroll back to the table. > > > > Any suggestions? > > > > Mike > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com |
|
|
Re: Sort Table - Page Refreshes - Then Auto Scroll Back to the TableYes, that should be enough.
There was a bug I recently fixed though in the auto-scroll behaviour. Maybe you want to try a recent nightly? regards, Martin On 12/26/05, Mike Duffy <mduffy_lists@...> wrote: > Thx Mike. > > I've enabled the AUTO_SCROLL in my web.xml. > > The scroll back behavior is still not working. Is there anything else I need to do? > > I see the onclick scroll functions for the sortable columns in my data table. Is the scroll back > funtionality enabled by just setting AUTO_SCROLL to true in the web.xml? > > Mike > > > > --- Mike Kienenberger <mkienenb@...> wrote: > > > If you've enabled the AUTOSCROLL parameter in your web.xml file, you > > should be seeing javascript generated like the following for each > > command-link/command-button. > > > > > onclick="clear__5FtagId1_5F2();document.forms['_tagId1_2'].elements['autoScroll'].value=getScrolling();document.forms['_tagId1_2'].elements['_tagId1_2:_link_hidden_'].value='_tagId1_2:showAttachmentStatusableWorkList';if(document.forms['_tagId1_2'].onsubmit){var > > result=document.forms['_tagId1_2'].onsubmit(); if( (typeof result == > > 'undefined') || result ) > > {document.forms['_tagId1_2'].submit();}}else{document.forms['_tagId1_2'].submit();}return > > false;" > > > > The javascript below sets the current element (generally a > > command-link) as the location to scroll to when the page reloads. > > > > document.forms['yourFormId'].elements['autoScroll'].value=getScrolling(); > > > > Unfortunately, I haven't figured out how to make it scroll to any > > arbitrary component on the page, but I'd think just enabling the > > parameter should make it scroll back to your sorting link. > > > > <context-param> > > <param-name>org.apache.myfaces.AUTO_SCROLL</param-name> > > <param-value>true</param-value> > > <description> > > If true, a javascript function will be rendered that is > > able to restore the > > former vertical scroll on every request. Convenient > > feature if you have pages > > with long lists and you do not want the browser page to > > always jump to the top > > if you trigger a link or button action that stays on the same page. > > Default: "false" > > </description> > > </context-param> > > > > > > On 12/19/05, Mike Duffy <mduffy_lists@...> wrote: > > > I have implemented a sortable table with the <t:dataTable/> tag. It's very cool. Thx to > > those > > > who worked on this. > > > > > > I am not a JavaScript guru, so I am having some trouble with something that should be very > > basic: > > > My sortable table is near the bottom of my page. After the page refreshes. I'd like to > > > automatically scroll back to the table. > > > > > > Any suggestions? > > > > > > Mike > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam protection around > > > http://mail.yahoo.com > > > > > > > > > > __________________________________________ > Yahoo! DSL – Something to write home about. > Just $16.99/mo. or less. > dsl.yahoo.com > > -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces |
| Free embeddable forum powered by Nabble | Forum Help |