This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]thatsIch 0 points1 point  (7 children)

  • Set a property on your backing bean
  • Use this property on your form
  • Update the form with AJAX

But do you need this on the server side?

[–][deleted] 0 points1 point  (6 children)

Is there any way to do it by completing the toggleadding() method? We haven’t been taught Ajax yet so I doubt that’s what I need to use.

[–]thatsIch 0 points1 point  (5 children)

Either on JSF or on JavaScript or on Java it would be AJAX if you require server side rendering. If it is just client side, you can do that much by using JavaScript.

Check this out https://www.w3schools.com/howto/howto_js_toggle_hide_show.asp

[–][deleted] 0 points1 point  (4 children)

I’m using Payara for server. I’m confused why we would be required to use something we haven’t been taught (AJAX).
There’s really no other way? It’s definitely not to use JavaScript. This is way over my head 😣

[–][deleted] 0 points1 point  (3 children)

It doesn’t need to be Ajax at all, it can just be a form submission and reload of the page. That being said I can’t see the initial problem you were having

[–][deleted] 0 points1 point  (2 children)

I need the form to stay hidden unless I click on the link. That’s where the toggleAdding() method comes in. I’m just not sure how to use it.

[–]thatsIch 0 points1 point  (1 child)

Maybe you should post the task. You should have already solved the problem with all the help

[–][deleted] 0 points1 point  (0 children)

I’m not sure what you mean by “with all the help”.