Michael Gor

Greenhorn
+ Follow
since Oct 07, 2011
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 Michael Gor

Ok, writing a servlet would probably be the simplest way.

Thank you!
7 years ago
JSF
Actually, I didn´t want to use external parameters. I just wanted to make a download link. My first try was:



SomeBean has a method public void download, which renders data to the HttpServletResponse. It works inside a primefaces data table, but it did not work inside a plain command link, the download method was never triggered. So I tried to create another request scoped bean "bean", which gets the object id from the parameters, retrieves the object and delegates the download request to it.
Yes, to use a view scoped beans would be possible, but I use spring and would have to implement a custom scope, and I just don´t like such workarounds. There should be more staight forward solution.

Any idea, why my first attempt fails?
7 years ago
JSF
Hi,

I have something like this:



In the debugger I can see that the value of someBean.id is resolved after I trigger the link. Is it possible to force JSF to resolve the value immediately, so the bean that provides the id value is not required later?

Thanks in advance!
7 years ago
JSF
I have a composite component, which is quite empty for the moment:



Now I want to insert some components I´ve writte the following test code:



I would expect an html input to be rendered after the string Test, but nothing happens. How is it meant to be done?
7 years ago
JSF
I don´t want to redefine the dialog structure, just the object that is displayed in the dialog.

Just imagine another example, a bean that represents a list of cars (other beans), and a dialog that displays car details. The dialog definition does not change, but I want to use the same dialog to show details of different cars.

Look at this show case:
Primefaces dialog ShowCase

Here, they use the property "selectedCar" of the list-bean to identify the bean they want to reference in the dialog. In my case, I don´t use a data table and I don´t have a property "selectedObject" or anything else to identify which object I want to use. In fact, I even want to be able to show multiple dialogs at the same time, but it´s not a must have atm.
Instean of a data table, I have multiple commandLinks or commandButtons, and each one of them should open the same dialog, but display the properties of different "cars". Each commandLink knows, which "car" it wants to display, but how can I pass this info to the dialog? I hope, I described the problem more obvious now...
7 years ago
JSF
I don´t understand exactly, what you mean... The dialog/facelet component can display properties of one bean, so there is no problem with property names. It cound be smth like this:



Now, I have several options objects on the same page. They all are properties of another bean and have different names. For example, getOptionsA, getOptionsB...

So, I want to include my dialog component only once, but call it with different parameters. But in my understandig, I can only pass parameters when I include a facelet, e.g. in the <ui:include> tag. But I want to have different beans for the same parameter, depending which button the users clicks - all on the same page.
Any ideas?
7 years ago
JSF
Hello,

I have a small facelet composition, which consists of a primefaces dialog which displays values from a backing bean. Now I want to use this component to display data from different items. How can I do it?

For example, I could have a backing bean looking like this:

class ItemHandler {
public Object getFirstItem() { ... }
public Object getSecondItem() { ... }
}

I could set a parameter when I include the component, e.g.:

<ui:include src="...">
<ui:param name="item" value="#{itemHandler.firstItem}" />
</ui:parameter>

But what can I do, if I want to have multiple buttons, that display the info dialog for different items from the handler?
7 years ago
JSF
Hello,

with tomcat 7, I get the following exception on startup:

java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException

I use maven for dependency management. After some searching, I found out that the following dependency seams to cause the problem

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>


But the scope of the dependency is provided, so it should not case problems at startup? And I think, tomcat 7 should include the required servlet api 3.0 implementation, so I don´t really understand the problem. Could some one help me?
7 years ago