Author |
Message |
|
Hello,
I have several Grids in in page, each of which has an Icon for GridBinding#textSearcher#onPrevious, GridBinding#textSearcher#onNext, a field for GridBinding#textSearcher#text plus an icon pointing to GridBinding#onEditColumnDetails.
I put this into a JSP which I can rowinclude into another JSP. My searchAndChooseColumns.jsp looks like this:
Code:
<t:row id="g_1" >
<t:icon id="g_2" actionListener="#{PATHTOGRIDBINDING.textSearcher.onPrevious}" image="/eclntjsfserver/images/control_playbackwards.png" />
<t:field id="g_3" actionListener="#{PATHTOGRIDBINDING.textSearcher.onNext}" bgpaint="image(100%-5,50%,/images/icons/magnifier.png,rightmiddle)" enabled="true" flush="true" selectallwhenfocussed="true" tabonenter="true" tabonenteralwaysflush="true" text="#{PATHTOGRIDBINDING.textSearcher.text}" textimage="/eclntjsfserver/images/magnifier.png" width="100" />
<t:icon id="g_4" actionListener="#{PATHTOGRIDBINDING.textSearcher.onNext}" image="/eclntjsfserver/images/control_play.png" />
<t:coldistance id="g_5" width="100%" />
<t:icon id="g_6" actionListener="#{PATHTOGRIDBINDING.onEditColumnDetails}" image="/eclntjsfserver/images/table.png" />
</t:row>
The page which rowincludes this does the following:
<t:rowinclude id="g_13" contentreplace="PATHTOGRIDBINDING:d.VorgangsEditorUI.vorgaenge" page="/util/searchAndChooseColumns.jsp" />
Very fine so far.
What I had before I extracted the common code into a JSP was something like this:
Code:
<t:field id="g_3" actionListener="#{d.VorgangsEditorUI.vorgaenge.textSearcher.onNext}" ... popupmenu="caseSensitivity" text="#{d.VorgangsEditorUI.vorgaenge.textSearcher.text}" ... />
...
<t:popupmenu id="caseSensitivity" >
<t:menuitem id="g_53" actionListener="#{d.VorgangsEditorUI.searchCaseSensitiveOn}" command="CaseSensitivityOn" rendered="#{d.VorgangsEditorUI.searchCaseInsensitive}" text="#{rr.editortexte['sorting_casesensitive']}" />
<t:menuitem id="g_54" actionListener="#{d.VorgangsEditorUI.searchCaseSensitiveOff}" command="noCaseSensitivity" rendered="#{d.VorgangsEditorUI.searchCaseSensititve}" text="#{rr.editortexte['sorting_caseinsensitive']}" />
</t:popupmenu>
My problem is now, that I would like to extract the context menu into my searchAndChooseColumns.jsp like this:
Code:
<t:field id="g_3" actionListener="#{PATHTOGRIDBINDING.textSearcher.onNext}" ... popupmenu="PATHTOUI-caseSensitivity" text="#{PATHTOGRIDBINDING.textSearcher.text}" ... />
...
<t:popupmenu id="PATHTOUI-caseSensitivity" >
<t:menuitem id="g_53" actionListener="#{PATHTOUI.searchCaseSensitiveOn}" command="CaseSensitivityOn" rendered="#{PATHTOUI.searchCaseInsensitive}" text="#{rr.editortexte['sorting_casesensitive']}" />
<t:menuitem id="g_54" actionListener="#{PATHTOUI.searchCaseSensitiveOff}" command="noCaseSensitivity" rendered="#{PATHTOUI.searchCaseSensititve}" text="#{rr.editortexte['sorting_caseinsensitive']}" />
</t:popupmenu>
My rowinclude would then look like this:
Code:
<t:rowinclude id="g_13" contentreplace="PATHTOUI:d.VorgangsEditorUI;PATHTOGRIDBINDING:d.VorgangsEditorUI.vorgaenge" page="/util/searchAndChooseColumns.jsp" />
Of course, this cannot work, since the Dev Guide says about Popup Menus:
Popup menus are defined on top level of a page. In the example there are three popup menus defined, each getting an explicit id: "POPUPMENU1", "POPUPMENU2" and "POPUPMENU3".
Even worse defining the Popup Menu with the ID d.VorgangsEditorUI-caseSensitivity and then referencing it in the searchAndChooseColumns.jsp via popupmenu="PATHTOUI-caseSensitivity" wont work.
Is there any way to get a dynamic popupmenu running within a jsp which is used in several places via rowinclude?
Thanks,
Björn
|
|
|
I think you understood me very well even though my question was probably ambigious.
So basically, it is not possible to adapt the PageBrowser to pass in an instance of ICLIENTMETHODCALLERTarget to use for callback (which I would call then instance-based callback), because in the JSP, this callback instance simply cannot be used.
Unfortunately, I don't know very much about JSP, otherwise I could probably easier understand, why things are done the way they are done. If I understand you right, it's simply because this is the only way it could work.
Thanks,
Björn
|
|
|
Hi,
for my own interest I'd like to ask the following questions: Why is the Callback in CLIENTMETHODCALLER class-based? Couldn't it be instance-based, too?
The reason why I'm asking this, is the consequence of class-based callback that you need a static (global) field/method to communicate messages, because the Class which implements ICLIENTMETHODCALLERTarget is instantiated by the framework needs to send somehow messages somewhere. This works, but feels weird to me.
Regards,
Björn
|
|
|
What we did now was to first provide the session ID in the Application URL passed into the pagebrowser.
Code:
URL + "SessionId=" + sessionId;
and then have a SessionPhaseListener registered:
Code:
<lifecycle>
<phase-listener>smonitor.cc.ui.SessionPhaseListener</phase-listener>
</lifecycle>
which then reads the URL param and registers it in the FacesContext:
Code:
@Override
public void beforePhase(PhaseEvent arg0) {
FacesContext context = FacesContext.getCurrentInstance();
String sessionId = request.getParameter("SessionId");
FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().put(..., sessionId)
}
This way we do not need clientmethodreceiver any more. Since our complete application depends on the Session ID, it makes sense to set it globally instead of dynamically via clientmethodreceiver.
Björn
|
|
|
Hi,
my business requirements demant to persist the workspace layout per user and reload it at the next startup.
I'd like to start with the Splitpane Divider Location. The first step would be to have a Listener registered, which can react on new divider locations. I have found
org.eclnt.client.elements.impl.SPLITPANEElement.processNewDiverLocation() and org.eclnt.client.elements.impl.SPLITPANEElement.MyPropertyChangeListener.propertyChange(PropertyChangeEvent).
What I would need here is an extension point to hook into here to be able to react on (persist) a new divider location.
Does there exist any extension point for this purpose?
Thanks,
Björn
|
|
|
Hi,
I use a PageBrowser and a clientmethodreceiver to pass a session id from an outside swing application into my CaptainCasaApplication.
Code:
m_pageBrowser = new PageBrowser(urlServer, urlAddress, 0,mainFrame, mainFrame, false, false);
// transfer session id
CLIENTMETHODRECEIVERElement.sendMessageToServer(sessionId);
It seems that when I call the constructor method the jsp of the CC app is rendered already, but my data access layer needs the session id, so I'd like rendering to take place a little later, after that clientmethodreceiver call has been done.
What do you think, what is an elegant way to achieve this?
We're thinking about passing the session id as a URL parameter in the urlAddress String. Are there any nice alternatives?
Thanks,
Björn
|
|
|
It turned out my problem was in the end, that the Property Files I created were not correctly deployed, but the old ones. The lesson learned here is to have a look into the unzipped war file in your tomcat webapps directory and correct things in there if necessary. Or to cleanly build and deploy, to be sure.
Dots in Property Keys should actually work, but I'll not try to find that out. Underscore works for me so I'llk stick to these now.
Thanks Björn for your help.
|
|
|
Actually, I just replaced the dot in the Property key by an underscore.
Now, I see no Property-Key-Related Errors any more and my field which is binded to the Resource key says: {EditorTexte.vorgangseditor_banknummer}
This might be a deployment issue, so I'll do a complete redeploy and meanwhile find out how to do screensharing ...
|
|
|
Hi,
I get the following exception when using a Resource Bundle:
Code:
2012:06:13 15:19:17:933 | 18 | INFO | Problems getting property: #{rr.EditorTexte['vorgangseditor.banknummer']}, java.lang.StringIndexOutOfBoundsException: String index out of range: -1
.......... Stacktrace Info ..........
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at org.eclnt.jsfserver.util.StackedValueExpression.getValue(StackedValueExpression.java:213)
at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2230)
at org.eclnt.jsfserver.elements.BaseComponent.getAttributesGet(BaseComponent.java:1365)
at org.eclnt.jsfserver.elements.BaseComponent.encodeBegin(BaseComponent.java:590)
at org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.encodeSubComponent(FIXGRIDComponent.java:1163)
at org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.encodeChildren(FIXGRIDComponent.java:782)
at org.eclnt.jsfserver.elements.BaseComponent.encodeSubComponent(BaseComponent.java:1055)
at org.eclnt.jsfserver.elements.BaseComponent.encodeSubComponent(BaseComponent.java:1060)
at org.eclnt.jsfserver.elements.BaseComponent.encodeChildren(BaseComponent.java:820)
What's going on?
Thanks,
Björn
|
|
|
Hi,
we implemented a SpringContextDispatcher, which inherits from org.eclnt.workplace.WorkpageDispatcher and overrides the readObject-Method so that all Objects being read run through a Spring BeanPostProcessing.
Our class has a constructor and as soon as that constructor contains the following line:
Code:
autoWireProcessor.setBeanFactory(applicationContext.getAutowireCapableBeanFactory());
... the UI Development tools do not show the Beans we have entered in the dispatcherinfo.xml. These Beans are in a different Package than Dispatcher and SpringContextDispatcher.
There exists a workaround to cope with this: Adding references to our beans in the project setup/configuration as additionalmanagedbean. If you do that, our Beans are shown in the Bean Browser, but instead of within, next to the Bean Browser (see workaround.jpg, the prefix "d." actually is written in the name attribute of the additionalmanagedbean tag).
Any hints to explain this behaviour are welcome.
Thanks,
Björn
|
|
|
What you write explains exactly what I saw. I'll have a closer look at the cctiledarea-Directory in the future.
I'd suggest you add this point to the dev guide - a beginner like me naturally gets into trouble here, when incrementally playing around.
My lesson learned here is to have a close look at the tomcat runtime directory and the recently modified or added files in this directory. If a had done this, I could have found the XML-File by myself. Or I could have grepped through the persistId I had given my tiled area.
Thanks for your help,
Björn
|
|
|
Hi,
I want to work with a tiled area, so I incorporated the Demo Workplace Example into my page, which is a bit more komplex.
After that, I created an own tile and added it as a fourth tile into the tiled area.
After that, I threw out the home address tile.
At this point something weird happend: Suddenly, the tiled area was empty. Debugging showed that the Method getPageName is not called any more. It seems to me, the framework does not even try to render the tiles any more (because in order to do that, the jsp name needs to be gotten by the framework).
In the end, I didn't even get the original example with the three tiles to work any more. But with my fourth tile, things suddenly work.
Here is an illustration of what works or not by showing the addTile-Operations...
works:
m_tiledAreaBinding.addTile("RVT", "Regelverstoßübersicht", m_regelverstossUebersicht, "33%;100");
m_tiledAreaBinding.addTile("HOME","Home Address",m_homeAddress, "33%;100");
m_tiledAreaBinding.addTile("BUSINESS","Business Address",m_businessAddress, "33%;100");
m_tiledAreaBinding.addTile("VACATION","Vacation Address",m_vacationAddress, "33%;100");
works:
m_tiledAreaBinding.addTile("RVT", "Regelverstoßübersicht", m_regelverstossUebersicht, "33%");
m_tiledAreaBinding.addTile("HOME","Home Address",m_homeAddress, "300");
m_tiledAreaBinding.addTile("BUSINESS","Business Address",m_businessAddress, "300");
m_tiledAreaBinding.addTile("VACATION","Vacation Address",m_vacationAddress, "300");
works:
m_tiledAreaBinding.addTile("RVT", "Regelverstoßübersicht", m_regelverstossUebersicht, "33%");
m_tiledAreaBinding.addTile("HOME","Home Address",m_homeAddress, "300");
m_tiledAreaBinding.addTile("BUSINESS","Business Address",m_businessAddress, "100%");
m_tiledAreaBinding.addTile("VACATION","Vacation Address",m_vacationAddress);
works:
m_tiledAreaBinding.addTile("RVT", "Regelverstoßübersicht", m_regelverstossUebersicht, "200");
m_tiledAreaBinding.addTile("HOME","Home Address",m_homeAddress, "200");
m_tiledAreaBinding.addTile("BUSINESS","Business Address",m_businessAddress, "200");
m_tiledAreaBinding.addTile("VACATION","Vacation Address",m_vacationAddress, "200");
works not:
m_tiledAreaBinding.addTile("HOME","Home Address",m_homeAddress);
m_tiledAreaBinding.addTile("BUSINESS","Business Address",m_businessAddress);
m_tiledAreaBinding.addTile("VACATION","Vacation Address",m_vacationAddress);
works not:
m_tiledAreaBinding.addTile("HOME","Home Address",m_homeAddress, "33%;100");
m_tiledAreaBinding.addTile("BUSINESS","Business Address",m_businessAddress, "33%;100");
m_tiledAreaBinding.addTile("VACATION","Vacation Address",m_vacationAddress, "33%;100");
works not:
m_tiledAreaBinding.addTile("HOME","Home Address",m_homeAddress, "300");
m_tiledAreaBinding.addTile("BUSINESS","Business Address",m_businessAddress, "300");
m_tiledAreaBinding.addTile("VACATION","Vacation Address",m_vacationAddress, "300");
works not:
m_tiledAreaBinding.addTile("RVT", "Regelverstoßübersicht", m_regelverstossUebersicht, "25%");
works not:
m_tiledAreaBinding.addTile("RVT", "Regelverstoßübersicht", m_regelverstossUebersicht);
My questions are:
1. Some of my tiles are shown like foldable areas isOpened=true, others like isOpened=false. Why can that be.
2. Within the tiled area, the fact if some tiles are rendered or not seems to be dependent on whether other tiles are present in the pane or not. That seems magic to me. How can it be.
3. What is a good strategy for setting the height attribut when calling addTile(...)? Is something like "33%;100" OK?
Thanks,
Björn
|
|
|
|
|