|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Page framgments and interaction with the main page bodyHi All,
This is my first post here, and I am returning to the source after a few years of "not" programming... Anyways... I like the idea of the page fragments for creating re-use in the pages of the application I am designing. I would like to have the toolbar for my web app coded up in a page fragment, and have the fragments button actions interact with the rest of the page's server side java source? E.g. Fragment method savePage() calls USer Page savePage() with the specific logic for the user page encapsulated in the user page. Is such a thing possible? Attached is a scree shot of what I am trying to do.
Thanks, Sam. ![]() |
|
|
Re: Page framgments and interaction with the main page bodysamotage wrote:
> Hi All, > > This is my first post here, and I am returning to the source after a few > years of "not" programming... Anyways... > Welcome back, you were missed ;) > I like the idea of the page fragments for creating re-use in the pages of > the application I am designing. I would like to have the toolbar for my web > app coded up in a page fragment, and have the fragments button actions > interact with the rest of the page's server side java source? > > E.g. Fragment method savePage() calls USer Page savePage() with the > specific logic for the user page encapsulated in the user page. > > Is such a thing possible? > on the "save" icon in the toolbar. Is the "save" icon an ImageHyperlink component? If so in the designer, double click on the ImageHyperlink and it should take you to the source , where a method will be added for you, you can put the logic there to retrieve the returned data. Note, Page fragment is a static include in the main page. You may have to keep a reference (may in the session bean) to keep track of the current page. - Winston http://blogs.sun.com/winston > Attached is a scree http://www.nabble.com/file/p14167127/FragmentToolbar.jpg > shot of what I am trying to do. > > Thanks, > Sam. http://www.nabble.com/file/p14167127/FragmentToolbar.jpg > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: Page framgments and interaction with the main page bodyThanks Winston,
Yes, what you say is spot on, I want the save in the toolbar fragment to send the save event to it's host page bean. And the save image is an image hyperlink. As you mention, the trick I see is getting the pages to know about each other... So it seems that... 1. The session bean needs to know about the current main jsp page 2. The fragment executes it's action method in the fragment bean, which asks the session for the current page beans refrence, and calls an appropriate method on the current page bean to send the toolbar code 3. The current page bean uses say a case statement to decode the toolbar code sent and then executes it's appropriate method to perform the operation... My head is humming now, and I will see how I go trying to code it all up! Sam.
|
| Free Forum Powered by Nabble | Forum Help |