| |

VerySource

 Forgot password?
 Register
Search
View: 805|Reply: 4

Elementary JSF conceptual issues, passing parameters with hidden input

[Copy link]

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Germany

Post time: 2020-1-25 13:00:02
| Show all posts |Read mode
Did not understand how to use JSF's hidden input to pass parameters,

If the parameter is passed, there must be a source and a destination

For example, <h: inputText value = "# {user.name}" /> The source is the parameter entered by the user in the input box, and the destination is the user's backbean attribute value.

Then look at the example of hidden input:

<h: inputHidden value = ”# {bb.id}” /> What value is this bound to the id attribute of the bb bean? Or this bb.id is not the destination but the source, then what method is used to obtain this value in the background bean?

Can you give me an explanation on how to get the hidden value? Thank you!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-21 15:00:01
| Show all posts
The source can be the initial value in the bean,
It can also be a value generated by entering information,
In fact, it is the same as inputText, but it is invisible to the user and cannot be entered.
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-21 22:00:01
| Show all posts
It's the same as inputtext! Just quite read-only
You don't need to write a set method.
Reply

Use magic Report

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Germany

 Author| Post time: 2020-7-7 17:30:01
| Show all posts
Thank you, two people upstairs. I used inputHidden to pass the attribute value of a session bean to another bean through the page.

For example, users send messages. After logging in, the user.name attribute value is hidden on the message input page. When submitting, the implicit value is passed to another backbean dbin.name. The function is to save the message content and the sender in the database.

I have now bypassed this problem, using commandLink plus <f:param to achieve the transfer of parameters

But I still don’t know how to use inputHidden. I haven’t tried it for a long time. Can you give me an example? I read a few examples on the Internet. It seems that I have misunderstood this thing. I can’t see that it can pass the property values ​​of other beans to the function of another bean. Can you tell me more in detail and what value , Where did it go?

Thanks huh
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-7 21:00:02
| Show all posts
There is no need to make it so complicated. In a session bean, you can directly read the attribute value of another session bean by
(your beanName)getValueBinding(getJsfEl("beanName")).getValue(FacesContext.getCurrentInstance());
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list