Mikel Martin

Greenhorn
+ Follow
since Nov 15, 2012
Merit badge: grant badges
For More
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 Mikel Martin

Many thanks for the answer.

As I am a newbie in J.S.F. I have been carefully examining your answer, but I got stucked in the last part of the answer (f:ajax).

I have written the following for the drop-down menu:



being english and spanish of the render attribute the id´s of the panel group when the firstRender method is false or true respectively.


But I can´t figure out how to make one or other render calling the firstRendered method in f:ajax

Many thanks
10 years ago
JSF
Hello,

I am trying to find out a way to render different xhtml pages according to the selected value.

In my web it would be to render the page in a language or other depending of the value selected in the drop-down menu.

I tried the following:

In the XHTML I would use the UIComponent SelectOnMenu with different values related to the different languages.


And the Managed Bean:


This does not work. My question is how could I render the two differents XHTML according to the different option values of the UIComponent.


10 years ago
JSF
Thank you.

I have sorted at the moment wit the action attribute in the commandButton that references to a method

in the managed bean whose body holds the facade object and the create method and return a new response page.

I think I need to become clearer about the navigation in J.S.F.
10 years ago
JSF
Hi,

I made a form with the AJAX function.
Something like this:

<h:commandButton id="register" value="SEND">
<f:ajax execute="firstName lastName" render="output"/>
</h:commandButton>

I set the entity file, the facade file with the persistence unit and the J.S.F. Managed Bean with
a injection of the facade .

I can send the form resulting in the AJAX efect, nothing is wrong here; but the data of the form is no stored in the database
generated by the entity.

Am I missing something in the command button where the AJAX function is nested?

Thanks
10 years ago
JSF
Thank you for the answer.


As far as I understand, the Managed Bean as part of the View Model don´t access JPA Domain Model but it is injected a session bean that holds public methods to create, edit, remove and find entities. In this indirect way the JSF XHTML can reference entities and hence the database.

Anyway, what I am trying to find is what is the best way in the JavaServer Faces framework, to access or to create a database from the front end (XHTML).
10 years ago
JSF
Thank you for the answer.

After some research I see the process of storing data of input components of a form.

A entity class is created -> a session facade is generated for that entity -> a J.S.F. managed bean is created with a reference to the facade through the use of dependency injection
-> a J.S.F. webpage is created with the values of the form component refering to the properties and methods of the J.S.F. managed bean.

But I have still the question of where are the tables generated by the entities.
How can I access those tables to check the information sent through the form?
10 years ago
JSF
I am new to Java Server Faces.

I set a XHTML page with a form in it, using the form component of J.S.F.

On the other hand I set a JPA entity with properties
and a JPA controller generated from that entity.

My question is how I connect the form of the XHTML with the properties of the JPA entity to persist
the data submitted through the form.

I need to invoke the JPA controller methods from the value attribute of the form component?

Could I see a example of the process? FORM COMPONENT -> J.P.A. ENTITY PROPERTIES


Thank you

10 years ago
JSF
I am trying to implement a template and I think it is very simple and perfect,
but still not working.

The code of the template is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:f="http://java.sun.com/jsf/core">

<h:head>
<title><ui:insert name="windowTitle"/></title>
<h:outputStylesheet library="css" name="styles.css"/>
<!--<link href="resources/styles.css" rel="stylesheet" type="text/css" ></link>-->
</h:head>

<h:body>
<div id="container">
<div id="header">
<ui:insert name="header">
Default header goes here
</ui:insert>
</div>


<div id="sidebarLeft">
<ui:insert name="sidebarLeft">
Default sidebarLeft goes here
</ui:insert>
</div>

<div id="sidebarRight">
<ui:insert name="sidebarRight">
Default sidebar right
</ui:insert>
</div>
<div id="footer">
<ui:insert name="footer">
Footer
</ui:insert>
</div>
<ui:debug/>
</div>
</h:body>
</html>

and the code of the user is:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:f="http://java.sun.com/jsf/core">

<h:head>
<title>IGNORED</title>
</h:head>

<h:body>
<ui:composition template="/templates/masterLayout.xhtml">



</ui:composition>
</h:body>
</html>

The position of the files are:
- templates
---masterLayout.xhtml
- outlets.xhtml

The output should be the full written in the template, but nothing shows. The page is blank

What is wrong?
10 years ago
JSF