Kumar Saravanan

Ranch Hand
+ Follow
since Aug 25, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kumar Saravanan

Hi,

I deployed my sample application (seam application) in Weblogic app server (10.1) and got the following message from the application server log.

SEVERE: JSF1040: Unable to load sunjsf.js. Components requiring JavaScript will not work.

If I have <h:commandLink> component in my UI (facelets), it throws the following exception:-

java.lang.NullPointerException
at java.io.Writer.write(Writer.java:104)
at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.write(HtmlResponseWriter.java:479)
at com.sun.faces.renderkit.RenderKitUtils.writeSunJS(RenderKitUtils.java:987)
at com.sun.faces.renderkit.RenderKitUtils.renderFormInitScript(RenderKitUtils.java:901)
at com.sun.faces.renderkit.html_basic.CommandLinkRenderer.encodeBegin(CommandLinkRenderer.java:159)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
and so on

Any guess what might be wrong here?

Thanks
Saravanan
13 years ago
JSF
Hi Tim,

Thanks for your reply. I never get 1000 items in collection and show them to the user at any point of time. Thanks for your valuable advice. Just for example, I mentioned it in my above post.

BuildTimeVsRenderTime

I was going through the above link and find the following code and its explanation ->



Explanation:-

In this case both the input and the output components are created.

The rendered is evaluated by the renderer during the rendering phase while the data table is iterating over each of its rows.



So in the above example, If my collections (bean.rows) has 10 items then 10 input and 10 output components will be created or only 2 components will be created.

If it creates 20 components in memory, when it is garbage collected. If I have too many components (checkbox, outputText, commandLink, commandButton - for each item) inside the datatable then it will affect the performance.

Please advice.

Thanks,
Saravanan
13 years ago
JSF
Hi,

Quick question regarding component creation in JSF.

In the following example, if my items has 10 objects then 10 outputText component will be created and another 10 outputText component will be created but it will be rendered based on some condition?

<h:dataTable var="item" value="#{bean.items}>
<h:outputText value="#{item.text}"/>
<h:outputText value="#{item.desc}" rendered="#{item.rendered}"/>
</h:dataTable>

My question is if I have 1000 items then 1000 * 2 outputText components will be created in memory. How do we avoid creating too many components in the memory? Is it possible? How ui:repeat tag will be helpful in this situation?

Please advice.

Thanks,
Saravanan
13 years ago
JSF
Hi,

I have a bean (configured in faces-config.xml and it is in session scope) which implements PageRenderListener and implemented the following method beforePageRender(PhaseEvent event) and afterPageRender(PhaseEvent event).

afterPageRender(PhaseEvent event) - No implementation exists in this method.

beforePageRender(PhaseEvent event) - Resetting backing bean values.

But when I debug it, I find that beforePageRender(PhaseEvent event) is getting executed 2 times. Is it the JSF behavior or something am doing wrong...

Please advice.

Thanks,
Kumar Saravanan
[ April 29, 2008: Message edited by: Kumar Saravanan ]
13 years ago
JSF
I did not see any update for mine... count me

Originally posted by Heven:
Is there still someone who have no results like me ?



I didn't receive the email yet and the Cert Manager has nothing but the part 1 history.



I didn't see any update in Cert Manager?
I Just received an email - Passed...
May be this can explain you clearly.

This is what my JSF code is:-

Maximum 3 radio buttons will be displayed.

<h:selectOneRadio id="type"
value="#{mybean.type}">
<f:selectItems value="#{myBean.types}"/>
</h:selectOneRadio>

But, I would like to display h:inputText (which will bound to a specific property in my managed bean) in between first 2 radio button.

Sorry for the confusion.

Thanks,
Kumar
14 years ago
JSF
Hi,

I would like to display 3 radio button and input text needs to be displayed in between first and second radio button with a specific intent.

I am using selectOneRadio to display radio buttons.

I have no idea how to embed the textfield inside the radio button.

Can anyone help?

Thanks,
Kumar
[ November 19, 2007: Message edited by: Bear Bibeault ]
14 years ago
JSF
Hi Mark,

selected dropdown value needs to be selected once the page is refreshed (onsubmit()) and that is the reason i have value="" in h:selectOneMenu.

Thanks
Kumar
14 years ago
JSF
This is my listener method

value is an instance variable in my backing bean.

public void changeValue(ValueChangeEvent event) {
value = (String) event.getNewValue();
FacesContext.getCurrentInstance().renderResponse();
}

in my xhtml page,

<h:selectOneMenu valueChangeListener="#{mybean.changeValue}" immediate="true" onchange="submit();"
value="#{mybean.value}">
<f:selectItems value="#{mybean.options}"/>
</h:selectOneMenu>
<ui:include src="mypage.xhtml"/>

My problem here is before the value change listener is getting invoked the getter property which is referred in mypage.xhtml is getting invoked before the value change listener.

can anyone assist?

Thanks
Kumar
[ November 14, 2007: Message edited by: Kumar Saravanan ]
14 years ago
JSF
Hi,

I would like to display the customized error message for each component (just above each component) in the jsf page.

I see some codes where they bind the component to the backing bean and identify the component id and setting the customized error message associated with the component.

It this the correct approach or please suggest me what is the correct approach to define customized error message for each component?

Thanks,
Kumar
14 years ago
JSF
Hey Alim,

thanks for your reply...code looks ugly if I start coding like that for each and every individual getter method...

like in jsp's you can catch them in local variable and iterate over them but in facelets how do you handle the same situation...

Thanks,
- Kumar
14 years ago
JSF
Hi,

I am using facelets and JSF. I would like to know how to catch the value in UI (I mean in UI Facelets tag) and reference that variable from JSF code.

Here is my problem, I am having a getter method which executes a database query and return the collection of results.

I referred this getter method (getValue) in my datatable like this:

<h:dataTable var="items" value="#{myBean.value}" rendered="#{not empty myBean.value}">
</h:dataTable>

In the above case, since I referred the "value" property 2 times, my getter method in Backing Bean is getting invoked 2 times (getValue).

I would like to avoid this repeated execution by execute the call and cache the result in faceletes tag and I can refer the variable from h:dataTable tag.

Can anyone suggest or advice me how to get catch the value in Facelets?

I tried in ui:param tag and it doesnt work. I tried c:set and the bean is not at all getting invoked.

Thanks
Kumar
14 years ago
JSF