on 01-12-2005 1:31 PM
Hello,
I have this piece of code which is using a bean:
bean = new ProfileBean();
IPortalComponentProfile userProfile = request.getComponentContext().getProfile();
Enumeration attr = userProfile.getPropertyAttributes(MYPROPERTY_KEY);
bean.setModelAttributes(this.createAttributesModel(attr, userProfile));
I receive this Exception:
Tag tableView attribute model: Cannot access bean property myProfileBean.modelAttributes in page context.
Can you please tell me what does this error means?
Hi Roy,
do you have a useBean tag in your JSP?
It has to look similar to this example:
<jsp:useBean
id="MyBeanKey"
scope="session"
class="bean.MyBean"
/>
Kind regards
Francisco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
below you can find an example of code I used to access a model via a bean into a JSP and using it in a table view:
<jsp:useBean
id="compBean"
scope="application"
class="<bean class>"
/>
...
<hbj:tableView
id="myTableView"
width="100%"
model="<b>compBean.model</b>"
design="STANDARD"
headerVisible="false"
footerVisible="true"
fillUpEmptyRows="true"
selectionMode="NONE"
navigationMode="BYLINE"
visibleFirstRow="<%= compBean.getVisibleRow()%>"
visibleRowCount="5"
onNavigate="onNavigate">
>
</hbj:tableView>
an extract of bean class regarding the model:
public class ClassName implements Serializable {
private DefaultTableViewModel model;
...
/**
@return
*/
public DefaultTableViewModel getModel() {
return <b>model</b>;
}
/**
@param model
*/
public void setModel(DefaultTableViewModel model) {
this.model = model;
}
...
}
hope this help
Cheers
Roberto
To: Francisco Villar
The model I am trying to use is private but I have a public getModel method to return it. That's the whole idea of the Bean, to keep the Bean's instaces private and to let access only through public get methods. But, even if I am turning this instance to public I still receive the same error....
Hi Roy,
to shorten it: Please minimize your not working example as far as you can to reproduce the error (~ 20 line java, ~ 5 lines JSP; ~ 10 lines portalapp.xml) and submit it here. So we can maybe see the error at a glance without poking around a bit here and a bit there and even if not, catch the example and have it run.
Best regards
Detlev
A possible workaround is to call the java api in between the table view tags ( I remeber doing this but I am not sure what the root cause of the problem was)
<hbj:tableView
id="myTableView"
width="100%"
design="STANDARD"
headerVisible="false"
footerVisible="true"
fillUpEmptyRows="true"
selectionMode="NONE"
navigationMode="BYLINE"
visibleFirstRow="<%= compBean.getVisibleRow()%>"
visibleRowCount="5"
onNavigate="onNavigate">
>
<%
myTableView.setModel (compBean.getModel() ) ;
%>
</hbj:tableView>
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.