Element f:event not expected. ADF - oracle-adf

I am trying to associate one f:event to a af:table in my fragment (jsff) as readed in other page.
This is the code:
< jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich" >
<af:table value="#{bindings.Departments.collectionModel}" var="row" rows="#{bindings.Departments.rangeSize}"
emptyText="#{bindings.Departments.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.Departments.rangeSize}" rowBandingInterval="0" id="t1">
Just below I want I put the line:
< f:event listener="#{managedBean.listenForEvent}" type="preRenderComponent"/ >
The problem is that I have an error in design time: Element f:event not expected. But I don´t know why, because in my version of JDeveloper 11g2.2.0 JSF 2.0 is included, and the element f:event belongs to the version 2.0.
Does anybody know why I cannot reference it?

The problem is that you can't attach the f:event to the af:table as it's not know event for the table (in your release). This may change with 12c (not sure about this).
You can however surround the table with a panel group and put the event in the. This may help you archive your use case.
As you did not tell us what you are trying to do, we can't help here.

This appears to be a bug in the design time then. Have you tried the runtime behavior? Does it work at runtime? JSF 2 system events are supported in JDeveloper 11g R2. So if the design time says different then the page source validation in the IDE is not correct. I'll verify with JDeveloper 11.1.2.2 and file a bug

Related

Set default date for zul datebox

