Re: Refreshing A Panel Detail
ok... This is my header code The wicket:id=fullname does not change when i edit and save the details in my profile panel /** * * @author Gasper */ public class Header extends Panel implements IMarkupResourceStreamProvider, IAjaxIndicatorAware { private static final Log LOG = LogFactory.getLog(Header.class); @Override protected void onConfigure() { super.onConfigure(); //To change body of generated methods, choose Tools | Templates. LOG.debug("Session Status => UserSession.get().userLoggedIn() " + UserSession.get().userLoggedIn() + "\n UserSession.get().userNotLoggedIn() " + UserSession.get().userNotLoggedIn()); if (UserSession.get().userNotLoggedIn()) {//once True Redirect To LogIn Page setResponsePage(Login.class); } if (UserSession.get().userLoggedIn()) { //setDefaultModel(new CompoundPropertyModel(MyApplication.userBio_data)); LOG.debug("Updating Users " + UserSession.get().getUser().getMobile() + " Profile Since Sesion Still Exists and Re_Setting User's Session"); MyApplication.userLogin = MyApplication.loginJDBCTemplate.getlogin(UserSession.get().getUser().getMobile()); MyApplication.activityTemplate.insertactivity("Updating User Login into the Application", MyApplication.userLogin.getId(), dateTime()); MyApplication.userBio_data = MyApplication.bCTemplate.getbio_data(MyApplication.userLogin.getId()); //Re_Setting Session UserSession.get().setUser(MyApplication.userLogin); CookieService cookieService = MyApplication.get().getCookieService(); cookieService.saveCookie(getResponse(), REMEMBER_ME_LOGIN_COOKIE, MyApplication.userLogin.getMobile(), REMEMBER_ME_DURATION_IN_DAYS); System.out.println("FullName " + MyApplication.userBio_data.getFullName()); } } public Header(String id) { super(id); setDefaultModel(new CompoundPropertyModel(MyApplication.userBio_data)); add(new Label("fullName")); add(new Label("mobile")); add(new AjaxLink("myevents") {//Adding myeventsPanel @Override public void onClick(AjaxRequestTarget target) { Panel contentpanel = new EventHistory("contentpanel"); contentpanel.setOutputMarkupId(true); replacedPanel.replaceWith(contentpanel); target.add(contentpanel); replacedPanel = contentpanel; } }); //add(new IndicatingAjaxLink("profile") {//Adding profilePanel add(new AjaxLink("profile") {//Adding profilePanel @Override public void onClick(AjaxRequestTarget target) { LOG.debug("Ok we reach here"); Panel contentpanel = new profilePanel("contentpanel"); contentpanel.setOutputMarkupId(true); replacedPanel.replaceWith(contentpanel); target.add(contentpanel); replacedPanel = contentpanel; //addOrReplace(new profilePanel("contentpanel")); } }); add(new Link("endAppNow") { @Override public void onClick() { UserSession.get().invalidateNow(); setResponsePage(Login.class); } }); /* add(new AjaxLink("endAppNow") { @Override public void onClick(AjaxRequestTarget target) { UserSession.get().invalidateNow(); //CookieService cookieService = MyApplication.get().getCookieService(); //cookieService.removeCookieIfPresent(getRequest(), getResponse(), REMEMBER_ME_LOGIN_COOKIE); // //UserSession.get().setUser(null); //UserSession.get().invalidate(); setResponsePage(Login.class); } });*/ //Creating Notification Messages on Events //trigger an AJAX request every 300 seconds (5 minutes) AbstractAjaxTimerBehavior eventTimerBehaviour = new AbstractAjaxTimerBehavior(Duration.seconds(300)) { @Override protected void onTimer(AjaxRequestTarget target) { request request = MyApplication.requestJDBCTemplate.getNotificationRequest(MyApplication.userLogin.getId(), "1"); if (request != null) { if (request.getStatus().equalsIgnoreCase("1") && request.getVendorid() > 0 && request.getDetails().equalsIgnoreCase(defaultValues.NOT_SET)) { //target.appendJavaScript("Materialize.toast('" + MyApplication.userBio_data.getSurname() + ", a Studio is Available. Click <\"#\"> /menu/ ', 4000);");// For JQuery target.appendJavaScript("Materialize.toast('" + MyApplication.userBio_data.getSurname() + "', a Studio is Available. Set your requirements', 4000);");// For JQuery //
Re: Refreshing A Panel Detail
Sorry, it is coming late.. I am using CompoundPropertyModel Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-A-Panel-Detail-tp4678066p4678069.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Refreshing A Panel Detail
Hi, where is your header getting the user details from? Are you using Wicket's models to bind the information to the markup? Show use some code or even better create a quickstart. Have fun Sven Am 17.06.2017 um 18:52 schrieb gasper: Hello, I am using a Panel for my header and footer page.. Every other pages is a panel that is added between the header and footer I am having an issue updating details on the header page... For example users full name is on the header panel. Anytime i tried editing the user details in the profile page, The update was successful but the header panel full name details does not update ... I only see the changes when I Log Out and LogIn into the web application.. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-A-Panel-Detail-tp4678066.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Refreshing A Panel Detail
Hello, I am using a Panel for my header and footer page.. Every other pages is a panel that is added between the header and footer I am having an issue updating details on the header page... For example users full name is on the header panel. Anytime i tried editing the user details in the profile page, The update was successful but the header panel full name details does not update ... I only see the changes when I Log Out and LogIn into the web application.. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Refreshing-A-Panel-Detail-tp4678066.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Self Notification to users
Yea ... I will use both the AjaxTimer and header panel page So I don't have to call it on all pages ... Thanks for the Idea -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Self-Notification-to-users-tp4678062p4678065.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Self Notification to users
If you don't want to add either of the option on every page then you can use template with header page having feedback pane as Martin has suggested. -Mihir. On Sat, Jun 17, 2017, 4:30 AM Martin Grigorov wrote: > Hi, > > You have two options: > 1) polling with AbstractAjaxTimerBehavior > 2) pushing with WebSocketBehavior > > In both cases you need to add the behavior to all pages. And have some kind > of FeedbackPanel to render the notifications. > > On Jun 17, 2017 11:18 AM, "gasper" wrote: > > > Hello wicketers, > > > > I need help concerning how to create a notification message to users for > > every 1 minutes about new messages . > > > > If the users is on any page either home or contact page .. The user > should > > be able to get the notification messages . > > > > Thanks > > > > -- > > View this message in context: http://apache-wicket.1842946. > > n4.nabble.com/Self-Notification-to-users-tp4678062.html > > Sent from the Users forum mailing list archive at Nabble.com. > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > >
Re: Self Notification to users
Hi, You have two options: 1) polling with AbstractAjaxTimerBehavior 2) pushing with WebSocketBehavior In both cases you need to add the behavior to all pages. And have some kind of FeedbackPanel to render the notifications. On Jun 17, 2017 11:18 AM, "gasper" wrote: > Hello wicketers, > > I need help concerning how to create a notification message to users for > every 1 minutes about new messages . > > If the users is on any page either home or contact page .. The user should > be able to get the notification messages . > > Thanks > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/Self-Notification-to-users-tp4678062.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Self Notification to users
Hello wicketers, I need help concerning how to create a notification message to users for every 1 minutes about new messages . If the users is on any page either home or contact page .. The user should be able to get the notification messages . Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Self-Notification-to-users-tp4678062.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org