You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org> on 2006/07/17 19:22:14 UTC

[jira] Created: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Ability to reset datascroller(UIData) to page one from a UICommand
------------------------------------------------------------------

                 Key: TOMAHAWK-548
                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-548
             Project: MyFaces Tomahawk
          Issue Type: Improvement
          Components: Data Scroller, Extended Datatable
            Reporter: Mike Kienenberger


There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.

Currently this has to be done as follows:

<h:commandButton
	value="Submit Query"
	action="#{searchPageBean.search}"
	actionListener="#{searchPageBean.resetDataScroller}">					
</h:commandButton>

<t:dataTable id="searchResultsDataTable"
	binding="#{searchPageBean.searchUIData}"

    public void resetDataScroller(ActionEvent e)
    {
    	searchUIData.setFirst(0);
    }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Phanidhar Adusumilli (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578158#action_12578158 ] 

Phanidhar Adusumilli commented on TOMAHAWK-548:
-----------------------------------------------

Since the datatable supports value binding expression for "first" attribute. If the datascroller is coded in a way that it also uses the same expression to update on pagination. both the scroller and table will be in sync and the application is also in control of when to reset it. Moreover the data scroller does not need the UIData hence "for" attribute is not needed.

ex:

<t:datatable first="#searchPageBean.startRowIndex" ...>
  ...
</t:datatable>
<t:dataScroller startRowIndex="#searchPageBean.startRowIndex" ...>
  ...
</t:dataScroller>


in searchPageBean's search method the attribute startRowIndex can be set to 0 when the datamodel is updated.

It does not remove the java code, but keeps everything in application control.


> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Phanidhar Adusumilli (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577581#action_12577581 ] 

phanidhar edited comment on TOMAHAWK-548 at 3/11/08 12:43 PM:
-------------------------------------------------------------------------

Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

<t: datatable ... first=#{searchPageBean.firstRowIndex} >

the search method in myBean
This does not eliminate the java code, but does not require the table component binding to the managed bean.

      was (Author: phanidhar):
    Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

<t: datatable ... first=#{mybean.firstRowIndex} >

the search method in myBean
This does not eliminate the java code, but does not require the table component binding to the managed bean.
  
> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Phanidhar Adusumilli (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577581#action_12577581 ] 

phanidhar edited comment on TOMAHAWK-548 at 3/11/08 12:47 PM:
-------------------------------------------------------------------------

Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

the method setFirst in UIData
{
        if (first < 0) {
            throw new IllegalArgumentException("Illegal value for first row: " + first);
        }
        ValueBinding vb = getValueBinding("first");
        if(vb == null) {
           _first = new Integer(first); 
        }else
        {
             vb.setValue(context, new Integer(first));
        }

}


<t: datatable ... first=#{searchPageBean.firstRowIndex} >

the method searchPageBean.searchUIData can be as follows
{
  ... update the data model ...
  firstRowIndex = 0;
}
This does not eliminate the java code, but does not require the table component binding to the managed bean.

      was (Author: phanidhar):
    Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

<t: datatable ... first=#{searchPageBean.firstRowIndex} >

the search method in myBean
This does not eliminate the java code, but does not require the table component binding to the managed bean.
  
> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Phanidhar Adusumilli (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577581#action_12577581 ] 

Phanidhar Adusumilli commented on TOMAHAWK-548:
-----------------------------------------------

Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

This does not eliminate the java code, but does not require the table component binding to the managed bean.

> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Phanidhar Adusumilli (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578158#action_12578158 ] 

phanidhar edited comment on TOMAHAWK-548 at 3/12/08 10:59 PM:
-------------------------------------------------------------------------

Since the datatable supports value binding expression for "first" attribute. If the datascroller is coded in a way that it also uses the same expression to update on pagination. both the scroller and table will be in sync and the application is also in control of when to reset it. 
ex:

<t:datatable first="#searchPageBean.startRowIndex" ...>
  ...
</t:datatable>
<t:dataScroller startRowIndex="#searchPageBean.startRowIndex" ...>
  ...
</t:dataScroller>


in searchPageBean's search method the attribute startRowIndex can be set to 0 when the datamodel is updated.

It does not remove the java code, but keeps everything in application control.


      was (Author: phanidhar):
    Since the datatable supports value binding expression for "first" attribute. If the datascroller is coded in a way that it also uses the same expression to update on pagination. both the scroller and table will be in sync and the application is also in control of when to reset it. Moreover the data scroller does not need the UIData hence "for" attribute is not needed.

ex:

<t:datatable first="#searchPageBean.startRowIndex" ...>
  ...
</t:datatable>
<t:dataScroller startRowIndex="#searchPageBean.startRowIndex" ...>
  ...
</t:dataScroller>


in searchPageBean's search method the attribute startRowIndex can be set to 0 when the datamodel is updated.

It does not remove the java code, but keeps everything in application control.

  
> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476362 ] 

Mike Kienenberger commented on TOMAHAWK-548:
--------------------------------------------

One possiblity -- an actionlistener component:

<t:resetUIData for="id of dataTable" first="#{optional value to setFirst()}"/>

> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Phanidhar Adusumilli (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577581#action_12577581 ] 

phanidhar edited comment on TOMAHAWK-548 at 3/11/08 12:48 PM:
-------------------------------------------------------------------------

Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

the method setFirst in UIData
{
        if (first < 0) {
            throw new IllegalArgumentException("Illegal value for first row: " + first);
        }
        ValueBinding vb = getValueBinding("first");
        if(vb == null) {
           _first = new Integer(first); 
        }else
        {
             vb.setValue(context, new Integer(first));
        }

}


<t: datatable ... first="#{searchPageBean.firstRowIndex}" >

the method searchPageBean.searchUIData can be as follows
{
  ... update the data model ...
  firstRowIndex = 0;
}
This does not eliminate the java code, but does not require the table component binding to the managed bean.

      was (Author: phanidhar):
    Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

the method setFirst in UIData
{
        if (first < 0) {
            throw new IllegalArgumentException("Illegal value for first row: " + first);
        }
        ValueBinding vb = getValueBinding("first");
        if(vb == null) {
           _first = new Integer(first); 
        }else
        {
             vb.setValue(context, new Integer(first));
        }

}


<t: datatable ... first=#{searchPageBean.firstRowIndex} >

the method searchPageBean.searchUIData can be as follows
{
  ... update the data model ...
  firstRowIndex = 0;
}
This does not eliminate the java code, but does not require the table component binding to the managed bean.
  
> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (TOMAHAWK-548) Ability to reset datascroller(UIData) to page one from a UICommand

Posted by "Phanidhar Adusumilli (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577581#action_12577581 ] 

phanidhar edited comment on TOMAHAWK-548 at 3/11/08 12:42 PM:
-------------------------------------------------------------------------

Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

<t: datatable ... first=#{mybean.firstRowIndex} >

the search method in myBean
This does not eliminate the java code, but does not require the table component binding to the managed bean.

      was (Author: phanidhar):
    Since UIData supports value binding for the attribute "first" (getFirst is using it), Can we have setFirst push it to the valuebinding (if the valuebinding is present)?
In the current implementation setFirst only stores it locally thus makes the value binding useless.
By making setFirst to support pushing of the value to the value binding, one would have a mechanism to reset this value. i.e. when the datamodel is updated in the managed bean it can also modify the attribute used for value binding.

This does not eliminate the java code, but does not require the table component binding to the managed bean.
  
> Ability to reset datascroller(UIData) to page one from a UICommand
> ------------------------------------------------------------------
>
>                 Key: TOMAHAWK-548
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-548
>             Project: MyFaces Tomahawk
>          Issue Type: Improvement
>          Components: Data Scroller, Extended Datatable
>            Reporter: Mike Kienenberger
>
> There should be a way to reset the datascroller back to page one when clicking a UICommand without writing java code and binding the UIData to the backing bean.
> Currently this has to be done as follows:
> <h:commandButton
> 	value="Submit Query"
> 	action="#{searchPageBean.search}"
> 	actionListener="#{searchPageBean.resetDataScroller}">					
> </h:commandButton>
> <t:dataTable id="searchResultsDataTable"
> 	binding="#{searchPageBean.searchUIData}"
>     public void resetDataScroller(ActionEvent e)
>     {
>     	searchUIData.setFirst(0);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.