I inherited a legacy website written in old zul and have to add new datebox component for birthday datepicker.
Have added a constraint to accept dates before a given date but that triggers an error alertbox from start as the date presented/selected by default on the datepicker is today.
I wouldn't want to use a workaround but to all due respect it seems like this is something over the top feature I'm looking for in zk's reality:
The main showcase for zul does include a birthday datebox, but pretty lame as it doesn't contain any constrain on age.
There is zk fiddler to show how the before constrain works, but that just proves my point that it doesn't select the first proper date for default date at least, if there is no clean way of setting it.
There is forum post that proposes a workaround to set the default year, so Zk is most probably incapable of doing this without a workaround.
There is an open ZK Jira issue from 2017 that addresses somewhat this issue, with a proposed solution pretty much the same as the workaround mentioned in the above point - so the hope is kinda lost, have to go on the workaround route.
I did try that workaround (after the forum post, as that has default year), but the workaround doesn't work for me. It does execute the
this.setValue(initialDate);
And I see that the value is set into the datebox's _pop/_value and _pop/_end nodes but no difference is visible on the datepicker box, still today is preselected altough it is greyed out - so no effect.
Still, when I try it in a fiddle with version 6.5.8.1, the oldest engine that exists, it does work, but not locally with v5.0.11.
In the buglist for this version there is no mention of datebox. Tried to look into to some bugs that might be interfering but turns out it was just another episode of me wasting time with this.
Tried in the 5.0.11 sandbox and it doesnt work with that version. The structure of how I use it is imitated in the linked fiddler. Hints on a workaround that works on this version?
ZK 5.0.11 is a bit on the older side currently, so it might not accept exactly the same overrides as later versions. If I understand the issue correctly, it boils down to either
1 - setting a value before Datebox is rendered to have a "initial date" opened in calendar.
I'd say that's the easy way out, since you can use either composing or databinding to set the value of the datebox during page rendering. Here's a small sample using databinding and zscripts, but the same logic should apply from composer with setValue(). You mentioned that this doesn't work for you locally with 5.0.11 though. Can you share the code that you are using for this? Sample code here in fiddle I can run it on local 5.0.11, and it set the date before popup is opened.
or
2 - setting an initial date (which doesn't affect the selected value) but would be the target for the opened calendar.
This is not a default ZK 5 behavior for datebox. If you want that effect, you would need to customize it using an override script. Simplest way in can think of in ZK 5 is to use the open event of the datebox popup here's an example of what it would look like (package in a script tag in a single page for the example, would use a global js file for real deployement) example here

Creating plugin for Django-CMS

I think I screwed up somewhere while trying to create a django-cms plugin and now I am unable to go back. The plugin (called sbbplugin) seems to be "working" (it gets displayed) but whenever I try to publish the site I get the following error:
DatabaseError at /admin/cms/page/18/publish/
relation "cmsplugin_sbbmodel" does not exist
LINE 1: ...id", "cmsplugin_sbbmodel"."cmsplugin_ptr_id" FROM "cmsplugin...
^
I tried removing the plugin but I can not do it because the page is not published. My plugin has no models or anything. Also I'm unable to remove the plugin from the page by clicking delete. Seems like the database is broken. Since I am not experienced enough to know what information you need I would appreciate it, if you could give me further instructions on what I should do.
Update: I think the problem is that I tried to use a model (sbbmodel) which I deleted. Should I try to add the model again? If so what should I do to fix the database? Do I have to run a migration for my app? Do I even have to register the plugin as an app?
Update2: So I tried to add the model again and migrate the app but I get the following error:
CommandError: One or more models did not validate:
sbbplugin.sbbmodel: Accessor for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
sbbplugin.sbbmodel: Reverse query name for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
S.sbbmodel: Accessor for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
S.sbbmodel: Reverse query name for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
which I do not really understand because I never specified a foreign key. I assume it is because I inherit from CMSPlugin. Any help?
I finally fixed it. First I removed every file that I created for my plugin. Then I deleted every instance of my plugin that was saved in the database. Unfortunately that did not solve the problem and I was still getting the same error even after restarting the server.
What did the trick was to go into phpPgAdmin and select all tables than choose "correct". It did not tell me what exactly the issue was but afterwards everything was back to normal again. So if you somehow run into the same problem, just "correct" your database automatically.

DNN: Registered Mark changing to Question Mark

I am having a problem with registered marks in the HTML module.  We need to use the Registered Trademark symbol (®) but some of them are being changed to question marks.  I can find no ryme or reason behind which change and which remain correct.  I have tried a number of things to fix this issue including the following:
Using ® and ®
using <sup>®</sup>
copy and paste of ® in both source and non source
and using the "insert special character" from the RTE menu
Some of the symbols remain but most revert back to question marks.  If i'm in edit mode, the questions marks change back to the registered mark.  Also sometimes the first time viewing the page not logged in or in view mode, they will look fine. But as soon as I got to edit mode or a new page then go back, they change back to question marks.  I am out of idea as to why this is happening.
You can see the page at: http://fasttracsc.twif.net/AboutFastTracSC.aspx  Anywhere you see Fasttrac? it should be Fasttrac®
Any help anyone can provide would be much appreciated.
Thanks in advance.
ok i have found the problem. The Rich Text Editor has a bug ("maybe by design?") that even the source button does not show you raw HTML. The RTE is still rendering the HTML prior to inserting into the database. If you change the RTE to Basic Text Box and edit the HTML there, you are once again able to get a consistent ® symbol using the ® code.

Reporting Services - Report Model (SDML) reference to Data Source View (DSV)

We have a ad-hoc reporting projecto where we created several data source views (DSV) and several Report Models (SDML). Frequently we need to change the DSV associated to a particular SDML, but we only found it's reference in one place: the "Data Source View Name" property (availabe through the VS properties pane) of the sdml file.
We found absolutly no reference to it anywhere else, not even in the sdml xml code view. But, strangly enough, VS asks to check out the sdml file when we change that "Data Source View Name" property ... then makes no change to the checked out file.
Finally, when we close the project and reopen it, VS forgets that property setting. This behavior points to some kind of in-memory-only saving location for that setting ...
Are we missing something or does anybody noticed similar behavior?
Thanks.
Bruno Lopes
Look in your ReportModel.smdlproj file (the project file).
View it in notepad rather than double-click, as that will just launch Visual Studio.
In the <Models> section you'll find:
<Models>
<ModelProjectItem>
<Name>MySmdlName.smdl</Name>
<FullPath>MySmdlName.smdl</FullPath>
<DsvName>MyDsvName</DsvName>
</ModelProjectItem>
</Models>
This is how VS associates the dsv and the smdl files.
Why this association is getting lost when you deploy I don't know, but this may help.
You are right. I do not know if it is by design or anything else but you can try doing this:
After deploying smdl's to the Report Server, click on Edit in the Model Definition section for a smdl. This downloads the smdl and the xml seems to have the DataSourceView element in it!

Explain System.Diagnostics.CodeAnalysis.SuppressMessage

I have this kind of code in some applications (from microsoft)
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Naming",
"CA1702:CompoundWordsShouldBeCasedCorrectly",
MessageId = "CounterClockwise",
Scope = "member",
Target = "ScePhotoViewer.PhotoDisplayControl.#RotatePhotoCounterClockwiseCommand"
)]
Can anyone explain me this ?
Is there any blog explaining how to use it, the real benefits...
Thanks
Jonathan
This attribute is used by Team Foundation Server's (TFS) code analysis functionality to exclude code fragments that would otherwise trigger warnings. You can safely remove them if you're not using TFS code analysis.
The attributes can be added by hand or, more usually, are added automatically via the Visual Studio GUI when the "Suppress Message" option is selected in the error list.
This attribute simply suppresses the generation of the specified warning messages during code analysis by TFS. No code is is excluded.

Resources