cancel
Showing results for 
Search instead for 
Did you mean: 

tableview navigation problem

Former Member
0 Kudos

Hi ALL,

Tableview navigation to newrow,nextpage buttons are not working .When i click on those buttons just page is refreshing but displaying same values instead of displaying next set of records.I am posting my code.Can anyone tell me where i am doing wrong?.Any help is highly appreciated.

JSP

<hbj:tableView

id="myTableView"

model="myBean.model"

design="ALTERNATING"

headerVisible="true"

footerVisible="true"

fillUpEmptyRows="false"

navigationMode="BYLINE"

headerText="ABSENCE OVERVIEW"

onNavigate="myOnNavigate"

visibleFirstRow="<%=myBean.getVisibleRow() %>"

visibleRowCount="10"

width="400 px" >

Bean

private String visibleRow ="1";

public void setVisibleRow(String visibleRow) {

this.visibleRow = visibleRow;

}

public String getVisibleRow() {

return this.visibleRow;

}

Dynpage

private int visibleRow=15;

public void onMyOnNavigate(Event event) throws PageException{

TableNavigationEvent tne = (TableNavigationEvent) event;

this.visibleRow = tne.getFirstVisibleRowAfter();

if(myBean!=null)

//myBean.setVisibleRow(new Integer(tne.getFirstVisibleRowAfter()+20).toString());

myBean.setVisibleRow(new Integer(tne.getFirstVisibleRowAfter()).toString());

if(myBean!=null)

myBean.setVisibleRowCount(new Integer(20).toString());

//String i = myBean.getvalue();

//response.write("this is the value"+i);

}

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Iam confused with your onMyNavigate method()

Try this the following, instead:

In Dynpage:

private int visibleRow=1;

...

.

public void myOnNavigate(Event event) throws PageException{

TableNavigationEvent tne = (TableNavigationEvent) event;

this.visibleRow = tne.getFirstVisibleRowAfter();

if(myBean!=null)

myBean.setVisibleRow(new Integer(this.visibleRow).toString());

}

Regards,

P.

Former Member
0 Kudos

Hi Peter,

I did as you said but event is triggering just refreshing the page but not displaying the next set of records.

JSPDynpage

private int visibleRow=1;

public void myOnNavigate(Event event) throws PageException{

TableNavigationEvent tne = (TableNavigationEvent) event;

this.visibleRow = tne.getFirstVisibleRowAfter();

if(myBean!=null)

myBean.setVisibleRow(new Integer(this.visibleRow).toString());

Bean

private String visibleRow = "1";

public void setVisibleRow(String visibleRow) {

this.visibleRow = visibleRow;

}

public String getVisibleRow() {

return this.visibleRow;

}

JSP

<hbj:tableView

id="myTableView"

model="myBean.model"

design="ALTERNATING"

headerVisible="true"

footerVisible="true"

fillUpEmptyRows="false"

navigationMode="BYLINE"

headerText=" OVERVIEW"

onNavigate="myOnNavigate"

visibleFirstRow = "<%=myBean.getVisibleRow() %>"

visibleRowCount="10"

width="400 px" >

<%

Where i am doing mistake?

Former Member
0 Kudos

Hi M Peter,

Any inputs.

Thanks

Former Member
0 Kudos

can't find anything wrong inside that code..

Iam not sure, y itz happening.

try printing the visible row on JSP

Eg:

<%=myBean.getVisibleRow()%>

Regards,

Former Member
0 Kudos

Hi Peter,

If i put 10 instead of <%=myBean.getVisibleRow()%>

i am getting first 10 recordss,If i put 20 i am getting next 10 set of records.

visibleFirstRow = "20"

visibleRowCount="10"

Any inputs?

Thanks

Former Member
0 Kudos

Adter putting this <%=myBean.getVisibleRow()%> on JSP,

What did it print each time when u hit that button and after it getz refreshed??

Former Member
0 Kudos

When i click on that button it is refreshing page but displaying same set of records from 1 to 10

Former Member
0 Kudos

sry for confusing you,

i asked u to put that line on JSP(forgot to tell the word 'seperately') somewhere on the top, just to see itz value..now that ur table showing same set it must be 1 all the times..

try inserting the following lines of code in the PAI of your dynpage:

IPortalComponentSession componentSession = ((IPortalComponentRequest)getRequest()).getComponentSession();

myBean = (TableBean) componentSession.getValue("myBean");

Regards,

P.

Former Member
0 Kudos

Hi Peter,

If i put <%=myBean.getVisibleRow()%> when i click on button page is refreshing displaying same 10 records but at the buttom of the page it is displaying 1/52.actually 52 recods are there

Former Member
0 Kudos

Din realize, but u have defined application as ur scope.

so try to set ur bean again in the PAI method.

Code i gave u was for the scope=session.

May try something like this,(in PAI)

IPortalComponentProfile profile = context.getProfile();

myBean = (TableBean) context.putValue("myBean");

Check ur code and write accordingly.

Regards,

P.

Former Member
0 Kudos

Hi Peter,

Thanks.But it didnt worked out .I pasted your code in JSP DYNpage

IPortalComponentProfile profile = context.getProfile();

myBean = (TableBean) context.putValue("myBean");

as it is but putValue in myBean = (TableBean) context.putValue("myBean"); is showing error asking to change to getValue.I did put it to getValue but no difference in output

Former Member
0 Kudos

sry itz getValue not putValue!

Send in you par!

sapmails@gmail.com

Regards,

P.

Former Member
0 Kudos

send par file

Answers (0)