cancel
Showing results for 
Search instead for 
Did you mean: 

Problem getting jsp component from jspdynpage

Former Member
0 Kudos

Hi,

I am making a call in my java class in method

doProcessBeforeOuput with the following call

table = (TableView) this.getComponentByName("tableview_AddMaterial");

Object[] objs = this.getComponents();

Both return nulls for the object, how does someone access the jsp tables or text fields defined by id in htmlb in your java code I did check and all these are defined

private IPageContext pageContext;

private IPortalComponentRequest request;

private IPortalComponentResponse response;

private IPortalComponentSession session;

private IPortalComponentContext userContext;

private IPortalComponentProfile userProfile;

Also here is my htmltable in the jsp

<hbj:tableView

id="tableview_AddMaterial"

model="DHB.queryResultsModel"

design="TRANSPARENT"

headerVisible="false"

footerVisible="true"

visibleRowCount="50"

visibleFirstRow="1"

selectionMode="MULTISELECT">

</hbj:tableView>

Any help would be greatly appreciated and I do reward points for helpful answers

Cheers,

Devlin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Devlin

You can access the fields in jsp as follows.For example, consider tableview with id "myTableView".

<b>TableView table = (TableView) this.getComponentByName("myTableView");</b>

If you add this line, you can get all the values related to tableview.For example, to get the first visible row of the tableview, the code goes as follows.

<b>int firstVisibleRow = table.getVisibleFirstRow();</b>

Jsp for the same:

==================

<hbj:tableView

id="myTableView"

model="tablebean.model"

design="ALTERNATING"

headerVisible="true"

footerVisible="true"

selectionMode="MULTISELECT"

headerText="Office locations"

visibleFirstRow="1"

visibleRowCount="5"

rowCount="16"

width="500px">

</hbj:tableView>

Try and let me know the results.

Hope this helps.

Regards

Yoga

Former Member
0 Kudos

Hey I actually figured out the problem before but I still rewarded you points because it was correct.

Basically that was it as I had before the problem I had the jsp in a if statement so that part of the jsp wasn't active until an event had been fired from another iview, and I threw it in to test, so I moved it on the rowclicked method to ensure that part of the jsp was active and it worked

I am putting another post up on how to add a title to the checkbox if you know that please answer

Cheers,

Devlin

Answers (0)